From 6358b11516410a62ba7c5ecc1db8148b8da71003 Mon Sep 17 00:00:00 2001 From: Chris Couzens Date: Sat, 27 Jul 2019 14:48:36 +0100 Subject: [PATCH 01/75] Bash skip empty query param fix (#3290) * Bash: Update samples I'm about to make a fix to the bash generator. I'm regenerating the samples in this commit so that the change I make isn't lost amongst the noise. https://github.com/OpenAPITools/openapi-generator/pull/3290 * Bash client: Fix query params seperation Fix bug where empty query parameters weren't separated by ampersands. For example, this ```bash bash bash_keycloak/client.sh -v --oauth2-bearer "$access_token" --host "$api_host" realmUsersGet realm=demo_realm2 email=foo+bar@baz.com ``` would generate the path `/auth/admin/realms/demo_realm2/users?briefRepresentation=email=foo+bar@baz.comfirst=firstName=lastName=max=search=username=`. It now puts ampersands around them to make `/auth/admin/realms/demo_realm2/users?briefRepresentation=&email=foo+bar@baz.com&first=&firstName=&lastName=&max=&search=&username=` Instead of predicting if there is going to be a `parameter_value` ahead of time, we now put in the ampersand if there is a `parameter_value` and existing `query_request_part`. https://github.com/OpenAPITools/openapi-generator/pull/3290 * Bash: Skip query parameters with empty value I have a route with many optional query parameters. I observed that when they weren't specified, they were still included in the routes, but without a value. Running: ```bash bash bash_keycloak/client.sh -v --header "Authorization: Bearer $access_token" --host "$api_host" --dry-run realmUsersGet realm=demo_realm2 email=foo+bar@baz.com username=foo ``` Would produce the route: `http://localhost:8080/auth/admin/realms/demo_realm2/users?briefRepresentation=&email=foo+bar@baz.com&first=&firstName=&lastName=&max=search=&username=foo` After this change it produces the route: ``http://localhost:8080/auth/admin/realms/demo_realm2/users?email=foo+bar@baz.com&username=foo --- I discussed with @wing328 in the pull request about if empty values (eg `username=` should produce an empty query parameter, or if the query parameter should be removed. We decided it should remove the query parameter. https://github.com/OpenAPITools/openapi-generator/pull/3290 ---- The OpenAPI definition I was using: Using: https://github.com/ccouzens/keycloak-openapi/blob/master/keycloak/6.0.json In particular: ```json "/{realm}/users": { "get": { "summary": "Get users Returns a list of users, filtered according to query parameters", "parameters": [ { "in": "query", "name": "briefRepresentation", "schema": { "type": "boolean" }, "style": "form" }, { "in": "query", "name": "email", "schema": { "type": "string" }, "style": "form" }, { "in": "query", "name": "first", "schema": { "type": "integer", "format": "int32" }, "style": "form" }, { "in": "query", "name": "firstName", "schema": { "type": "string" }, "style": "form" }, { "in": "query", "name": "lastName", "schema": { "type": "string" }, "style": "form" }, { "in": "query", "name": "max", "description": "Maximum results size (defaults to 100)", "schema": { "type": "integer", "format": "int32" }, "style": "form" }, { "in": "query", "name": "search", "description": "A String contained in username, first or last name, or email", "schema": { "type": "string" }, "style": "form" }, { "in": "query", "name": "username", "schema": { "type": "string" }, "style": "form" } ], ``` --- .../src/main/resources/bash/client.mustache | 13 +- .../petstore/bash/.openapi-generator/VERSION | 2 +- samples/client/petstore/bash/README.md | 39 +- samples/client/petstore/bash/_client.sh | 594 +++ samples/client/petstore/bash/_petstore-cli | 41 +- samples/client/petstore/bash/client.sh | 4003 +++++++++++++++++ .../petstore/bash/client.sh.bash-completion | 326 ++ .../petstore/bash/docs/$special[modelName].md | 10 + .../client/petstore/bash/docs/200Response.md | 11 + .../bash/docs/AdditionalPropertiesAnyType.md | 10 + .../bash/docs/AdditionalPropertiesArray.md | 10 + .../bash/docs/AdditionalPropertiesBoolean.md | 10 + .../bash/docs/AdditionalPropertiesClass.md | 13 +- .../bash/docs/AdditionalPropertiesInteger.md | 10 + .../bash/docs/AdditionalPropertiesNumber.md | 10 + .../bash/docs/AdditionalPropertiesObject.md | 10 + .../bash/docs/AdditionalPropertiesString.md | 10 + .../petstore/bash/docs/AnotherFakeApi.md | 17 +- .../client/petstore/bash/docs/ArrayTest.md | 6 +- .../petstore/bash/docs/Capitalization.md | 8 +- samples/client/petstore/bash/docs/CatAllOf.md | 10 + samples/client/petstore/bash/docs/Category.md | 2 +- .../client/petstore/bash/docs/ClassModel.md | 2 +- .../client/petstore/bash/docs/DefaultApi.md | 39 + samples/client/petstore/bash/docs/DogAllOf.md | 10 + .../client/petstore/bash/docs/EnumArrays.md | 4 +- samples/client/petstore/bash/docs/EnumTest.md | 14 + samples/client/petstore/bash/docs/FakeApi.md | 229 +- .../bash/docs/FakeClassnameTags123Api.md | 11 +- .../petstore/bash/docs/FileSchemaTestClass.md | 11 + samples/client/petstore/bash/docs/Foo.md | 10 + .../client/petstore/bash/docs/FormatTest.md | 22 + .../petstore/bash/docs/HealthCheckResult.md | 10 + .../client/petstore/bash/docs/InlineObject.md | 11 + .../petstore/bash/docs/InlineObject1.md | 11 + .../petstore/bash/docs/InlineObject2.md | 11 + .../petstore/bash/docs/InlineObject3.md | 23 + .../petstore/bash/docs/InlineObject4.md | 11 + .../petstore/bash/docs/InlineObject5.md | 11 + .../bash/docs/InlineResponseDefault.md | 10 + samples/client/petstore/bash/docs/MapTest.md | 6 +- samples/client/petstore/bash/docs/Name.md | 2 +- .../petstore/bash/docs/NullableClass.md | 21 + .../petstore/bash/docs/OuterComposite.md | 6 +- .../bash/docs/OuterEnumDefaultValue.md | 9 + .../petstore/bash/docs/OuterEnumInteger.md | 9 + .../bash/docs/OuterEnumIntegerDefaultValue.md | 9 + samples/client/petstore/bash/docs/PetApi.md | 126 +- .../petstore/bash/docs/SpecialModelName.md | 10 + samples/client/petstore/bash/docs/StoreApi.md | 42 +- .../petstore/bash/docs/TypeHolderDefault.md | 14 + .../petstore/bash/docs/TypeHolderExample.md | 14 + samples/client/petstore/bash/docs/UserApi.md | 90 +- samples/client/petstore/bash/docs/XmlItem.md | 38 + samples/client/petstore/bash/petstore-cli | 529 ++- .../bash/petstore-cli.bash-completion | 24 +- 56 files changed, 6316 insertions(+), 248 deletions(-) create mode 100644 samples/client/petstore/bash/_client.sh create mode 100644 samples/client/petstore/bash/client.sh create mode 100644 samples/client/petstore/bash/client.sh.bash-completion create mode 100644 samples/client/petstore/bash/docs/$special[modelName].md create mode 100644 samples/client/petstore/bash/docs/200Response.md create mode 100644 samples/client/petstore/bash/docs/AdditionalPropertiesAnyType.md create mode 100644 samples/client/petstore/bash/docs/AdditionalPropertiesArray.md create mode 100644 samples/client/petstore/bash/docs/AdditionalPropertiesBoolean.md create mode 100644 samples/client/petstore/bash/docs/AdditionalPropertiesInteger.md create mode 100644 samples/client/petstore/bash/docs/AdditionalPropertiesNumber.md create mode 100644 samples/client/petstore/bash/docs/AdditionalPropertiesObject.md create mode 100644 samples/client/petstore/bash/docs/AdditionalPropertiesString.md create mode 100644 samples/client/petstore/bash/docs/CatAllOf.md create mode 100644 samples/client/petstore/bash/docs/DefaultApi.md create mode 100644 samples/client/petstore/bash/docs/DogAllOf.md create mode 100644 samples/client/petstore/bash/docs/EnumTest.md create mode 100644 samples/client/petstore/bash/docs/FileSchemaTestClass.md create mode 100644 samples/client/petstore/bash/docs/Foo.md create mode 100644 samples/client/petstore/bash/docs/FormatTest.md create mode 100644 samples/client/petstore/bash/docs/HealthCheckResult.md create mode 100644 samples/client/petstore/bash/docs/InlineObject.md create mode 100644 samples/client/petstore/bash/docs/InlineObject1.md create mode 100644 samples/client/petstore/bash/docs/InlineObject2.md create mode 100644 samples/client/petstore/bash/docs/InlineObject3.md create mode 100644 samples/client/petstore/bash/docs/InlineObject4.md create mode 100644 samples/client/petstore/bash/docs/InlineObject5.md create mode 100644 samples/client/petstore/bash/docs/InlineResponseDefault.md create mode 100644 samples/client/petstore/bash/docs/NullableClass.md create mode 100644 samples/client/petstore/bash/docs/OuterEnumDefaultValue.md create mode 100644 samples/client/petstore/bash/docs/OuterEnumInteger.md create mode 100644 samples/client/petstore/bash/docs/OuterEnumIntegerDefaultValue.md create mode 100644 samples/client/petstore/bash/docs/SpecialModelName.md create mode 100644 samples/client/petstore/bash/docs/TypeHolderDefault.md create mode 100644 samples/client/petstore/bash/docs/TypeHolderExample.md create mode 100644 samples/client/petstore/bash/docs/XmlItem.md diff --git a/modules/openapi-generator/src/main/resources/bash/client.mustache b/modules/openapi-generator/src/main/resources/bash/client.mustache index e59d63b3f77..d53e1a937d5 100644 --- a/modules/openapi-generator/src/main/resources/bash/client.mustache +++ b/modules/openapi-generator/src/main/resources/bash/client.mustache @@ -416,18 +416,16 @@ build_request_path() { local query_request_part="" - local count=0 for qparam in "${query_params[@]}"; do + if [[ "${operation_parameters[$qparam]}" == "" ]]; then + continue + fi + # Get the array of parameter values local parameter_value="" local parameter_values mapfile -t parameter_values < <(sed -e 's/'":::"'/\n/g' <<<"${operation_parameters[$qparam]}") - if [[ -n "${parameter_values[*]}" ]]; then - if [[ $((count++)) -gt 0 ]]; then - query_request_part+="&" - fi - fi {{#hasAuthMethods}}{{#authMethods}}{{#isApiKey}}{{#isKeyInQuery}} if [[ ${qparam} == "{{keyParamName}}" ]]; then if [[ -n "${parameter_values[*]}" ]]; then @@ -508,6 +506,9 @@ build_request_path() { fi if [[ -n "${parameter_value}" ]]; then + if [[ -n "${query_request_part}" ]]; then + query_request_part+="&" + fi query_request_part+="${parameter_value}" fi diff --git a/samples/client/petstore/bash/.openapi-generator/VERSION b/samples/client/petstore/bash/.openapi-generator/VERSION index 096bf47efe3..83a328a9227 100644 --- a/samples/client/petstore/bash/.openapi-generator/VERSION +++ b/samples/client/petstore/bash/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/bash/README.md b/samples/client/petstore/bash/README.md index a543b69de1b..9e6a8c0dac3 100644 --- a/samples/client/petstore/bash/README.md +++ b/samples/client/petstore/bash/README.md @@ -1,6 +1,7 @@ # OpenAPI Petstore Bash client ## Overview + This is a Bash client script for accessing OpenAPI Petstore service. The script uses cURL underneath for making all REST calls. @@ -43,6 +44,7 @@ $ petstore-cli --host http://: --dry-run ``` ## Docker image + You can easily create a Docker image containing a preconfigured environment for using the REST Bash client including working autocompletion and short welcome message with basic instructions, using the generated Dockerfile: @@ -59,6 +61,7 @@ is also available. ## Shell completion ### Bash + The generated bash-completion script can be either directly loaded to the current Bash session using: ```shell @@ -72,10 +75,13 @@ sudo cp petstore-cli.bash-completion /etc/bash-completion.d/petstore-cli ``` #### OS X + On OSX you might need to install bash-completion using Homebrew: + ```shell brew install bash-completion ``` + and add the following to the `~/.bashrc`: ```shell @@ -85,8 +91,8 @@ fi ``` ### Zsh -In Zsh, the generated `_petstore-cli` Zsh completion file must be copied to one of the folders under `$FPATH` variable. +In Zsh, the generated `_petstore-cli` Zsh completion file must be copied to one of the folders under `$FPATH` variable. ## Documentation for API Endpoints @@ -94,11 +100,13 @@ All URIs are relative to */v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*AnotherFakeApi* | [**testSpecialTags**](docs/AnotherFakeApi.md#testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +*AnotherFakeApi* | [**123Test@$%SpecialTags**](docs/AnotherFakeApi.md#123test@$%specialtags) | **PATCH** /another-fake/dummy | To test special tags +*FakeApi* | [**createXmlItem**](docs/FakeApi.md#createxmlitem) | **POST** /fake/create_xml_item | creates an XmlItem *FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | *FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +*FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeApi* | [**testClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters @@ -106,6 +114,7 @@ Class | Method | HTTP request | Description 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data *FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case @@ -117,6 +126,7 @@ Class | Method | HTTP request | Description *PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet *PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) *StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status *StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID @@ -133,25 +143,34 @@ Class | Method | HTTP request | Description ## Documentation For Models - - [$special[model.name]](docs/$special[model.name].md) - - [200_response](docs/200_response.md) + - [$special[modelName]](docs/$special[modelName].md) + - [200Response](docs/200Response.md) + - [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) + - [AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) + - [AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) + - [AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) + - [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) + - [AdditionalPropertiesString](docs/AdditionalPropertiesString.md) - [Animal](docs/Animal.md) - - [AnimalFarm](docs/AnimalFarm.md) - [ApiResponse](docs/ApiResponse.md) - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) - [Capitalization](docs/Capitalization.md) - [Cat](docs/Cat.md) + - [CatAllOf](docs/CatAllOf.md) - [Category](docs/Category.md) - [ClassModel](docs/ClassModel.md) - [Client](docs/Client.md) - [Dog](docs/Dog.md) + - [DogAllOf](docs/DogAllOf.md) - [EnumArrays](docs/EnumArrays.md) - [EnumClass](docs/EnumClass.md) - - [Enum_Test](docs/Enum_Test.md) - - [Format_test](docs/Format_test.md) + - [EnumTest](docs/EnumTest.md) + - [FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [FormatTest](docs/FormatTest.md) - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - [MapTest](docs/MapTest.md) - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) @@ -164,7 +183,10 @@ Class | Method | HTTP request | Description - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Return](docs/Return.md) - [Tag](docs/Tag.md) + - [TypeHolderDefault](docs/TypeHolderDefault.md) + - [TypeHolderExample](docs/TypeHolderExample.md) - [User](docs/User.md) + - [XmlItem](docs/XmlItem.md) ## Documentation For Authorization @@ -172,12 +194,14 @@ Class | Method | HTTP request | Description ## api_key + - **Type**: API key - **API key parameter name**: api_key - **Location**: HTTP header ## api_key_query + - **Type**: API key - **API key parameter name**: api_key_query - **Location**: URL query string @@ -188,6 +212,7 @@ Class | Method | HTTP request | Description ## petstore_auth + - **Type**: OAuth - **Flow**: implicit - **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog diff --git a/samples/client/petstore/bash/_client.sh b/samples/client/petstore/bash/_client.sh new file mode 100644 index 00000000000..8be68229c3d --- /dev/null +++ b/samples/client/petstore/bash/_client.sh @@ -0,0 +1,594 @@ +#compdef + +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +# ! +# ! Note: +# ! +# ! THIS SCRIPT HAS BEEN AUTOMATICALLY GENERATED USING +# ! openapi-generator (https://openapi-generator.tech) +# ! FROM OPENAPI SPECIFICATION IN JSON. +# ! +# ! Based on: https://github.com/Valodim/zsh-curl-completion/blob/master/_curl +# ! +# ! +# ! +# ! Installation: +# ! +# ! Copy the _ file to any directory under FPATH +# ! environment variable (echo $FPATH) +# ! +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + +local curcontext="$curcontext" state line ret=1 +typeset -A opt_args + +typeset -A mime_type_abbreviations +# text/* +mime_type_abbreviations[text]="text/plain" +mime_type_abbreviations[html]="text/html" +mime_type_abbreviations[md]="text/x-markdown" +mime_type_abbreviations[csv]="text/csv" +mime_type_abbreviations[css]="text/css" +mime_type_abbreviations[rtf]="text/rtf" +# application/* +mime_type_abbreviations[json]="application/json" +mime_type_abbreviations[xml]="application/xml" +mime_type_abbreviations[yaml]="application/yaml" +mime_type_abbreviations[js]="application/javascript" +mime_type_abbreviations[bin]="application/octet-stream" +mime_type_abbreviations[rdf]="application/rdf+xml" +# image/* +mime_type_abbreviations[jpg]="image/jpeg" +mime_type_abbreviations[png]="image/png" +mime_type_abbreviations[gif]="image/gif" +mime_type_abbreviations[bmp]="image/bmp" +mime_type_abbreviations[tiff]="image/tiff" + +# +# Generate zsh completion string list for abbreviated mime types +# +get_mime_type_completions() { + typeset -a result + result=() + for k in "${(@k)mime_type_abbreviations}"; do + value=$mime_type_abbreviations[${k}] + #echo $value + result+=( "${k}[${value}]" ) + #echo $result + done + echo "$result" +} + +# +# cURL crypto engines completion function +# +_curl_crypto_engine() { + local vals + vals=( ${${(f)"$(curl --engine list)":gs/ /}[2,$]} ) + _describe -t outputs 'engines' vals && return 0 +} + +# +# cURL post data completion functions= +# +_curl_post_data() { + + # don't do anything further if this is raw content + compset -P '=' && _message 'raw content' && return 0 + + # complete filename or stdin for @ syntax + compset -P '*@' && { + local expl + _description files expl stdin + compadd "$expl[@]" - "-" + _files + return 0 + } + + # got a name already? expecting data. + compset -P '*=' && _message 'data value' && return 0 + + # otherwise, name (or @ or =) should be specified + _message 'data name' && return 0 + +} + + +local arg_http arg_ftp arg_other arg_proxy arg_crypto arg_connection arg_auth arg_input arg_output + +# HTTP Arguments +arg_http=(''\ + {-0,--http1.0}'[force use of use http 1.0 instead of 1.1]' \ + {-b,--cookie}'[pass data to http server as cookie]:data or file' \ + {-c,--cookie-jar}'[specify cookie file]:file name:_files' \ + {-d,--data}'[send specified data as HTTP POST data]:data:{_curl_post_data}' \ + '--data-binary[post HTTP POST data without any processing]:data:{_curl_post_data}' \ + '--data-urlencode[post HTTP POST data, with url encoding]:data:{_curl_post_data}' \ + {-f,--fail}'[enable failfast behavior for server errors]' \ + '*'{-F,--form}'[add POST form data]:name=content' \ + {-G,--get}'[use HTTP GET even with data (-d, --data, --data-binary)]' \ + '*'{-H,--header}'[specify an extra header]:header' \ + '--ignore-content-length[ignore Content-Length header]' \ + {-i,--include}'[include HTTP header in the output]' \ + {-j,--junk-session-cookies}'[discard all session cookies]' \ + {-e,--referer}'[send url as referer]:referer url:_urls' \ + {-L,--location}'[follow Location headers on http 3XX response]' \ + '--location-trusted[like --location, but allows sending of auth data to redirected hosts]' \ + '--max-redirs[set maximum number of redirection followings allowed]:number' \ + {-J,--remote-header-name}'[use Content-Disposition for output file name]' \ + {-O,--remote-name}'[write to filename parsed from url instead of stdout]' \ + '--post301[do not convert POST to GET after following 301 Location response (follow RFC 2616/10.3.2)]' \ + '--post302[do not convert POST to GET after following 302 Location response (follow RFC 2616/10.3.2)]' \ + ) + +# FTP arguments +arg_ftp=(\ + {-a,--append}'[append to target file instead of overwriting (FTP/SFTP)]' \ + '--crlf[convert LF to CRLF in upload]' \ + '--disable-eprt[disable use of EPRT and LPRT for active FTP transfers]' \ + '--disable-epsv[disable use of EPSV for passive FTP transfers]' \ + '--ftp-account[account data (FTP)]:data' \ + '--ftp-alternative-to-user[command to send when USER and PASS commands fail (FTP)]:command' \ + '--ftp-create-dirs[create paths remotely if it does not exist]' \ + '--ftp-method[ftp method to use to reach a file (FTP)]:method:(multicwd ocwd singlecwd)' \ + '--ftp-pasv[use passive mode for the data connection (FTP)]' \ + '--ftp-skip-pasv-ip[do not use the ip the server suggests for PASV]' \ + '--form-string[like --form, but do not parse content]:name=string' \ + '--ftp-pret[send PRET before PASV]' \ + '--ftp-ssl-ccc[use clear command channel (CCC) after authentication (FTP)]' \ + '--ftp-ssl-ccc-mode[sets the CCC mode (FTP)]:mode:(active passive)' \ + '--ftp-ssl-control[require SSL/TLS for FTP login, clear for transfer]' \ + {-l,--list-only}'[list names only when listing directories (FTP)]' \ + {-P,--ftp-port}'[use active mode, tell server to connect to specified address or interface (FTP]:address' \ + '*'{-Q,--quote}'[send arbitrary command to the remote server before transfer (FTP/SFTP)]:command' \ + ) + +# Other Protocol arguments +arg_other=(\ + '--mail-from[specify From: address]:address' \ + '--mail-rcpt[specify email recipient for SMTP, may be given multiple times]:address' \ + {-t,--telnet-option}'[pass options to telnet protocol]:opt=val' \ + '--tftp-blksize[set tftp BLKSIZE option]:value' \ + ) + +# Proxy arguments +arg_proxy=(\ + '--noproxy[list of hosts to connect directly to instead of through proxy]:no-proxy-list' \ + {-p,--proxytunnel}'[tunnel non-http protocols through http proxy]' \ + {-U,--proxy-user}'[specify the user name and password to use for proxy authentication]:user:password' \ + '--proxy-anyauth[use any authentication method for proxy, default to most secure]' \ + '--proxy-basic[use HTTP Basic authentication for proxy]' \ + '--proxy-digest[use http digest authentication for proxy]' \ + '--proxy-negotiate[enable GSS-Negotiate authentication for proxy]' \ + '--proxy-ntlm[enable ntlm authentication for proxy]' \ + '--proxy1.0[use http 1.0 proxy]:proxy url' \ + {-x,--proxy}'[use specified proxy]:proxy url' \ + '--socks5-gssapi-service[change service name for socks server]:servicename' \ + '--socks5-gssapi-nec[allow unprotected exchange of protection mode negotiation]' \ + ) + +# Crypto arguments +arg_crypto=(\ + {-1,--tlsv1}'[Forces curl to use TLS version 1 when negotiating with a remote TLS server.]' \ + {-2,--sslv2}'[Forces curl to use SSL version 2 when negotiating with a remote SSL server.]' \ + {-3,--sslv3}'[Forces curl to use SSL version 3 when negotiating with a remote SSL server.]' \ + '--ciphers[specifies which cipher to use for the ssl connection]:list of ciphers' \ + '--crlfile[specify file with revoked certificates]:file' \ + '--delegation[set delegation policy to use with GSS/kerberos]:delegation policy:(none policy always)' \ + {-E,--cert}'[use specified client certificate]:certificate file:_files' \ + '--engine[use selected OpenSSL crypto engine]:ssl crypto engine:{_curl_crypto_engine}' \ + '--egd-file[set ssl entropy gathering daemon socket]:entropy socket:_files' \ + '--cert-type[specify certificate type (PEM, DER, ENG)]:certificate type:(PEM DER ENG)' \ + '--cacert[specify certificate file to verify the peer with]:CA certificate:_files' \ + '--capath[specify a search path for certificate files]:CA certificate directory:_directories' \ + '--hostpubmd5[check remote hosts public key]:md5 hash' \ + {-k,--insecure}'[allow ssl to perform insecure ssl connections (ie, ignore certificate)]' \ + '--key[ssl/ssh private key file name]:key file:_files' \ + '--key-type[ssl/ssh private key file type]:file type:(PEM DER ENG)' \ + '--pubkey[ssh public key file]:pubkey file:_files' \ + '--random-file[set source of random data for ssl]:random source:_files' \ + '--no-sessionid[disable caching of ssl session ids]' \ + '--pass:phrase[passphrase for ssl/ssh private key]' \ + '--ssl[try to use ssl/tls for connection, if available]' \ + '--ssl-reqd[try to use ssl/tls for connection, fail if unavailable]' \ + '--tlsauthtype[set TLS authentication type (only SRP supported!)]:authtype' \ + '--tlsuser[set username for TLS authentication]:user' \ + '--tlspassword[set password for TLS authentication]:password' \ + ) + +# Connection arguments +arg_connection=(\ + {-4,--ipv4}'[prefer ipv4]' \ + {-6,--ipv6}'[prefer ipv6, if available]' \ + {-B,--use-ascii}'[use ascii mode]' \ + '--compressed[request a compressed transfer]' \ + '--connect-timeout[timeout for connection phase]:seconds' \ + {-I,--head}'[fetch http HEAD only (HTTP/FTP/FILE]' \ + '--interface[work on a specific interface]:name' \ + '--keepalive-time[set time to wait before sending keepalive probes]:seconds' \ + '--limit-rate[specify maximum transfer rate]:speed' \ + '--local-port[set preferred number or range of local ports to use]:num' \ + {-N,--no-buffer}'[disable buffering of the output stream]' \ + '--no-keepalive[disable use of keepalive messages in TCP connections]' \ + '--raw[disable all http decoding and pass raw data]' \ + '--resolve[provide a custom address for a specific host and port pair]:host\:port\:address' \ + '--retry[specify maximum number of retries for transient errors]:num' \ + '--retry-delay[specify delay between retries]:seconds' \ + '--retry-max-time[maximum time to spend on retries]:seconds' \ + '--tcp-nodelay[turn on TCP_NODELAY option]' \ + {-y,--speed-time}'[specify time to abort after if download is slower than speed-limit]:time' \ + {-Y,--speed-limit}'[specify minimum speed for --speed-time]:speed' \ + ) + +# Authentication arguments +arg_auth=(\ + '--anyauth[use any authentication method, default to most secure]' \ + '--basic[use HTTP Basic authentication]' \ + '--ntlm[enable ntlm authentication]' \ + '--digest[use http digest authentication]' \ + '--krb[use kerberos authentication]:auth:(clear safe confidential private)' \ + '--negotiate[enable GSS-Negotiate authentication]' \ + {-n,--netrc}'[scan ~/.netrc for login data]' \ + '--netrc-optional[like --netrc, but does not make .netrc usage mandatory]' \ + '--netrc-file[like --netrc, but specify file to use]:netrc file:_files' \ + '--tr-encoding[request compressed transfer-encoding]' \ + {-u,--user}'[specify user name and password for server authentication]:user\:password' \ + ) + +# Input arguments +arg_input=(\ + {-C,--continue-at}'[resume at offset ]:offset' \ + {-g,--globoff}'[do not glob {}\[\] letters]' \ + '--max-filesize[maximum filesize to download, fail for bigger files]:bytes' \ + '--proto[specify allowed protocols for transfer]:protocols' \ + '--proto-redir[specify allowed protocols for transfer after a redirect]:protocols' \ + {-r,--range}'[set range of bytes to request (HTTP/FTP/SFTP/FILE)]:range' \ + {-R,--remote-time}'[use timestamp of remote file for local file]' \ + {-T,--upload-file}'[transfer file to remote url (using PUT for HTTP)]:file to upload:_files' \ + '--url[specify a URL to fetch (multi)]:url:_urls' \ + {-z,--time-cond}'[request downloaded file to be newer than date or given reference file]:date expression' \ + ) + +# Output arguments +arg_output=(\ + '--create-dirs[create local directory hierarchy as needed]' \ + {-D,--dump-header}'[write protocol headers to file]:dump file:_files' \ + {-o,--output}'[write to specified file instead of stdout]:output file:_files' \ + {--progress-bar,-\#}'[display progress as a simple progress bar]' \ + {-\#,--progress-bar}'[Make curl display progress as a simple progress bar instead of the standard, more informational, meter.]' \ + {-R,--remote-time}'[use timestamp of remote file for local file]' \ + '--raw[disable all http decoding and pass raw data]' \ + {-s,--silent}'[silent mode, do not show progress meter or error messages]' \ + {-S,--show-error}'[show errors in silent mode]' \ + '--stderr[redirect stderr to specified file]:output file:_files' \ + '--trace[enable full trace dump of all incoming and outgoing data]:trace file:_files' \ + '--trace-ascii[enable full trace dump of all incoming and outgoing data, without hex data]:trace file:_files' \ + '--trace-time[prepends a time stamp to each trace or verbose line that curl displays]' \ + {-v,--verbose}'[output debug info]' \ + {-w,--write-out}'[specify message to output on successful operation]:format string' \ + '--xattr[store some file metadata in extended file attributes]' \ + {-X,--request}'[specifies request method for HTTP server]:method:(GET POST PUT DELETE HEAD OPTIONS TRACE CONNECT PATCH LINK UNLINK)' \ + ) + +_arguments -C -s $arg_http $arg_ftp $arg_other $arg_crypto $arg_connection $arg_auth $arg_input $arg_output \ + {-M,--manual}'[Print manual]' \ + '*'{-K,--config}'[Use other config file to read arguments from]:config file:_files' \ + '--libcurl[output libcurl code for the operation to file]:output file:_files' \ + {-m,--max-time}'[Limit total time of operation]:seconds' \ + {-s,--silent}'[Silent mode, do not show progress meter or error messages]' \ + {-S,--show-error}'[Show errors in silent mode]' \ + '--stderr[Redirect stderr to specified file]:output file:_files' \ + '-q[Do not read settings from .curlrc (must be first option)]' \ + {-h,--help}'[Print help and list of operations]' \ + {-V,--version}'[Print service API version]' \ + '--about[Print the information about service]' \ + '--host[Specify the host URL]':URL:_urls \ + '--dry-run[Print out the cURL command without executing it]' \ + {-ac,--accept}'[Set the Accept header in the request]: :{_values "Accept mime type" $(get_mime_type_completions)}' \ + {-ct,--content-type}'[Set the Content-type header in request]: :{_values "Content mime type" $(get_mime_type_completions)}' \ + '1: :->ops' \ + '*:: :->args' \ + && ret=0 + + +case $state in + ops) + # Operations + _values "Operations" \ + "123Test@$%SpecialTags[To test special tags]" "fooGet[]" "fakeHealthGet[Health check endpoint]" \ + "fakeOuterBooleanSerialize[]" \ + "fakeOuterCompositeSerialize[]" \ + "fakeOuterNumberSerialize[]" \ + "fakeOuterStringSerialize[]" \ + "testBodyWithFileSchema[]" \ + "testBodyWithQueryParams[]" \ + "testClientModel[To test \"client\" model]" \ + "testEndpointParameters[Fake endpoint for testing various parameters +假端點 +偽のエンドポイント +가짜 엔드 포인트]" \ + "testEnumParameters[To test enum parameters]" \ + "testGroupParameters[Fake endpoint to test group parameters (optional)]" \ + "testInlineAdditionalProperties[test inline additionalProperties]" \ + "testJsonFormData[test json serialization of form data]" "testClassname[To test class name in snake case]" "addPet[Add a new pet to the store]" \ + "deletePet[Deletes a pet]" \ + "findPetsByStatus[Finds Pets by status]" \ + "findPetsByTags[Finds Pets by tags]" \ + "getPetById[Find pet by ID]" \ + "updatePet[Update an existing pet]" \ + "updatePetWithForm[Updates a pet in the store with form data]" \ + "uploadFile[uploads an image]" \ + "uploadFileWithRequiredFile[uploads an image (required)]" "deleteOrder[Delete purchase order by ID]" \ + "getInventory[Returns pet inventories by status]" \ + "getOrderById[Find purchase order by ID]" \ + "placeOrder[Place an order for a pet]" "createUser[Create user]" \ + "createUsersWithArrayInput[Creates list of users with given input array]" \ + "createUsersWithListInput[Creates list of users with given input array]" \ + "deleteUser[Delete user]" \ + "getUserByName[Get user by user name]" \ + "loginUser[Logs user into the system]" \ + "logoutUser[Logs out current logged in user session]" \ + "updateUser[Updated user]" + _arguments "(--help)--help[Print information about operation]" + + ret=0 + ;; + args) + case $line[1] in + 123Test@$%SpecialTags) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + fooGet) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + fakeHealthGet) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + fakeOuterBooleanSerialize) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + fakeOuterCompositeSerialize) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + fakeOuterNumberSerialize) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + fakeOuterStringSerialize) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + testBodyWithFileSchema) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + testBodyWithQueryParams) + local -a _op_arguments + _op_arguments=( + "query=:[QUERY] " + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + testClientModel) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + testEndpointParameters) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + testEnumParameters) + local -a _op_arguments + _op_arguments=( + "enum_query_string_array=:[QUERY] Query parameter enum test (string array)" +"enum_query_string=:[QUERY] Query parameter enum test (string)" +"enum_query_integer=:[QUERY] Query parameter enum test (double)" +"enum_query_double=:[QUERY] Query parameter enum test (double)" + "enum_header_string_array\::[HEADER] Header parameter enum test (string array)" +"enum_header_string\::[HEADER] Header parameter enum test (string)" +) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + testGroupParameters) + local -a _op_arguments + _op_arguments=( + "required_string_group=:[QUERY] Required String in group parameters" +"required_int64_group=:[QUERY] Required Integer in group parameters" +"string_group=:[QUERY] String in group parameters" +"int64_group=:[QUERY] Integer in group parameters" + "required_boolean_group\::[HEADER] Required Boolean in group parameters" +"boolean_group\::[HEADER] Boolean in group parameters" +) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + testInlineAdditionalProperties) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + testJsonFormData) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + testClassname) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + addPet) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + deletePet) + local -a _op_arguments + _op_arguments=( + "petId=:[PATH] Pet id to delete" + "api_key\::[HEADER] " +) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + findPetsByStatus) + local -a _op_arguments + _op_arguments=( + "status=:[QUERY] Status values that need to be considered for filter" + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + findPetsByTags) + local -a _op_arguments + _op_arguments=( + "tags=:[QUERY] Tags to filter by" + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + getPetById) + local -a _op_arguments + _op_arguments=( + "petId=:[PATH] ID of pet to return" + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + updatePet) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + updatePetWithForm) + local -a _op_arguments + _op_arguments=( + "petId=:[PATH] ID of pet that needs to be updated" + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + uploadFile) + local -a _op_arguments + _op_arguments=( + "petId=:[PATH] ID of pet to update" + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + uploadFileWithRequiredFile) + local -a _op_arguments + _op_arguments=( + "petId=:[PATH] ID of pet to update" + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + deleteOrder) + local -a _op_arguments + _op_arguments=( + "order_id=:[PATH] ID of the order that needs to be deleted" + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + getInventory) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + getOrderById) + local -a _op_arguments + _op_arguments=( + "order_id=:[PATH] ID of pet that needs to be fetched" + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + placeOrder) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + createUser) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + createUsersWithArrayInput) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + createUsersWithListInput) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + deleteUser) + local -a _op_arguments + _op_arguments=( + "username=:[PATH] The name that needs to be deleted" + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + getUserByName) + local -a _op_arguments + _op_arguments=( + "username=:[PATH] The name that needs to be fetched. Use user1 for testing." + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + loginUser) + local -a _op_arguments + _op_arguments=( + "username=:[QUERY] The user name for login" +"password=:[QUERY] The password for login in clear text" + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + logoutUser) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + updateUser) + local -a _op_arguments + _op_arguments=( + "username=:[PATH] name that need to be deleted" + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + esac + ;; + +esac + +return ret diff --git a/samples/client/petstore/bash/_petstore-cli b/samples/client/petstore/bash/_petstore-cli index 3141c8ccd87..22d7eaf982d 100644 --- a/samples/client/petstore/bash/_petstore-cli +++ b/samples/client/petstore/bash/_petstore-cli @@ -296,10 +296,12 @@ case $state in ops) # Operations _values "Operations" \ - "testSpecialTags[To test special tags]" "fakeOuterBooleanSerialize[]" \ + "123Test@$%SpecialTags[To test special tags]" "createXmlItem[creates an XmlItem]" \ + "fakeOuterBooleanSerialize[]" \ "fakeOuterCompositeSerialize[]" \ "fakeOuterNumberSerialize[]" \ "fakeOuterStringSerialize[]" \ + "testBodyWithFileSchema[]" \ "testBodyWithQueryParams[]" \ "testClientModel[To test \"client\" model]" \ "testEndpointParameters[Fake endpoint for testing various parameters @@ -307,6 +309,7 @@ case $state in 偽のエンドポイント 가짜 엔드 포인트]" \ "testEnumParameters[To test enum parameters]" \ + "testGroupParameters[Fake endpoint to test group parameters (optional)]" \ "testInlineAdditionalProperties[test inline additionalProperties]" \ "testJsonFormData[test json serialization of form data]" "testClassname[To test class name in snake case]" "addPet[Add a new pet to the store]" \ "deletePet[Deletes a pet]" \ @@ -315,7 +318,8 @@ case $state in "getPetById[Find pet by ID]" \ "updatePet[Update an existing pet]" \ "updatePetWithForm[Updates a pet in the store with form data]" \ - "uploadFile[uploads an image]" "deleteOrder[Delete purchase order by ID]" \ + "uploadFile[uploads an image]" \ + "uploadFileWithRequiredFile[uploads an image (required)]" "deleteOrder[Delete purchase order by ID]" \ "getInventory[Returns pet inventories by status]" \ "getOrderById[Find purchase order by ID]" \ "placeOrder[Place an order for a pet]" "createUser[Create user]" \ @@ -332,7 +336,13 @@ case $state in ;; args) case $line[1] in - testSpecialTags) + 123Test@$%SpecialTags) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + createXmlItem) local -a _op_arguments _op_arguments=( ) @@ -362,6 +372,12 @@ case $state in ) _describe -t actions 'operations' _op_arguments -S '' && ret=0 ;; + testBodyWithFileSchema) + local -a _op_arguments + _op_arguments=( + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; testBodyWithQueryParams) local -a _op_arguments _op_arguments=( @@ -390,6 +406,18 @@ case $state in "enum_query_double=:[QUERY] Query parameter enum test (double)" "enum_header_string_array\::[HEADER] Header parameter enum test (string array)" "enum_header_string\::[HEADER] Header parameter enum test (string)" +) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; + testGroupParameters) + local -a _op_arguments + _op_arguments=( + "required_string_group=:[QUERY] Required String in group parameters" +"required_int64_group=:[QUERY] Required Integer in group parameters" +"string_group=:[QUERY] String in group parameters" +"int64_group=:[QUERY] Integer in group parameters" + "required_boolean_group\::[HEADER] Required Boolean in group parameters" +"boolean_group\::[HEADER] Boolean in group parameters" ) _describe -t actions 'operations' _op_arguments -S '' && ret=0 ;; @@ -466,6 +494,13 @@ case $state in ) _describe -t actions 'operations' _op_arguments -S '' && ret=0 ;; + uploadFileWithRequiredFile) + local -a _op_arguments + _op_arguments=( + "petId=:[PATH] ID of pet to update" + ) + _describe -t actions 'operations' _op_arguments -S '' && ret=0 + ;; deleteOrder) local -a _op_arguments _op_arguments=( diff --git a/samples/client/petstore/bash/client.sh b/samples/client/petstore/bash/client.sh new file mode 100644 index 00000000000..c43fb5804e6 --- /dev/null +++ b/samples/client/petstore/bash/client.sh @@ -0,0 +1,4003 @@ +#!/usr/bin/env bash + +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +# ! +# ! Note: +# ! +# ! THIS SCRIPT HAS BEEN AUTOMATICALLY GENERATED USING +# ! openapi-generator (https://openapi-generator.tech) +# ! FROM OPENAPI SPECIFICATION IN JSON. +# ! +# ! +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +# +# This is a Bash client for OpenAPI Petstore. +# +# LICENSE: +# http://www.apache.org/licenses/LICENSE-2.0.html +# +# CONTACT: +# +# +# MORE INFORMATION: +# +# + +# For improved pattern matching in case statemets +shopt -s extglob + +############################################################################### +# +# Make sure Bash is at least in version 4.3 +# +############################################################################### +if ! ( (("${BASH_VERSION:0:1}" == "4")) && (("${BASH_VERSION:2:1}" >= "3")) ) \ + && ! (("${BASH_VERSION:0:1}" >= "5")); then + echo "" + echo "Sorry - your Bash version is ${BASH_VERSION}" + echo "" + echo "You need at least Bash 4.3 to run this script." + echo "" + exit 1 +fi + +############################################################################### +# +# Global variables +# +############################################################################### + +## +# The filename of this script for help messages +script_name=$(basename "$0") + +## +# Map for headers passed after operation as KEY:VALUE +declare -A header_arguments + + +## +# Map for operation parameters passed after operation as PARAMETER=VALUE +# These will be mapped to appropriate path or query parameters +# The values in operation_parameters are arrays, so that multiple values +# can be provided for the same parameter if allowed by API specification +declare -A operation_parameters + +## +# Declare colors with autodection if output is terminal +if [ -t 1 ]; then + RED="$(tput setaf 1)" + GREEN="$(tput setaf 2)" + YELLOW="$(tput setaf 3)" + BLUE="$(tput setaf 4)" + MAGENTA="$(tput setaf 5)" + CYAN="$(tput setaf 6)" + WHITE="$(tput setaf 7)" + BOLD="$(tput bold)" + OFF="$(tput sgr0)" +else + RED="" + GREEN="" + YELLOW="" + BLUE="" + MAGENTA="" + CYAN="" + WHITE="" + BOLD="" + OFF="" +fi + +declare -a result_color_table=( "$WHITE" "$WHITE" "$GREEN" "$YELLOW" "$WHITE" "$MAGENTA" "$WHITE" ) + +## +# This array stores the minimum number of required occurrences for parameter +# 0 - optional +# 1 - required +declare -A operation_parameters_minimum_occurrences +operation_parameters_minimum_occurrences["123Test@$%SpecialTags:::Client"]=1 +operation_parameters_minimum_occurrences["fakeOuterBooleanSerialize:::body"]=0 +operation_parameters_minimum_occurrences["fakeOuterCompositeSerialize:::OuterComposite"]=0 +operation_parameters_minimum_occurrences["fakeOuterNumberSerialize:::body"]=0 +operation_parameters_minimum_occurrences["fakeOuterStringSerialize:::body"]=0 +operation_parameters_minimum_occurrences["testBodyWithFileSchema:::FileSchemaTestClass"]=1 +operation_parameters_minimum_occurrences["testBodyWithQueryParams:::query"]=1 +operation_parameters_minimum_occurrences["testBodyWithQueryParams:::User"]=1 +operation_parameters_minimum_occurrences["testClientModel:::Client"]=1 +operation_parameters_minimum_occurrences["testEndpointParameters:::number"]=1 +operation_parameters_minimum_occurrences["testEndpointParameters:::double"]=1 +operation_parameters_minimum_occurrences["testEndpointParameters:::pattern_without_delimiter"]=1 +operation_parameters_minimum_occurrences["testEndpointParameters:::byte"]=1 +operation_parameters_minimum_occurrences["testEndpointParameters:::integer"]=0 +operation_parameters_minimum_occurrences["testEndpointParameters:::int32"]=0 +operation_parameters_minimum_occurrences["testEndpointParameters:::int64"]=0 +operation_parameters_minimum_occurrences["testEndpointParameters:::float"]=0 +operation_parameters_minimum_occurrences["testEndpointParameters:::string"]=0 +operation_parameters_minimum_occurrences["testEndpointParameters:::binary"]=0 +operation_parameters_minimum_occurrences["testEndpointParameters:::date"]=0 +operation_parameters_minimum_occurrences["testEndpointParameters:::dateTime"]=0 +operation_parameters_minimum_occurrences["testEndpointParameters:::password"]=0 +operation_parameters_minimum_occurrences["testEndpointParameters:::callback"]=0 +operation_parameters_minimum_occurrences["testEnumParameters:::enum_header_string_array"]=0 +operation_parameters_minimum_occurrences["testEnumParameters:::enum_header_string"]=0 +operation_parameters_minimum_occurrences["testEnumParameters:::enum_query_string_array"]=0 +operation_parameters_minimum_occurrences["testEnumParameters:::enum_query_string"]=0 +operation_parameters_minimum_occurrences["testEnumParameters:::enum_query_integer"]=0 +operation_parameters_minimum_occurrences["testEnumParameters:::enum_query_double"]=0 +operation_parameters_minimum_occurrences["testEnumParameters:::enum_form_string_array"]=0 +operation_parameters_minimum_occurrences["testEnumParameters:::enum_form_string"]=0 +operation_parameters_minimum_occurrences["testGroupParameters:::required_string_group"]=1 +operation_parameters_minimum_occurrences["testGroupParameters:::required_boolean_group"]=1 +operation_parameters_minimum_occurrences["testGroupParameters:::required_int64_group"]=1 +operation_parameters_minimum_occurrences["testGroupParameters:::string_group"]=0 +operation_parameters_minimum_occurrences["testGroupParameters:::boolean_group"]=0 +operation_parameters_minimum_occurrences["testGroupParameters:::int64_group"]=0 +operation_parameters_minimum_occurrences["testInlineAdditionalProperties:::request_body"]=1 +operation_parameters_minimum_occurrences["testJsonFormData:::param"]=1 +operation_parameters_minimum_occurrences["testJsonFormData:::param2"]=1 +operation_parameters_minimum_occurrences["testClassname:::Client"]=1 +operation_parameters_minimum_occurrences["addPet:::Pet"]=1 +operation_parameters_minimum_occurrences["deletePet:::petId"]=1 +operation_parameters_minimum_occurrences["deletePet:::api_key"]=0 +operation_parameters_minimum_occurrences["findPetsByStatus:::status"]=1 +operation_parameters_minimum_occurrences["findPetsByTags:::tags"]=1 +operation_parameters_minimum_occurrences["getPetById:::petId"]=1 +operation_parameters_minimum_occurrences["updatePet:::Pet"]=1 +operation_parameters_minimum_occurrences["updatePetWithForm:::petId"]=1 +operation_parameters_minimum_occurrences["updatePetWithForm:::name"]=0 +operation_parameters_minimum_occurrences["updatePetWithForm:::status"]=0 +operation_parameters_minimum_occurrences["uploadFile:::petId"]=1 +operation_parameters_minimum_occurrences["uploadFile:::additionalMetadata"]=0 +operation_parameters_minimum_occurrences["uploadFile:::file"]=0 +operation_parameters_minimum_occurrences["uploadFileWithRequiredFile:::petId"]=1 +operation_parameters_minimum_occurrences["uploadFileWithRequiredFile:::requiredFile"]=1 +operation_parameters_minimum_occurrences["uploadFileWithRequiredFile:::additionalMetadata"]=0 +operation_parameters_minimum_occurrences["deleteOrder:::order_id"]=1 +operation_parameters_minimum_occurrences["getOrderById:::order_id"]=1 +operation_parameters_minimum_occurrences["placeOrder:::Order"]=1 +operation_parameters_minimum_occurrences["createUser:::User"]=1 +operation_parameters_minimum_occurrences["createUsersWithArrayInput:::User"]=1 +operation_parameters_minimum_occurrences["createUsersWithListInput:::User"]=1 +operation_parameters_minimum_occurrences["deleteUser:::username"]=1 +operation_parameters_minimum_occurrences["getUserByName:::username"]=1 +operation_parameters_minimum_occurrences["loginUser:::username"]=1 +operation_parameters_minimum_occurrences["loginUser:::password"]=1 +operation_parameters_minimum_occurrences["updateUser:::username"]=1 +operation_parameters_minimum_occurrences["updateUser:::User"]=1 + +## +# This array stores the maximum number of allowed occurrences for parameter +# 1 - single value +# 2 - 2 values +# N - N values +# 0 - unlimited +declare -A operation_parameters_maximum_occurrences +operation_parameters_maximum_occurrences["123Test@$%SpecialTags:::Client"]=0 +operation_parameters_maximum_occurrences["fakeOuterBooleanSerialize:::body"]=0 +operation_parameters_maximum_occurrences["fakeOuterCompositeSerialize:::OuterComposite"]=0 +operation_parameters_maximum_occurrences["fakeOuterNumberSerialize:::body"]=0 +operation_parameters_maximum_occurrences["fakeOuterStringSerialize:::body"]=0 +operation_parameters_maximum_occurrences["testBodyWithFileSchema:::FileSchemaTestClass"]=0 +operation_parameters_maximum_occurrences["testBodyWithQueryParams:::query"]=0 +operation_parameters_maximum_occurrences["testBodyWithQueryParams:::User"]=0 +operation_parameters_maximum_occurrences["testClientModel:::Client"]=0 +operation_parameters_maximum_occurrences["testEndpointParameters:::number"]=0 +operation_parameters_maximum_occurrences["testEndpointParameters:::double"]=0 +operation_parameters_maximum_occurrences["testEndpointParameters:::pattern_without_delimiter"]=0 +operation_parameters_maximum_occurrences["testEndpointParameters:::byte"]=0 +operation_parameters_maximum_occurrences["testEndpointParameters:::integer"]=0 +operation_parameters_maximum_occurrences["testEndpointParameters:::int32"]=0 +operation_parameters_maximum_occurrences["testEndpointParameters:::int64"]=0 +operation_parameters_maximum_occurrences["testEndpointParameters:::float"]=0 +operation_parameters_maximum_occurrences["testEndpointParameters:::string"]=0 +operation_parameters_maximum_occurrences["testEndpointParameters:::binary"]=0 +operation_parameters_maximum_occurrences["testEndpointParameters:::date"]=0 +operation_parameters_maximum_occurrences["testEndpointParameters:::dateTime"]=0 +operation_parameters_maximum_occurrences["testEndpointParameters:::password"]=0 +operation_parameters_maximum_occurrences["testEndpointParameters:::callback"]=0 +operation_parameters_maximum_occurrences["testEnumParameters:::enum_header_string_array"]=0 +operation_parameters_maximum_occurrences["testEnumParameters:::enum_header_string"]=0 +operation_parameters_maximum_occurrences["testEnumParameters:::enum_query_string_array"]=0 +operation_parameters_maximum_occurrences["testEnumParameters:::enum_query_string"]=0 +operation_parameters_maximum_occurrences["testEnumParameters:::enum_query_integer"]=0 +operation_parameters_maximum_occurrences["testEnumParameters:::enum_query_double"]=0 +operation_parameters_maximum_occurrences["testEnumParameters:::enum_form_string_array"]=0 +operation_parameters_maximum_occurrences["testEnumParameters:::enum_form_string"]=0 +operation_parameters_maximum_occurrences["testGroupParameters:::required_string_group"]=0 +operation_parameters_maximum_occurrences["testGroupParameters:::required_boolean_group"]=0 +operation_parameters_maximum_occurrences["testGroupParameters:::required_int64_group"]=0 +operation_parameters_maximum_occurrences["testGroupParameters:::string_group"]=0 +operation_parameters_maximum_occurrences["testGroupParameters:::boolean_group"]=0 +operation_parameters_maximum_occurrences["testGroupParameters:::int64_group"]=0 +operation_parameters_maximum_occurrences["testInlineAdditionalProperties:::request_body"]=0 +operation_parameters_maximum_occurrences["testJsonFormData:::param"]=0 +operation_parameters_maximum_occurrences["testJsonFormData:::param2"]=0 +operation_parameters_maximum_occurrences["testClassname:::Client"]=0 +operation_parameters_maximum_occurrences["addPet:::Pet"]=0 +operation_parameters_maximum_occurrences["deletePet:::petId"]=0 +operation_parameters_maximum_occurrences["deletePet:::api_key"]=0 +operation_parameters_maximum_occurrences["findPetsByStatus:::status"]=0 +operation_parameters_maximum_occurrences["findPetsByTags:::tags"]=0 +operation_parameters_maximum_occurrences["getPetById:::petId"]=0 +operation_parameters_maximum_occurrences["updatePet:::Pet"]=0 +operation_parameters_maximum_occurrences["updatePetWithForm:::petId"]=0 +operation_parameters_maximum_occurrences["updatePetWithForm:::name"]=0 +operation_parameters_maximum_occurrences["updatePetWithForm:::status"]=0 +operation_parameters_maximum_occurrences["uploadFile:::petId"]=0 +operation_parameters_maximum_occurrences["uploadFile:::additionalMetadata"]=0 +operation_parameters_maximum_occurrences["uploadFile:::file"]=0 +operation_parameters_maximum_occurrences["uploadFileWithRequiredFile:::petId"]=0 +operation_parameters_maximum_occurrences["uploadFileWithRequiredFile:::requiredFile"]=0 +operation_parameters_maximum_occurrences["uploadFileWithRequiredFile:::additionalMetadata"]=0 +operation_parameters_maximum_occurrences["deleteOrder:::order_id"]=0 +operation_parameters_maximum_occurrences["getOrderById:::order_id"]=0 +operation_parameters_maximum_occurrences["placeOrder:::Order"]=0 +operation_parameters_maximum_occurrences["createUser:::User"]=0 +operation_parameters_maximum_occurrences["createUsersWithArrayInput:::User"]=0 +operation_parameters_maximum_occurrences["createUsersWithListInput:::User"]=0 +operation_parameters_maximum_occurrences["deleteUser:::username"]=0 +operation_parameters_maximum_occurrences["getUserByName:::username"]=0 +operation_parameters_maximum_occurrences["loginUser:::username"]=0 +operation_parameters_maximum_occurrences["loginUser:::password"]=0 +operation_parameters_maximum_occurrences["updateUser:::username"]=0 +operation_parameters_maximum_occurrences["updateUser:::User"]=0 + +## +# The type of collection for specifying multiple values for parameter: +# - multi, csv, ssv, tsv +declare -A operation_parameters_collection_type +operation_parameters_collection_type["123Test@$%SpecialTags:::Client"]="" +operation_parameters_collection_type["fakeOuterBooleanSerialize:::body"]="" +operation_parameters_collection_type["fakeOuterCompositeSerialize:::OuterComposite"]="" +operation_parameters_collection_type["fakeOuterNumberSerialize:::body"]="" +operation_parameters_collection_type["fakeOuterStringSerialize:::body"]="" +operation_parameters_collection_type["testBodyWithFileSchema:::FileSchemaTestClass"]="" +operation_parameters_collection_type["testBodyWithQueryParams:::query"]="" +operation_parameters_collection_type["testBodyWithQueryParams:::User"]="" +operation_parameters_collection_type["testClientModel:::Client"]="" +operation_parameters_collection_type["testEndpointParameters:::number"]="" +operation_parameters_collection_type["testEndpointParameters:::double"]="" +operation_parameters_collection_type["testEndpointParameters:::pattern_without_delimiter"]="" +operation_parameters_collection_type["testEndpointParameters:::byte"]="" +operation_parameters_collection_type["testEndpointParameters:::integer"]="" +operation_parameters_collection_type["testEndpointParameters:::int32"]="" +operation_parameters_collection_type["testEndpointParameters:::int64"]="" +operation_parameters_collection_type["testEndpointParameters:::float"]="" +operation_parameters_collection_type["testEndpointParameters:::string"]="" +operation_parameters_collection_type["testEndpointParameters:::binary"]="" +operation_parameters_collection_type["testEndpointParameters:::date"]="" +operation_parameters_collection_type["testEndpointParameters:::dateTime"]="" +operation_parameters_collection_type["testEndpointParameters:::password"]="" +operation_parameters_collection_type["testEndpointParameters:::callback"]="" +operation_parameters_collection_type["testEnumParameters:::enum_header_string_array"]="csv" +operation_parameters_collection_type["testEnumParameters:::enum_header_string"]="" +operation_parameters_collection_type["testEnumParameters:::enum_query_string_array"]="multi" +operation_parameters_collection_type["testEnumParameters:::enum_query_string"]="" +operation_parameters_collection_type["testEnumParameters:::enum_query_integer"]="" +operation_parameters_collection_type["testEnumParameters:::enum_query_double"]="" +operation_parameters_collection_type["testEnumParameters:::enum_form_string_array"]= +operation_parameters_collection_type["testEnumParameters:::enum_form_string"]="" +operation_parameters_collection_type["testGroupParameters:::required_string_group"]="" +operation_parameters_collection_type["testGroupParameters:::required_boolean_group"]="" +operation_parameters_collection_type["testGroupParameters:::required_int64_group"]="" +operation_parameters_collection_type["testGroupParameters:::string_group"]="" +operation_parameters_collection_type["testGroupParameters:::boolean_group"]="" +operation_parameters_collection_type["testGroupParameters:::int64_group"]="" +operation_parameters_collection_type["testInlineAdditionalProperties:::request_body"]= +operation_parameters_collection_type["testJsonFormData:::param"]="" +operation_parameters_collection_type["testJsonFormData:::param2"]="" +operation_parameters_collection_type["testClassname:::Client"]="" +operation_parameters_collection_type["addPet:::Pet"]="" +operation_parameters_collection_type["deletePet:::petId"]="" +operation_parameters_collection_type["deletePet:::api_key"]="" +operation_parameters_collection_type["findPetsByStatus:::status"]="csv" +operation_parameters_collection_type["findPetsByTags:::tags"]="csv" +operation_parameters_collection_type["getPetById:::petId"]="" +operation_parameters_collection_type["updatePet:::Pet"]="" +operation_parameters_collection_type["updatePetWithForm:::petId"]="" +operation_parameters_collection_type["updatePetWithForm:::name"]="" +operation_parameters_collection_type["updatePetWithForm:::status"]="" +operation_parameters_collection_type["uploadFile:::petId"]="" +operation_parameters_collection_type["uploadFile:::additionalMetadata"]="" +operation_parameters_collection_type["uploadFile:::file"]="" +operation_parameters_collection_type["uploadFileWithRequiredFile:::petId"]="" +operation_parameters_collection_type["uploadFileWithRequiredFile:::requiredFile"]="" +operation_parameters_collection_type["uploadFileWithRequiredFile:::additionalMetadata"]="" +operation_parameters_collection_type["deleteOrder:::order_id"]="" +operation_parameters_collection_type["getOrderById:::order_id"]="" +operation_parameters_collection_type["placeOrder:::Order"]="" +operation_parameters_collection_type["createUser:::User"]="" +operation_parameters_collection_type["createUsersWithArrayInput:::User"]= +operation_parameters_collection_type["createUsersWithListInput:::User"]= +operation_parameters_collection_type["deleteUser:::username"]="" +operation_parameters_collection_type["getUserByName:::username"]="" +operation_parameters_collection_type["loginUser:::username"]="" +operation_parameters_collection_type["loginUser:::password"]="" +operation_parameters_collection_type["updateUser:::username"]="" +operation_parameters_collection_type["updateUser:::User"]="" + + +## +# Map for body parameters passed after operation as +# PARAMETER==STRING_VALUE or PARAMETER:=NUMERIC_VALUE +# These will be mapped to top level json keys ( { "PARAMETER": "VALUE" }) +declare -A body_parameters + +## +# These arguments will be directly passed to cURL +curl_arguments="" + +## +# The host for making the request +host="" + +## +# The user credentials for basic authentication +basic_auth_credential="" + +## +# The user API key +apikey_auth_credential="" + +## +# If true, the script will only output the actual cURL command that would be +# used +print_curl=false + +## +# The operation ID passed on the command line +operation="" + +## +# The provided Accept header value +header_accept="" + +## +# The provided Content-type header value +header_content_type="" + +## +# If there is any body content on the stdin pass it to the body of the request +body_content_temp_file="" + +## +# If this variable is set to true, the request will be performed even +# if parameters for required query, header or body values are not provided +# (path parameters are still required). +force=false + +## +# Declare some mime types abbreviations for easier content-type and accepts +# headers specification +declare -A mime_type_abbreviations +# text/* +mime_type_abbreviations["text"]="text/plain" +mime_type_abbreviations["html"]="text/html" +mime_type_abbreviations["md"]="text/x-markdown" +mime_type_abbreviations["csv"]="text/csv" +mime_type_abbreviations["css"]="text/css" +mime_type_abbreviations["rtf"]="text/rtf" +# application/* +mime_type_abbreviations["json"]="application/json" +mime_type_abbreviations["xml"]="application/xml" +mime_type_abbreviations["yaml"]="application/yaml" +mime_type_abbreviations["js"]="application/javascript" +mime_type_abbreviations["bin"]="application/octet-stream" +mime_type_abbreviations["rdf"]="application/rdf+xml" +# image/* +mime_type_abbreviations["jpg"]="image/jpeg" +mime_type_abbreviations["png"]="image/png" +mime_type_abbreviations["gif"]="image/gif" +mime_type_abbreviations["bmp"]="image/bmp" +mime_type_abbreviations["tiff"]="image/tiff" + + +############################################################################## +# +# Escape special URL characters +# Based on table at http://www.w3schools.com/tags/ref_urlencode.asp +# +############################################################################## +url_escape() { + local raw_url="$1" + + value=$(sed -e 's/ /%20/g' \ + -e 's/!/%21/g' \ + -e 's/"/%22/g' \ + -e 's/#/%23/g' \ + -e 's/\&/%26/g' \ + -e 's/'\''/%28/g' \ + -e 's/(/%28/g' \ + -e 's/)/%29/g' \ + -e 's/:/%3A/g' \ + -e 's/\t/%09/g' \ + -e 's/?/%3F/g' <<<"$raw_url"); + + echo "$value" +} + +############################################################################## +# +# Lookup the mime type abbreviation in the mime_type_abbreviations array. +# If not present assume the user provided a valid mime type +# +############################################################################## +lookup_mime_type() { + local mime_type="$1" + + if [[ ${mime_type_abbreviations[$mime_type]} ]]; then + echo "${mime_type_abbreviations[$mime_type]}" + else + echo "$mime_type" + fi +} + +############################################################################## +# +# Converts an associative array into a list of cURL header +# arguments (-H "KEY: VALUE") +# +############################################################################## +header_arguments_to_curl() { + local headers_curl="" + local api_key_header="" + local api_key_header_in_cli="" + api_key_header="api_key" + + for key in "${!header_arguments[@]}"; do + headers_curl+="-H \"${key}: ${header_arguments[${key}]}\" " + if [[ "${key}XX" == "${api_key_header}XX" ]]; then + api_key_header_in_cli="YES" + fi + done + # + # If the api_key was not provided in the header, try one from the + # environment variable + # + if [[ -z $api_key_header_in_cli && -n $apikey_auth_credential ]]; then + headers_curl+="-H \"${api_key_header}: ${apikey_auth_credential}\"" + fi + headers_curl+=" " + + echo "${headers_curl}" +} + +############################################################################## +# +# Converts an associative array into a simple JSON with keys as top +# level object attributes +# +# \todo Add conversion of more complex attributes using paths +# +############################################################################## +body_parameters_to_json() { + local body_json="-d '{" + local count=0 + for key in "${!body_parameters[@]}"; do + if [[ $((count++)) -gt 0 ]]; then + body_json+=", " + fi + body_json+="\"${key}\": ${body_parameters[${key}]}" + done + body_json+="}'" + + if [[ "${#body_parameters[@]}" -eq 0 ]]; then + echo "" + else + echo "${body_json}" + fi +} + +############################################################################## +# +# Helper method for showing error because for example echo in +# build_request_path() is evaluated as part of command line not printed on +# output. Anyway better idea for resource clean up ;-). +# +############################################################################## +ERROR_MSG="" +function finish { + if [[ -n "$ERROR_MSG" ]]; then + echo >&2 "${OFF}${RED}$ERROR_MSG" + echo >&2 "${OFF}Check usage: '${script_name} --help'" + fi +} +trap finish EXIT + + +############################################################################## +# +# Validate and build request path including query parameters +# +############################################################################## +build_request_path() { + local path_template=$1 + local -n path_params=$2 + local -n query_params=$3 + + + # + # Check input parameters count against minimum and maximum required + # + if [[ "$force" = false ]]; then + local was_error="" + for qparam in "${query_params[@]}" "${path_params[@]}"; do + local parameter_values + mapfile -t parameter_values < <(sed -e 's/'":::"'/\n/g' <<<"${operation_parameters[$qparam]}") + + # + # Check if the number of provided values is not less than minimum required + # + if [[ ${#parameter_values[@]} -lt ${operation_parameters_minimum_occurrences["${operation}:::${qparam}"]} ]]; then + echo "ERROR: Too few values provided for '${qparam}' parameter." + was_error=true + fi + + # + # Check if the number of provided values is not more than maximum + # + if [[ ${operation_parameters_maximum_occurrences["${operation}:::${qparam}"]} -gt 0 \ + && ${#parameter_values[@]} -gt ${operation_parameters_maximum_occurrences["${operation}:::${qparam}"]} ]]; then + echo "ERROR: Too many values provided for '${qparam}' parameter" + was_error=true + fi + done + if [[ -n "$was_error" ]]; then + exit 1 + fi + fi + + # First replace all path parameters in the path + for pparam in "${path_params[@]}"; do + local path_regex="(.*)(\\{$pparam\\})(.*)" + if [[ $path_template =~ $path_regex ]]; then + path_template=${BASH_REMATCH[1]}${operation_parameters[$pparam]}${BASH_REMATCH[3]} + fi + done + + local query_request_part="" + + for qparam in "${query_params[@]}"; do + if [[ "${operation_parameters[$qparam]}" == "" ]]; then + continue + fi + + # Get the array of parameter values + local parameter_value="" + local parameter_values + mapfile -t parameter_values < <(sed -e 's/'":::"'/\n/g' <<<"${operation_parameters[$qparam]}") + + + if [[ ${qparam} == "api_key_query" ]]; then + if [[ -n "${parameter_values[*]}" ]]; then + parameter_value+="${qparam}=${parameter_values}" + else + echo "Missing ApiKey!!! You have to provide on command line option 'api_key_query=...'" + exit 1 + fi + continue + fi + + # + # Append parameters without specific cardinality + # + local collection_type="${operation_parameters_collection_type["${operation}:::${qparam}"]}" + if [[ "${collection_type}" == "" ]]; then + local vcount=0 + for qvalue in "${parameter_values[@]}"; do + if [[ $((vcount++)) -gt 0 ]]; then + parameter_value+="&" + fi + parameter_value+="${qparam}=${qvalue}" + done + # + # Append parameters specified as 'mutli' collections i.e. param=value1¶m=value2&... + # + elif [[ "${collection_type}" == "multi" ]]; then + local vcount=0 + for qvalue in "${parameter_values[@]}"; do + if [[ $((vcount++)) -gt 0 ]]; then + parameter_value+="&" + fi + parameter_value+="${qparam}=${qvalue}" + done + # + # Append parameters specified as 'csv' collections i.e. param=value1,value2,... + # + elif [[ "${collection_type}" == "csv" ]]; then + parameter_value+="${qparam}=" + local vcount=0 + for qvalue in "${parameter_values[@]}"; do + if [[ $((vcount++)) -gt 0 ]]; then + parameter_value+="," + fi + parameter_value+="${qvalue}" + done + # + # Append parameters specified as 'ssv' collections i.e. param="value1 value2 ..." + # + elif [[ "${collection_type}" == "ssv" ]]; then + parameter_value+="${qparam}=" + local vcount=0 + for qvalue in "${parameter_values[@]}"; do + if [[ $((vcount++)) -gt 0 ]]; then + parameter_value+=" " + fi + parameter_value+="${qvalue}" + done + # + # Append parameters specified as 'tsv' collections i.e. param="value1\tvalue2\t..." + # + elif [[ "${collection_type}" == "tsv" ]]; then + parameter_value+="${qparam}=" + local vcount=0 + for qvalue in "${parameter_values[@]}"; do + if [[ $((vcount++)) -gt 0 ]]; then + parameter_value+="\\t" + fi + parameter_value+="${qvalue}" + done + else + echo "Unsupported collection format \"${collection_type}\"" + exit 1 + fi + + if [[ -n "${parameter_value}" ]]; then + if [[ -n "${query_request_part}" ]]; then + query_request_part+="&" + fi + query_request_part+="${parameter_value}" + fi + + done + + + # Now append query parameters - if any + if [[ -n "${query_request_part}" ]]; then + path_template+="?${query_request_part}" + fi + + echo "$path_template" +} + + + +############################################################################### +# +# Print main help message +# +############################################################################### +print_help() { +cat <${OFF}] + [-ac|--accept ${GREEN}${OFF}] [-ct,--content-type ${GREEN}${OFF}] + [--host ${CYAN}${OFF}] [--dry-run] [-nc|--no-colors] ${YELLOW}${OFF} [-h|--help] + [${BLUE}${OFF}] [${MAGENTA}${OFF}] [${MAGENTA}${OFF}] + + - ${CYAN}${OFF} - endpoint of the REST service without basepath + + - ${RED}${OFF} - any valid cURL options can be passed before ${YELLOW}${OFF} + - ${GREEN}${OFF} - either full mime-type or one of supported abbreviations: + (text, html, md, csv, css, rtf, json, xml, yaml, js, bin, + rdf, jpg, png, gif, bmp, tiff) + - ${BLUE}${OFF} - HTTP headers can be passed in the form ${YELLOW}HEADER${OFF}:${BLUE}VALUE${OFF} + - ${MAGENTA}${OFF} - REST operation parameters can be passed in the following + forms: + * ${YELLOW}KEY${OFF}=${BLUE}VALUE${OFF} - path or query parameters + - ${MAGENTA}${OFF} - simple JSON body content (first level only) can be build + using the following arguments: + * ${YELLOW}KEY${OFF}==${BLUE}VALUE${OFF} - body parameters which will be added to body + JSON as '{ ..., "${YELLOW}KEY${OFF}": "${BLUE}VALUE${OFF}", ... }' + * ${YELLOW}KEY${OFF}:=${BLUE}VALUE${OFF} - body parameters which will be added to body + JSON as '{ ..., "${YELLOW}KEY${OFF}": ${BLUE}VALUE${OFF}, ... }' + +EOF + echo -e "${BOLD}${WHITE}Authentication methods${OFF}" + echo -e "" + echo -e " - ${BLUE}Api-key${OFF} - add '${RED}api_key:${OFF}' after ${YELLOW}${OFF}" + + echo -e " - ${BLUE}Api-key${OFF} - add '${RED}api_key_query=${OFF}' after ${YELLOW}${OFF}" + + echo -e " - ${BLUE}Basic AUTH${OFF} - add '-u :' before ${YELLOW}${OFF}" + + echo -e " - ${BLUE}Basic AUTH${OFF} - add '-u :' before ${YELLOW}${OFF}" + + echo -e " - ${MAGENTA}OAuth2 (flow: implicit)${OFF}" + echo -e " Authorization URL: " + echo -e " * http://petstore.swagger.io/api/oauth/dialog" + echo -e " Scopes:" + echo -e " * write:pets - modify pets in your account" + echo -e " * read:pets - read your pets" + echo "" + echo -e "${BOLD}${WHITE}Operations (grouped by tags)${OFF}" + echo "" + echo -e "${BOLD}${WHITE}[anotherFake]${OFF}" +read -r -d '' ops <${OFF}\\t\\t\\t\\tSpecify the host URL " +echo -e " \\t\\t\\t\\t(e.g. 'https://petstore.swagger.io')" + + echo -e " --force\\t\\t\\t\\tForce command invocation in spite of missing" + echo -e " \\t\\t\\t\\trequired parameters or wrong content type" + echo -e " --dry-run\\t\\t\\t\\tPrint out the cURL command without" + echo -e " \\t\\t\\t\\texecuting it" + echo -e " -nc,--no-colors\\t\\t\\tEnforce print without colors, otherwise autodected" + echo -e " -ac,--accept ${YELLOW}${OFF}\\t\\tSet the 'Accept' header in the request" + echo -e " -ct,--content-type ${YELLOW}${OFF}\\tSet the 'Content-type' header in " + echo -e " \\tthe request" + echo "" +} + + +############################################################################## +# +# Print REST service description +# +############################################################################## +print_about() { + echo "" + echo -e "${BOLD}${WHITE}OpenAPI Petstore command line client (API version 1.0.0)${OFF}" + echo "" + echo -e "License: Apache-2.0" + echo -e "Contact: " + echo "" +read -r -d '' appdescription < 10. Other values will generated exceptions" | paste -sd' ' | fold -sw 80 + echo -e "" + echo -e "${BOLD}${WHITE}Parameters${OFF}" + echo -e " * ${GREEN}order_id${OFF} ${BLUE}[integer]${OFF} ${RED}(required)${OFF} ${CYAN}(default: null)${OFF} - ID of pet that needs to be fetched ${YELLOW}Specify as: order_id=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo "" + echo -e "${BOLD}${WHITE}Responses${OFF}" + code=200 + echo -e "${result_color_table[${code:0:1}]} 200;successful operation${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' + code=400 + echo -e "${result_color_table[${code:0:1}]} 400;Invalid ID supplied${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' + code=404 + echo -e "${result_color_table[${code:0:1}]} 404;Order not found${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' +} +############################################################################## +# +# Print help for placeOrder operation +# +############################################################################## +print_placeOrder_help() { + echo "" + echo -e "${BOLD}${WHITE}placeOrder - Place an order for a pet${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e "" + echo -e "${BOLD}${WHITE}Parameters${OFF}" + echo -e " * ${GREEN}body${OFF} ${BLUE}[application/json]${OFF} ${RED}(required)${OFF}${OFF} - order placed for purchasing the pet" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e "" + echo "" + echo -e "${BOLD}${WHITE}Responses${OFF}" + code=200 + echo -e "${result_color_table[${code:0:1}]} 200;successful operation${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' + code=400 + echo -e "${result_color_table[${code:0:1}]} 400;Invalid Order${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' +} +############################################################################## +# +# Print help for createUser operation +# +############################################################################## +print_createUser_help() { + echo "" + echo -e "${BOLD}${WHITE}createUser - Create user${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e "" + echo -e "This can only be done by the logged in user." | paste -sd' ' | fold -sw 80 + echo -e "" + echo -e "${BOLD}${WHITE}Parameters${OFF}" + echo -e " * ${GREEN}body${OFF} ${BLUE}[application/json]${OFF} ${RED}(required)${OFF}${OFF} - Created user object" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e "" + echo "" + echo -e "${BOLD}${WHITE}Responses${OFF}" + code=0 + echo -e "${result_color_table[${code:0:1}]} 0;successful operation${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' +} +############################################################################## +# +# Print help for createUsersWithArrayInput operation +# +############################################################################## +print_createUsersWithArrayInput_help() { + echo "" + echo -e "${BOLD}${WHITE}createUsersWithArrayInput - Creates list of users with given input array${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e "" + echo -e "${BOLD}${WHITE}Parameters${OFF}" + echo -e " * ${GREEN}body${OFF} ${BLUE}[application/json]${OFF} ${RED}(required)${OFF}${OFF} - List of user object" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e "" + echo "" + echo -e "${BOLD}${WHITE}Responses${OFF}" + code=0 + echo -e "${result_color_table[${code:0:1}]} 0;successful operation${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' +} +############################################################################## +# +# Print help for createUsersWithListInput operation +# +############################################################################## +print_createUsersWithListInput_help() { + echo "" + echo -e "${BOLD}${WHITE}createUsersWithListInput - Creates list of users with given input array${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e "" + echo -e "${BOLD}${WHITE}Parameters${OFF}" + echo -e " * ${GREEN}body${OFF} ${BLUE}[application/json]${OFF} ${RED}(required)${OFF}${OFF} - List of user object" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e "" + echo "" + echo -e "${BOLD}${WHITE}Responses${OFF}" + code=0 + echo -e "${result_color_table[${code:0:1}]} 0;successful operation${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' +} +############################################################################## +# +# Print help for deleteUser operation +# +############################################################################## +print_deleteUser_help() { + echo "" + echo -e "${BOLD}${WHITE}deleteUser - Delete user${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e "" + echo -e "This can only be done by the logged in user." | paste -sd' ' | fold -sw 80 + echo -e "" + echo -e "${BOLD}${WHITE}Parameters${OFF}" + echo -e " * ${GREEN}username${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF} ${CYAN}(default: null)${OFF} - The name that needs to be deleted ${YELLOW}Specify as: username=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo "" + echo -e "${BOLD}${WHITE}Responses${OFF}" + code=400 + echo -e "${result_color_table[${code:0:1}]} 400;Invalid username supplied${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' + code=404 + echo -e "${result_color_table[${code:0:1}]} 404;User not found${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' +} +############################################################################## +# +# Print help for getUserByName operation +# +############################################################################## +print_getUserByName_help() { + echo "" + echo -e "${BOLD}${WHITE}getUserByName - Get user by user name${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e "" + echo -e "${BOLD}${WHITE}Parameters${OFF}" + echo -e " * ${GREEN}username${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF} ${CYAN}(default: null)${OFF} - The name that needs to be fetched. Use user1 for testing. ${YELLOW}Specify as: username=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo "" + echo -e "${BOLD}${WHITE}Responses${OFF}" + code=200 + echo -e "${result_color_table[${code:0:1}]} 200;successful operation${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' + code=400 + echo -e "${result_color_table[${code:0:1}]} 400;Invalid username supplied${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' + code=404 + echo -e "${result_color_table[${code:0:1}]} 404;User not found${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' +} +############################################################################## +# +# Print help for loginUser operation +# +############################################################################## +print_loginUser_help() { + echo "" + echo -e "${BOLD}${WHITE}loginUser - Logs user into the system${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e "" + echo -e "${BOLD}${WHITE}Parameters${OFF}" + echo -e " * ${GREEN}username${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF} ${CYAN}(default: null)${OFF} - The user name for login${YELLOW} Specify as: username=value${OFF}" \ + | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e " * ${GREEN}password${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF} ${CYAN}(default: null)${OFF} - The password for login in clear text${YELLOW} Specify as: password=value${OFF}" \ + | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo "" + echo -e "${BOLD}${WHITE}Responses${OFF}" + code=200 + echo -e "${result_color_table[${code:0:1}]} 200;successful operation${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' + echo -e " ${BOLD}${WHITE}Response headers${OFF}" + echo -e " ${BLUE}X-Rate-Limit${OFF} - calls per hour allowed by the user" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e " ${BLUE}X-Expires-After${OFF} - date in UTC when token expires" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + code=400 + echo -e "${result_color_table[${code:0:1}]} 400;Invalid username/password supplied${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' +} +############################################################################## +# +# Print help for logoutUser operation +# +############################################################################## +print_logoutUser_help() { + echo "" + echo -e "${BOLD}${WHITE}logoutUser - Logs out current logged in user session${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e "" + echo "" + echo -e "${BOLD}${WHITE}Responses${OFF}" + code=0 + echo -e "${result_color_table[${code:0:1}]} 0;successful operation${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' +} +############################################################################## +# +# Print help for updateUser operation +# +############################################################################## +print_updateUser_help() { + echo "" + echo -e "${BOLD}${WHITE}updateUser - Updated user${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e "" + echo -e "This can only be done by the logged in user." | paste -sd' ' | fold -sw 80 + echo -e "" + echo -e "${BOLD}${WHITE}Parameters${OFF}" + echo -e " * ${GREEN}username${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF} ${CYAN}(default: null)${OFF} - name that need to be deleted ${YELLOW}Specify as: username=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e " * ${GREEN}body${OFF} ${BLUE}[application/json]${OFF} ${RED}(required)${OFF}${OFF} - Updated user object" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e "" + echo "" + echo -e "${BOLD}${WHITE}Responses${OFF}" + code=400 + echo -e "${result_color_table[${code:0:1}]} 400;Invalid user supplied${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' + code=404 + echo -e "${result_color_table[${code:0:1}]} 404;User not found${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' +} + + +############################################################################## +# +# Call 123Test@$%SpecialTags operation +# +############################################################################## +call_123Test@$%SpecialTags() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=() + local path + + if ! path=$(build_request_path "/v2/another-fake/dummy" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="PATCH" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + local body_json_curl="" + + # + # Check if the user provided 'Content-type' headers in the + # command line. If not try to set them based on the OpenAPI specification + # if values produces and consumes are defined unambigously + # + if [[ -z $header_content_type ]]; then + header_content_type="application/json" + fi + + + if [[ -z $header_content_type && "$force" = false ]]; then + : + echo "ERROR: Request's content-type not specified!!!" + echo "This operation expects content-type in one of the following formats:" + echo -e "\\t- application/json" + echo "" + echo "Use '--content-type' to set proper content type" + exit 1 + else + headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" + fi + + + # + # If we have received some body content over pipe, pass it from the + # temporary file to cURL + # + if [[ -n $body_content_temp_file ]]; then + if [[ "$print_curl" = true ]]; then + echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + else + eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + fi + rm "${body_content_temp_file}" + # + # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE + # + else + body_json_curl=$(body_parameters_to_json) + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + fi + fi +} + +############################################################################## +# +# Call fooGet operation +# +############################################################################## +call_fooGet() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=() + local path + + if ! path=$(build_request_path "/v2/foo" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="GET" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + fi +} + +############################################################################## +# +# Call fakeHealthGet operation +# +############################################################################## +call_fakeHealthGet() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=() + local path + + if ! path=$(build_request_path "/v2/fake/health" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="GET" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + fi +} + +############################################################################## +# +# Call fakeOuterBooleanSerialize operation +# +############################################################################## +call_fakeOuterBooleanSerialize() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=() + local path + + if ! path=$(build_request_path "/v2/fake/outer/boolean" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="POST" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + local body_json_curl="" + + # + # Check if the user provided 'Content-type' headers in the + # command line. If not try to set them based on the OpenAPI specification + # if values produces and consumes are defined unambigously + # + if [[ -z $header_content_type ]]; then + header_content_type="application/json" + fi + + + if [[ -z $header_content_type && "$force" = false ]]; then + : + echo "ERROR: Request's content-type not specified!!!" + echo "This operation expects content-type in one of the following formats:" + echo -e "\\t- application/json" + echo "" + echo "Use '--content-type' to set proper content type" + exit 1 + else + headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" + fi + + + # + # If we have received some body content over pipe, pass it from the + # temporary file to cURL + # + if [[ -n $body_content_temp_file ]]; then + if [[ "$print_curl" = true ]]; then + echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + else + eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + fi + rm "${body_content_temp_file}" + # + # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE + # + else + body_json_curl=$(body_parameters_to_json) + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + fi + fi +} + +############################################################################## +# +# Call fakeOuterCompositeSerialize operation +# +############################################################################## +call_fakeOuterCompositeSerialize() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=() + local path + + if ! path=$(build_request_path "/v2/fake/outer/composite" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="POST" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + local body_json_curl="" + + # + # Check if the user provided 'Content-type' headers in the + # command line. If not try to set them based on the OpenAPI specification + # if values produces and consumes are defined unambigously + # + if [[ -z $header_content_type ]]; then + header_content_type="application/json" + fi + + + if [[ -z $header_content_type && "$force" = false ]]; then + : + echo "ERROR: Request's content-type not specified!!!" + echo "This operation expects content-type in one of the following formats:" + echo -e "\\t- application/json" + echo "" + echo "Use '--content-type' to set proper content type" + exit 1 + else + headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" + fi + + + # + # If we have received some body content over pipe, pass it from the + # temporary file to cURL + # + if [[ -n $body_content_temp_file ]]; then + if [[ "$print_curl" = true ]]; then + echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + else + eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + fi + rm "${body_content_temp_file}" + # + # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE + # + else + body_json_curl=$(body_parameters_to_json) + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + fi + fi +} + +############################################################################## +# +# Call fakeOuterNumberSerialize operation +# +############################################################################## +call_fakeOuterNumberSerialize() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=() + local path + + if ! path=$(build_request_path "/v2/fake/outer/number" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="POST" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + local body_json_curl="" + + # + # Check if the user provided 'Content-type' headers in the + # command line. If not try to set them based on the OpenAPI specification + # if values produces and consumes are defined unambigously + # + if [[ -z $header_content_type ]]; then + header_content_type="application/json" + fi + + + if [[ -z $header_content_type && "$force" = false ]]; then + : + echo "ERROR: Request's content-type not specified!!!" + echo "This operation expects content-type in one of the following formats:" + echo -e "\\t- application/json" + echo "" + echo "Use '--content-type' to set proper content type" + exit 1 + else + headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" + fi + + + # + # If we have received some body content over pipe, pass it from the + # temporary file to cURL + # + if [[ -n $body_content_temp_file ]]; then + if [[ "$print_curl" = true ]]; then + echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + else + eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + fi + rm "${body_content_temp_file}" + # + # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE + # + else + body_json_curl=$(body_parameters_to_json) + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + fi + fi +} + +############################################################################## +# +# Call fakeOuterStringSerialize operation +# +############################################################################## +call_fakeOuterStringSerialize() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=() + local path + + if ! path=$(build_request_path "/v2/fake/outer/string" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="POST" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + local body_json_curl="" + + # + # Check if the user provided 'Content-type' headers in the + # command line. If not try to set them based on the OpenAPI specification + # if values produces and consumes are defined unambigously + # + if [[ -z $header_content_type ]]; then + header_content_type="application/json" + fi + + + if [[ -z $header_content_type && "$force" = false ]]; then + : + echo "ERROR: Request's content-type not specified!!!" + echo "This operation expects content-type in one of the following formats:" + echo -e "\\t- application/json" + echo "" + echo "Use '--content-type' to set proper content type" + exit 1 + else + headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" + fi + + + # + # If we have received some body content over pipe, pass it from the + # temporary file to cURL + # + if [[ -n $body_content_temp_file ]]; then + if [[ "$print_curl" = true ]]; then + echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + else + eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + fi + rm "${body_content_temp_file}" + # + # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE + # + else + body_json_curl=$(body_parameters_to_json) + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + fi + fi +} + +############################################################################## +# +# Call testBodyWithFileSchema operation +# +############################################################################## +call_testBodyWithFileSchema() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=() + local path + + if ! path=$(build_request_path "/v2/fake/body-with-file-schema" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="PUT" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + local body_json_curl="" + + # + # Check if the user provided 'Content-type' headers in the + # command line. If not try to set them based on the OpenAPI specification + # if values produces and consumes are defined unambigously + # + if [[ -z $header_content_type ]]; then + header_content_type="application/json" + fi + + + if [[ -z $header_content_type && "$force" = false ]]; then + : + echo "ERROR: Request's content-type not specified!!!" + echo "This operation expects content-type in one of the following formats:" + echo -e "\\t- application/json" + echo "" + echo "Use '--content-type' to set proper content type" + exit 1 + else + headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" + fi + + + # + # If we have received some body content over pipe, pass it from the + # temporary file to cURL + # + if [[ -n $body_content_temp_file ]]; then + if [[ "$print_curl" = true ]]; then + echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + else + eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + fi + rm "${body_content_temp_file}" + # + # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE + # + else + body_json_curl=$(body_parameters_to_json) + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + fi + fi +} + +############################################################################## +# +# Call testBodyWithQueryParams operation +# +############################################################################## +call_testBodyWithQueryParams() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=(query) + local path + + if ! path=$(build_request_path "/v2/fake/body-with-query-params" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="PUT" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + local body_json_curl="" + + # + # Check if the user provided 'Content-type' headers in the + # command line. If not try to set them based on the OpenAPI specification + # if values produces and consumes are defined unambigously + # + if [[ -z $header_content_type ]]; then + header_content_type="application/json" + fi + + + if [[ -z $header_content_type && "$force" = false ]]; then + : + echo "ERROR: Request's content-type not specified!!!" + echo "This operation expects content-type in one of the following formats:" + echo -e "\\t- application/json" + echo "" + echo "Use '--content-type' to set proper content type" + exit 1 + else + headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" + fi + + + # + # If we have received some body content over pipe, pass it from the + # temporary file to cURL + # + if [[ -n $body_content_temp_file ]]; then + if [[ "$print_curl" = true ]]; then + echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + else + eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + fi + rm "${body_content_temp_file}" + # + # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE + # + else + body_json_curl=$(body_parameters_to_json) + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + fi + fi +} + +############################################################################## +# +# Call testClientModel operation +# +############################################################################## +call_testClientModel() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=() + local path + + if ! path=$(build_request_path "/v2/fake" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="PATCH" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + local body_json_curl="" + + # + # Check if the user provided 'Content-type' headers in the + # command line. If not try to set them based on the OpenAPI specification + # if values produces and consumes are defined unambigously + # + if [[ -z $header_content_type ]]; then + header_content_type="application/json" + fi + + + if [[ -z $header_content_type && "$force" = false ]]; then + : + echo "ERROR: Request's content-type not specified!!!" + echo "This operation expects content-type in one of the following formats:" + echo -e "\\t- application/json" + echo "" + echo "Use '--content-type' to set proper content type" + exit 1 + else + headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" + fi + + + # + # If we have received some body content over pipe, pass it from the + # temporary file to cURL + # + if [[ -n $body_content_temp_file ]]; then + if [[ "$print_curl" = true ]]; then + echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + else + eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + fi + rm "${body_content_temp_file}" + # + # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE + # + else + body_json_curl=$(body_parameters_to_json) + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + fi + fi +} + +############################################################################## +# +# Call testEndpointParameters operation +# +############################################################################## +call_testEndpointParameters() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=( ) + local path + + if ! path=$(build_request_path "/v2/fake" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="POST" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + fi +} + +############################################################################## +# +# Call testEnumParameters operation +# +############################################################################## +call_testEnumParameters() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=(enum_query_string_array enum_query_string enum_query_integer enum_query_double) + local path + + if ! path=$(build_request_path "/v2/fake" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="GET" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + fi +} + +############################################################################## +# +# Call testGroupParameters operation +# +############################################################################## +call_testGroupParameters() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=(required_string_group required_int64_group string_group int64_group ) + local path + + if ! path=$(build_request_path "/v2/fake" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="DELETE" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + fi +} + +############################################################################## +# +# Call testInlineAdditionalProperties operation +# +############################################################################## +call_testInlineAdditionalProperties() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=() + local path + + if ! path=$(build_request_path "/v2/fake/inline-additionalProperties" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="POST" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + local body_json_curl="" + + # + # Check if the user provided 'Content-type' headers in the + # command line. If not try to set them based on the OpenAPI specification + # if values produces and consumes are defined unambigously + # + if [[ -z $header_content_type ]]; then + header_content_type="application/json" + fi + + + if [[ -z $header_content_type && "$force" = false ]]; then + : + echo "ERROR: Request's content-type not specified!!!" + echo "This operation expects content-type in one of the following formats:" + echo -e "\\t- application/json" + echo "" + echo "Use '--content-type' to set proper content type" + exit 1 + else + headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" + fi + + + # + # If we have received some body content over pipe, pass it from the + # temporary file to cURL + # + if [[ -n $body_content_temp_file ]]; then + if [[ "$print_curl" = true ]]; then + echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + else + eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + fi + rm "${body_content_temp_file}" + # + # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE + # + else + body_json_curl=$(body_parameters_to_json) + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + fi + fi +} + +############################################################################## +# +# Call testJsonFormData operation +# +############################################################################## +call_testJsonFormData() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=() + local path + + if ! path=$(build_request_path "/v2/fake/jsonFormData" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="GET" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + fi +} + +############################################################################## +# +# Call testClassname operation +# +############################################################################## +call_testClassname() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=( api_key_query ) + local path + + if ! path=$(build_request_path "/v2/fake_classname_test" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="PATCH" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + local body_json_curl="" + + # + # Check if the user provided 'Content-type' headers in the + # command line. If not try to set them based on the OpenAPI specification + # if values produces and consumes are defined unambigously + # + if [[ -z $header_content_type ]]; then + header_content_type="application/json" + fi + + + if [[ -z $header_content_type && "$force" = false ]]; then + : + echo "ERROR: Request's content-type not specified!!!" + echo "This operation expects content-type in one of the following formats:" + echo -e "\\t- application/json" + echo "" + echo "Use '--content-type' to set proper content type" + exit 1 + else + headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" + fi + + + # + # If we have received some body content over pipe, pass it from the + # temporary file to cURL + # + if [[ -n $body_content_temp_file ]]; then + if [[ "$print_curl" = true ]]; then + echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + else + eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + fi + rm "${body_content_temp_file}" + # + # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE + # + else + body_json_curl=$(body_parameters_to_json) + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + fi + fi +} + +############################################################################## +# +# Call addPet operation +# +############################################################################## +call_addPet() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=( ) + local path + + if ! path=$(build_request_path "/v2/pet" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="POST" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + local body_json_curl="" + + # + # Check if the user provided 'Content-type' headers in the + # command line. If not try to set them based on the OpenAPI specification + # if values produces and consumes are defined unambigously + # + + + if [[ -z $header_content_type && "$force" = false ]]; then + : + echo "ERROR: Request's content-type not specified!!!" + echo "This operation expects content-type in one of the following formats:" + echo -e "\\t- application/json" + echo -e "\\t- application/xml" + echo "" + echo "Use '--content-type' to set proper content type" + exit 1 + else + headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" + fi + + + # + # If we have received some body content over pipe, pass it from the + # temporary file to cURL + # + if [[ -n $body_content_temp_file ]]; then + if [[ "$print_curl" = true ]]; then + echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + else + eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + fi + rm "${body_content_temp_file}" + # + # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE + # + else + body_json_curl=$(body_parameters_to_json) + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + fi + fi +} + +############################################################################## +# +# Call deletePet operation +# +############################################################################## +call_deletePet() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=(petId) + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=( ) + local path + + if ! path=$(build_request_path "/v2/pet/{petId}" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="DELETE" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + fi +} + +############################################################################## +# +# Call findPetsByStatus operation +# +############################################################################## +call_findPetsByStatus() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=(status ) + local path + + if ! path=$(build_request_path "/v2/pet/findByStatus" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="GET" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + fi +} + +############################################################################## +# +# Call findPetsByTags operation +# +############################################################################## +call_findPetsByTags() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=(tags ) + local path + + if ! path=$(build_request_path "/v2/pet/findByTags" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="GET" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + fi +} + +############################################################################## +# +# Call getPetById operation +# +############################################################################## +call_getPetById() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=(petId) + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=( ) + local path + + if ! path=$(build_request_path "/v2/pet/{petId}" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="GET" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + fi +} + +############################################################################## +# +# Call updatePet operation +# +############################################################################## +call_updatePet() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=( ) + local path + + if ! path=$(build_request_path "/v2/pet" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="PUT" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + local body_json_curl="" + + # + # Check if the user provided 'Content-type' headers in the + # command line. If not try to set them based on the OpenAPI specification + # if values produces and consumes are defined unambigously + # + + + if [[ -z $header_content_type && "$force" = false ]]; then + : + echo "ERROR: Request's content-type not specified!!!" + echo "This operation expects content-type in one of the following formats:" + echo -e "\\t- application/json" + echo -e "\\t- application/xml" + echo "" + echo "Use '--content-type' to set proper content type" + exit 1 + else + headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" + fi + + + # + # If we have received some body content over pipe, pass it from the + # temporary file to cURL + # + if [[ -n $body_content_temp_file ]]; then + if [[ "$print_curl" = true ]]; then + echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + else + eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + fi + rm "${body_content_temp_file}" + # + # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE + # + else + body_json_curl=$(body_parameters_to_json) + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + fi + fi +} + +############################################################################## +# +# Call updatePetWithForm operation +# +############################################################################## +call_updatePetWithForm() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=(petId) + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=( ) + local path + + if ! path=$(build_request_path "/v2/pet/{petId}" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="POST" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + fi +} + +############################################################################## +# +# Call uploadFile operation +# +############################################################################## +call_uploadFile() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=(petId) + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=( ) + local path + + if ! path=$(build_request_path "/v2/pet/{petId}/uploadImage" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="POST" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + fi +} + +############################################################################## +# +# Call uploadFileWithRequiredFile operation +# +############################################################################## +call_uploadFileWithRequiredFile() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=(petId) + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=( ) + local path + + if ! path=$(build_request_path "/v2/fake/{petId}/uploadImageWithRequiredFile" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="POST" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + fi +} + +############################################################################## +# +# Call deleteOrder operation +# +############################################################################## +call_deleteOrder() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=(order_id) + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=() + local path + + if ! path=$(build_request_path "/v2/store/order/{order_id}" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="DELETE" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + fi +} + +############################################################################## +# +# Call getInventory operation +# +############################################################################## +call_getInventory() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=( ) + local path + + if ! path=$(build_request_path "/v2/store/inventory" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="GET" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + fi +} + +############################################################################## +# +# Call getOrderById operation +# +############################################################################## +call_getOrderById() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=(order_id) + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=() + local path + + if ! path=$(build_request_path "/v2/store/order/{order_id}" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="GET" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + fi +} + +############################################################################## +# +# Call placeOrder operation +# +############################################################################## +call_placeOrder() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=() + local path + + if ! path=$(build_request_path "/v2/store/order" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="POST" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + local body_json_curl="" + + # + # Check if the user provided 'Content-type' headers in the + # command line. If not try to set them based on the OpenAPI specification + # if values produces and consumes are defined unambigously + # + if [[ -z $header_content_type ]]; then + header_content_type="application/json" + fi + + + if [[ -z $header_content_type && "$force" = false ]]; then + : + echo "ERROR: Request's content-type not specified!!!" + echo "This operation expects content-type in one of the following formats:" + echo -e "\\t- application/json" + echo "" + echo "Use '--content-type' to set proper content type" + exit 1 + else + headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" + fi + + + # + # If we have received some body content over pipe, pass it from the + # temporary file to cURL + # + if [[ -n $body_content_temp_file ]]; then + if [[ "$print_curl" = true ]]; then + echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + else + eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + fi + rm "${body_content_temp_file}" + # + # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE + # + else + body_json_curl=$(body_parameters_to_json) + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + fi + fi +} + +############################################################################## +# +# Call createUser operation +# +############################################################################## +call_createUser() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=() + local path + + if ! path=$(build_request_path "/v2/user" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="POST" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + local body_json_curl="" + + # + # Check if the user provided 'Content-type' headers in the + # command line. If not try to set them based on the OpenAPI specification + # if values produces and consumes are defined unambigously + # + if [[ -z $header_content_type ]]; then + header_content_type="application/json" + fi + + + if [[ -z $header_content_type && "$force" = false ]]; then + : + echo "ERROR: Request's content-type not specified!!!" + echo "This operation expects content-type in one of the following formats:" + echo -e "\\t- application/json" + echo "" + echo "Use '--content-type' to set proper content type" + exit 1 + else + headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" + fi + + + # + # If we have received some body content over pipe, pass it from the + # temporary file to cURL + # + if [[ -n $body_content_temp_file ]]; then + if [[ "$print_curl" = true ]]; then + echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + else + eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + fi + rm "${body_content_temp_file}" + # + # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE + # + else + body_json_curl=$(body_parameters_to_json) + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + fi + fi +} + +############################################################################## +# +# Call createUsersWithArrayInput operation +# +############################################################################## +call_createUsersWithArrayInput() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=() + local path + + if ! path=$(build_request_path "/v2/user/createWithArray" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="POST" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + local body_json_curl="" + + # + # Check if the user provided 'Content-type' headers in the + # command line. If not try to set them based on the OpenAPI specification + # if values produces and consumes are defined unambigously + # + if [[ -z $header_content_type ]]; then + header_content_type="application/json" + fi + + + if [[ -z $header_content_type && "$force" = false ]]; then + : + echo "ERROR: Request's content-type not specified!!!" + echo "This operation expects content-type in one of the following formats:" + echo -e "\\t- application/json" + echo "" + echo "Use '--content-type' to set proper content type" + exit 1 + else + headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" + fi + + + # + # If we have received some body content over pipe, pass it from the + # temporary file to cURL + # + if [[ -n $body_content_temp_file ]]; then + if [[ "$print_curl" = true ]]; then + echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + else + eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + fi + rm "${body_content_temp_file}" + # + # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE + # + else + body_json_curl=$(body_parameters_to_json) + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + fi + fi +} + +############################################################################## +# +# Call createUsersWithListInput operation +# +############################################################################## +call_createUsersWithListInput() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=() + local path + + if ! path=$(build_request_path "/v2/user/createWithList" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="POST" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + local body_json_curl="" + + # + # Check if the user provided 'Content-type' headers in the + # command line. If not try to set them based on the OpenAPI specification + # if values produces and consumes are defined unambigously + # + if [[ -z $header_content_type ]]; then + header_content_type="application/json" + fi + + + if [[ -z $header_content_type && "$force" = false ]]; then + : + echo "ERROR: Request's content-type not specified!!!" + echo "This operation expects content-type in one of the following formats:" + echo -e "\\t- application/json" + echo "" + echo "Use '--content-type' to set proper content type" + exit 1 + else + headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" + fi + + + # + # If we have received some body content over pipe, pass it from the + # temporary file to cURL + # + if [[ -n $body_content_temp_file ]]; then + if [[ "$print_curl" = true ]]; then + echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + else + eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + fi + rm "${body_content_temp_file}" + # + # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE + # + else + body_json_curl=$(body_parameters_to_json) + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + fi + fi +} + +############################################################################## +# +# Call deleteUser operation +# +############################################################################## +call_deleteUser() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=(username) + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=() + local path + + if ! path=$(build_request_path "/v2/user/{username}" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="DELETE" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + fi +} + +############################################################################## +# +# Call getUserByName operation +# +############################################################################## +call_getUserByName() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=(username) + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=() + local path + + if ! path=$(build_request_path "/v2/user/{username}" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="GET" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + fi +} + +############################################################################## +# +# Call loginUser operation +# +############################################################################## +call_loginUser() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=(username password) + local path + + if ! path=$(build_request_path "/v2/user/login" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="GET" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + fi +} + +############################################################################## +# +# Call logoutUser operation +# +############################################################################## +call_logoutUser() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=() + local path + + if ! path=$(build_request_path "/v2/user/logout" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="GET" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + fi +} + +############################################################################## +# +# Call updateUser operation +# +############################################################################## +call_updateUser() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=(username) + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=() + local path + + if ! path=$(build_request_path "/v2/user/{username}" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="PUT" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + local body_json_curl="" + + # + # Check if the user provided 'Content-type' headers in the + # command line. If not try to set them based on the OpenAPI specification + # if values produces and consumes are defined unambigously + # + if [[ -z $header_content_type ]]; then + header_content_type="application/json" + fi + + + if [[ -z $header_content_type && "$force" = false ]]; then + : + echo "ERROR: Request's content-type not specified!!!" + echo "This operation expects content-type in one of the following formats:" + echo -e "\\t- application/json" + echo "" + echo "Use '--content-type' to set proper content type" + exit 1 + else + headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" + fi + + + # + # If we have received some body content over pipe, pass it from the + # temporary file to cURL + # + if [[ -n $body_content_temp_file ]]; then + if [[ "$print_curl" = true ]]; then + echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + else + eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + fi + rm "${body_content_temp_file}" + # + # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE + # + else + body_json_curl=$(body_parameters_to_json) + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + fi + fi +} + + + +############################################################################## +# +# Main +# +############################################################################## + + +# Check dependencies +type curl >/dev/null 2>&1 || { echo >&2 "ERROR: You do not have 'cURL' installed."; exit 1; } +type sed >/dev/null 2>&1 || { echo >&2 "ERROR: You do not have 'sed' installed."; exit 1; } +type column >/dev/null 2>&1 || { echo >&2 "ERROR: You do not have 'bsdmainutils' installed."; exit 1; } + +# +# Process command line +# +# Pass all arguments before 'operation' to cURL except the ones we override +# +take_user=false +take_host=false +take_accept_header=false +take_contenttype_header=false + +for key in "$@"; do +# Take the value of -u|--user argument +if [[ "$take_user" = true ]]; then + basic_auth_credential="$key" + take_user=false + continue +fi +# Take the value of --host argument +if [[ "$take_host" = true ]]; then + host="$key" + take_host=false + continue +fi +# Take the value of --accept argument +if [[ "$take_accept_header" = true ]]; then + header_accept=$(lookup_mime_type "$key") + take_accept_header=false + continue +fi +# Take the value of --content-type argument +if [[ "$take_contenttype_header" = true ]]; then + header_content_type=$(lookup_mime_type "$key") + take_contenttype_header=false + continue +fi +case $key in + -h|--help) + if [[ "x$operation" == "x" ]]; then + print_help + exit 0 + else + eval "print_${operation}_help" + exit 0 + fi + ;; + -V|--version) + print_version + exit 0 + ;; + --about) + print_about + exit 0 + ;; + -u|--user) + take_user=true + ;; + --host) + take_host=true + ;; + --force) + force=true + ;; + -ac|--accept) + take_accept_header=true + ;; + -ct|--content-type) + take_contenttype_header=true + ;; + --dry-run) + print_curl=true + ;; + -nc|--no-colors) + RED="" + GREEN="" + YELLOW="" + BLUE="" + MAGENTA="" + CYAN="" + WHITE="" + BOLD="" + OFF="" + result_color_table=( "" "" "" "" "" "" "" ) + ;; + 123Test@$%SpecialTags) + operation="123Test@$%SpecialTags" + ;; + fooGet) + operation="fooGet" + ;; + fakeHealthGet) + operation="fakeHealthGet" + ;; + fakeOuterBooleanSerialize) + operation="fakeOuterBooleanSerialize" + ;; + fakeOuterCompositeSerialize) + operation="fakeOuterCompositeSerialize" + ;; + fakeOuterNumberSerialize) + operation="fakeOuterNumberSerialize" + ;; + fakeOuterStringSerialize) + operation="fakeOuterStringSerialize" + ;; + testBodyWithFileSchema) + operation="testBodyWithFileSchema" + ;; + testBodyWithQueryParams) + operation="testBodyWithQueryParams" + ;; + testClientModel) + operation="testClientModel" + ;; + testEndpointParameters) + operation="testEndpointParameters" + ;; + testEnumParameters) + operation="testEnumParameters" + ;; + testGroupParameters) + operation="testGroupParameters" + ;; + testInlineAdditionalProperties) + operation="testInlineAdditionalProperties" + ;; + testJsonFormData) + operation="testJsonFormData" + ;; + testClassname) + operation="testClassname" + ;; + addPet) + operation="addPet" + ;; + deletePet) + operation="deletePet" + ;; + findPetsByStatus) + operation="findPetsByStatus" + ;; + findPetsByTags) + operation="findPetsByTags" + ;; + getPetById) + operation="getPetById" + ;; + updatePet) + operation="updatePet" + ;; + updatePetWithForm) + operation="updatePetWithForm" + ;; + uploadFile) + operation="uploadFile" + ;; + uploadFileWithRequiredFile) + operation="uploadFileWithRequiredFile" + ;; + deleteOrder) + operation="deleteOrder" + ;; + getInventory) + operation="getInventory" + ;; + getOrderById) + operation="getOrderById" + ;; + placeOrder) + operation="placeOrder" + ;; + createUser) + operation="createUser" + ;; + createUsersWithArrayInput) + operation="createUsersWithArrayInput" + ;; + createUsersWithListInput) + operation="createUsersWithListInput" + ;; + deleteUser) + operation="deleteUser" + ;; + getUserByName) + operation="getUserByName" + ;; + loginUser) + operation="loginUser" + ;; + logoutUser) + operation="logoutUser" + ;; + updateUser) + operation="updateUser" + ;; + *==*) + # Parse body arguments and convert them into top level + # JSON properties passed in the body content as strings + if [[ "$operation" ]]; then + IFS='==' read -r body_key sep body_value <<< "$key" + body_parameters[${body_key}]="\"${body_value}\"" + fi + ;; + *:=*) + # Parse body arguments and convert them into top level + # JSON properties passed in the body content without qoutes + if [[ "$operation" ]]; then + # ignore error about 'sep' being unused + # shellcheck disable=SC2034 + IFS=':=' read -r body_key sep body_value <<< "$key" + body_parameters[${body_key}]=${body_value} + fi + ;; + +\([^=]\):*) + # Parse header arguments and convert them into curl + # only after the operation argument + if [[ "$operation" ]]; then + IFS=':' read -r header_name header_value <<< "$key" + # + # If the header key is the same as the api_key expected by API in the + # header, override the ${apikey_auth_credential} variable + # + if [[ $header_name == "api_key" ]]; then + apikey_auth_credential=$header_value + fi + header_arguments[$header_name]=$header_value + else + curl_arguments+=" $key" + fi + ;; + -) + body_content_temp_file=$(mktemp) + cat - > "$body_content_temp_file" + ;; + *=*) + # Parse operation arguments and convert them into curl + # only after the operation argument + if [[ "$operation" ]]; then + IFS='=' read -r parameter_name parameter_value <<< "$key" + if [[ -z "${operation_parameters[$parameter_name]+foo}" ]]; then + operation_parameters[$parameter_name]=$(url_escape "${parameter_value}") + else + operation_parameters[$parameter_name]+=":::"$(url_escape "${parameter_value}") + fi + else + curl_arguments+=" $key" + fi + ;; + *) + # If we are before the operation, treat the arguments as cURL arguments + if [[ "x$operation" == "x" ]]; then + # Maintain quotes around cURL arguments if necessary + space_regexp="[[:space:]]" + if [[ $key =~ $space_regexp ]]; then + curl_arguments+=" \"$key\"" + else + curl_arguments+=" $key" + fi + fi + ;; +esac +done + + +# Check if user provided host name +if [[ -z "$host" ]]; then + ERROR_MSG="ERROR: No hostname provided!!! You have to provide on command line option '--host ...'" + exit 1 +fi + +# Check if user specified operation ID +if [[ -z "$operation" ]]; then + ERROR_MSG="ERROR: No operation specified!!!" + exit 1 +fi + + +# Run cURL command based on the operation ID +case $operation in + 123Test@$%SpecialTags) + call_123Test@$%SpecialTags + ;; + fooGet) + call_fooGet + ;; + fakeHealthGet) + call_fakeHealthGet + ;; + fakeOuterBooleanSerialize) + call_fakeOuterBooleanSerialize + ;; + fakeOuterCompositeSerialize) + call_fakeOuterCompositeSerialize + ;; + fakeOuterNumberSerialize) + call_fakeOuterNumberSerialize + ;; + fakeOuterStringSerialize) + call_fakeOuterStringSerialize + ;; + testBodyWithFileSchema) + call_testBodyWithFileSchema + ;; + testBodyWithQueryParams) + call_testBodyWithQueryParams + ;; + testClientModel) + call_testClientModel + ;; + testEndpointParameters) + call_testEndpointParameters + ;; + testEnumParameters) + call_testEnumParameters + ;; + testGroupParameters) + call_testGroupParameters + ;; + testInlineAdditionalProperties) + call_testInlineAdditionalProperties + ;; + testJsonFormData) + call_testJsonFormData + ;; + testClassname) + call_testClassname + ;; + addPet) + call_addPet + ;; + deletePet) + call_deletePet + ;; + findPetsByStatus) + call_findPetsByStatus + ;; + findPetsByTags) + call_findPetsByTags + ;; + getPetById) + call_getPetById + ;; + updatePet) + call_updatePet + ;; + updatePetWithForm) + call_updatePetWithForm + ;; + uploadFile) + call_uploadFile + ;; + uploadFileWithRequiredFile) + call_uploadFileWithRequiredFile + ;; + deleteOrder) + call_deleteOrder + ;; + getInventory) + call_getInventory + ;; + getOrderById) + call_getOrderById + ;; + placeOrder) + call_placeOrder + ;; + createUser) + call_createUser + ;; + createUsersWithArrayInput) + call_createUsersWithArrayInput + ;; + createUsersWithListInput) + call_createUsersWithListInput + ;; + deleteUser) + call_deleteUser + ;; + getUserByName) + call_getUserByName + ;; + loginUser) + call_loginUser + ;; + logoutUser) + call_logoutUser + ;; + updateUser) + call_updateUser + ;; + *) + ERROR_MSG="ERROR: Unknown operation: $operation" + exit 1 +esac diff --git a/samples/client/petstore/bash/client.sh.bash-completion b/samples/client/petstore/bash/client.sh.bash-completion new file mode 100644 index 00000000000..f099fa5897a --- /dev/null +++ b/samples/client/petstore/bash/client.sh.bash-completion @@ -0,0 +1,326 @@ +# completion -*- shell-script -*- + +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +# ! +# ! Note: +# ! +# ! THIS SCRIPT HAS BEEN AUTOMATICALLY GENERATED USING +# ! openapi-generator (https://openapi-generator.tech) +# ! FROM OPENAPI SPECIFICATION IN JSON. +# ! +# ! +# ! +# ! System wide installation: +# ! +# ! $ sudo cp .bash-completion /etc/bash-completion.d/ +# ! +# ! +# ! User home installation (add this line to .bash_profile): +# ! +# ! [ -r ~/.bash-completion ] && source ~/.bash-completion +# ! +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +declare -A mime_type_abbreviations +# text/* +mime_type_abbreviations["text"]="text/plain" +mime_type_abbreviations["html"]="text/html" +mime_type_abbreviations["md"]="text/x-markdown" +mime_type_abbreviations["csv"]="text/csv" +mime_type_abbreviations["css"]="text/css" +mime_type_abbreviations["rtf"]="text/rtf" +# application/* +mime_type_abbreviations["json"]="application/json" +mime_type_abbreviations["xml"]="application/xml" +mime_type_abbreviations["yaml"]="application/yaml" +mime_type_abbreviations["js"]="application/javascript" +mime_type_abbreviations["bin"]="application/octet-stream" +mime_type_abbreviations["rdf"]="application/rdf+xml" +# image/* +mime_type_abbreviations["jpg"]="image/jpeg" +mime_type_abbreviations["png"]="image/png" +mime_type_abbreviations["gif"]="image/gif" +mime_type_abbreviations["bmp"]="image/bmp" +mime_type_abbreviations["tiff"]="image/tiff" + + +# +# Check if this is OSX, if so defined custom init_completion +# +if [[ `uname` =~ "Darwin" ]]; then + __osx_init_completion() + { + COMPREPLY=() + _get_comp_words_by_ref cur prev words cword + } +fi + +_() +{ + local cur + local prev + local words + local cword + + # The reference of currently selected REST operation + local operation="" + + # The list of available operation in the REST service + # It's modelled as an associative array for efficient key lookup + declare -A operations + operations["123Test@$%SpecialTags"]=1 + operations["fooGet"]=1 + operations["fakeHealthGet"]=1 + operations["fakeOuterBooleanSerialize"]=1 + operations["fakeOuterCompositeSerialize"]=1 + operations["fakeOuterNumberSerialize"]=1 + operations["fakeOuterStringSerialize"]=1 + operations["testBodyWithFileSchema"]=1 + operations["testBodyWithQueryParams"]=1 + operations["testClientModel"]=1 + operations["testEndpointParameters"]=1 + operations["testEnumParameters"]=1 + operations["testGroupParameters"]=1 + operations["testInlineAdditionalProperties"]=1 + operations["testJsonFormData"]=1 + operations["testClassname"]=1 + operations["addPet"]=1 + operations["deletePet"]=1 + operations["findPetsByStatus"]=1 + operations["findPetsByTags"]=1 + operations["getPetById"]=1 + operations["updatePet"]=1 + operations["updatePetWithForm"]=1 + operations["uploadFile"]=1 + operations["uploadFileWithRequiredFile"]=1 + operations["deleteOrder"]=1 + operations["getInventory"]=1 + operations["getOrderById"]=1 + operations["placeOrder"]=1 + operations["createUser"]=1 + operations["createUsersWithArrayInput"]=1 + operations["createUsersWithListInput"]=1 + operations["deleteUser"]=1 + operations["getUserByName"]=1 + operations["loginUser"]=1 + operations["logoutUser"]=1 + operations["updateUser"]=1 + + # An associative array of operations to their parameters + # Only include path, query and header parameters + declare -A operation_parameters + operation_parameters["123Test@$%SpecialTags"]="" + operation_parameters["fooGet"]="" + operation_parameters["fakeHealthGet"]="" + operation_parameters["fakeOuterBooleanSerialize"]="" + operation_parameters["fakeOuterCompositeSerialize"]="" + operation_parameters["fakeOuterNumberSerialize"]="" + operation_parameters["fakeOuterStringSerialize"]="" + operation_parameters["testBodyWithFileSchema"]="" + operation_parameters["testBodyWithQueryParams"]="query= " + operation_parameters["testClientModel"]="" + operation_parameters["testEndpointParameters"]="" + operation_parameters["testEnumParameters"]="enum_query_string_array= enum_query_string= enum_query_integer= enum_query_double= enum_header_string_array: enum_header_string: " + operation_parameters["testGroupParameters"]="required_string_group= required_int64_group= string_group= int64_group= required_boolean_group: boolean_group: " + operation_parameters["testInlineAdditionalProperties"]="" + operation_parameters["testJsonFormData"]="" + operation_parameters["testClassname"]="" + operation_parameters["addPet"]="" + operation_parameters["deletePet"]="petId= api_key: " + operation_parameters["findPetsByStatus"]="status= " + operation_parameters["findPetsByTags"]="tags= " + operation_parameters["getPetById"]="petId= " + operation_parameters["updatePet"]="" + operation_parameters["updatePetWithForm"]="petId= " + operation_parameters["uploadFile"]="petId= " + operation_parameters["uploadFileWithRequiredFile"]="petId= " + operation_parameters["deleteOrder"]="order_id= " + operation_parameters["getInventory"]="" + operation_parameters["getOrderById"]="order_id= " + operation_parameters["placeOrder"]="" + operation_parameters["createUser"]="" + operation_parameters["createUsersWithArrayInput"]="" + operation_parameters["createUsersWithListInput"]="" + operation_parameters["deleteUser"]="username= " + operation_parameters["getUserByName"]="username= " + operation_parameters["loginUser"]="username= password= " + operation_parameters["logoutUser"]="" + operation_parameters["updateUser"]="username= " + + # An associative array of possible values for enum parameters + declare -A operation_parameters_enum_values + operation_parameters_enum_values["testGroupParameters::required_boolean_group"]="true false" + operation_parameters_enum_values["testGroupParameters::boolean_group"]="true false" + operation_parameters_enum_values["testGroupParameters::required_boolean_group"]="true false" + operation_parameters_enum_values["testGroupParameters::boolean_group"]="true false" + operation_parameters_enum_values["testGroupParameters::required_boolean_group"]="true false" + operation_parameters_enum_values["testGroupParameters::boolean_group"]="true false" + operation_parameters_enum_values["testGroupParameters::required_boolean_group"]="true false" + operation_parameters_enum_values["testGroupParameters::boolean_group"]="true false" + operation_parameters_enum_values["testGroupParameters::required_boolean_group"]="true false" + operation_parameters_enum_values["testGroupParameters::boolean_group"]="true false" + operation_parameters_enum_values["testGroupParameters::required_boolean_group"]="true false" + operation_parameters_enum_values["testGroupParameters::boolean_group"]="true false" + + # + # Check if this is OSX and use special __osx_init_completion function + # + if [[ `uname` =~ "Darwin" ]]; then + __osx_init_completion || return + else + _init_completion -s || return + fi + + + # Check if operation is already in the command line provided + for word in "${words[@]}"; do + if [[ -n $word && ${operations[$word]} ]]; then + operation="${word}" + fi + done + + if [[ -z $operation ]]; then + case $prev in + --ciphers|--connect-timeout|-C|--continue-at|-F|--form|--form-string|\ + --ftp-account|--ftp-alternative-to-user|-P|--ftp-port|-H|--header|-h|\ + --help|--hostpubmd5|--keepalive-time|--krb|--limit-rate|--local-port|\ + --mail-from|--mail-rcpt|--max-filesize|--max-redirs|-m|--max-time|\ + --pass|--proto|--proto-redir|--proxy-user|--proxy1.0|-Q|--quote|-r|\ + --range|-X|--request|--retry|--retry-delay|--retry-max-time|\ + --socks5-gssapi-service|-t|--telnet-option|--tftp-blksize|-z|\ + --time-cond|--url|-u|--user|-A|--user-agent|-V|--version|-w|\ + --write-out|--resolve|--tlsuser|--tlspassword|--about) + return + ;; + -K|--config|-b|--cookie|-c|--cookie-jar|-D|--dump-header|--egd-file|\ + --key|--libcurl|-o|--output|--random-file|-T|--upload-file|--trace|\ + --trace-ascii|--netrc-file) + _filedir + return + ;; + --cacert|-E|--cert) + _filedir '@(c?(e)rt|cer|pem|der)' + return + ;; + --capath) + _filedir -d + return + ;; + --cert-type|--key-type) + COMPREPLY=( $( compgen -W 'DER PEM ENG' -- "$cur" ) ) + return + ;; + --crlfile) + _filedir crl + return + ;; + -d|--data|--data-ascii|--data-binary|--data-urlencode) + if [[ $cur == \@* ]]; then + cur=${cur:1} + _filedir + COMPREPLY=( "${COMPREPLY[@]/#/@}" ) + fi + return + ;; + --delegation) + COMPREPLY=( $( compgen -W 'none policy always' -- "$cur" ) ) + return + ;; + --engine) + COMPREPLY=( $( compgen -W 'list' -- "$cur" ) ) + return + ;; + --ftp-method) + COMPREPLY=( $( compgen -W 'multicwd nocwd singlecwd' -- "$cur" ) ) + return + ;; + --ftp-ssl-ccc-mode) + COMPREPLY=( $( compgen -W 'active passive' -- "$cur" ) ) + return + ;; + --interface) + _available_interfaces -a + return + ;; + -x|--proxy|--socks4|--socks4a|--socks5|--socks5-hostname) + _known_hosts_real + return + ;; + --pubkey) + _filedir pub + return + ;; + --stderr) + COMPREPLY=( $( compgen -W '-' -- "$cur" ) ) + _filedir + return + ;; + --tlsauthtype) + COMPREPLY=( $( compgen -W 'SRP' -- "$cur" ) ) + return + ;; + --host) + COMPREPLY=( $( compgen -W 'http:// https://' -- "$cur" ) ) + return + ;; + -ct|--content-type|-ac|--accept) + COMPREPLY=( $( compgen -W '${!mime_type_abbreviations[*]}' -- "$cur" ) ) + return + ;; + esac + fi + + # + # Complete the server address based on ~/.ssh/known_hosts + # and ~/.ssh/config + # + local prefix=${COMP_WORDS[COMP_CWORD-2]} + local colon=${COMP_WORDS[COMP_CWORD-1]} + if [[ "$colon" == ":" && ( $prefix == "https" || $prefix == "http" ) ]]; then + COMPREPLY=() + local comp_ssh_hosts=`[[ -f ~/.ssh/known_hosts ]] && \ + ( cat ~/.ssh/known_hosts | \ + grep '^[a-zA-Z0-9]' | \ + cut -f 1 -d ' ' | \ + sed -e s/,.*//g | \ + grep -v ^# | \ + uniq | \ + grep -v "\[" ) ; + [[ -f ~/.ssh/config ]] && \ + ( cat ~/.ssh/config | \ + grep "^Host " | \ + awk '{print $2}' )` + COMPREPLY=( $( compgen -P '//' -W '${comp_ssh_hosts}' -- "${cur:2}") ) + return + fi + + # + # Complete the and cURL's arguments + # + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$(_parse_help curl) $(_parse_help $1)' -- "$cur" ) ) + return + fi + + # + # If the argument starts with a letter this could be either an operation + # or an operation parameter + # When $cur is empty, suggest the list of operations by default + # + if [[ $cur =~ ^[A-Za-z_0-9]* ]]; then + # If operation has not been yet selected, suggest the list of operations + # otherwise suggest arguments of this operation as declared in the + # OpenAPI specification + if [[ -z $operation ]]; then + COMPREPLY=( $(compgen -W '${!operations[*]}' -- ${cur}) ) + else + COMPREPLY=( $(compgen -W '${operation_parameters[$operation]}' -- ${cur}) ) + compopt -o nospace + fi + return + fi + +} && +complete -F _ + +# ex: ts=4 sw=4 et filetype=sh diff --git a/samples/client/petstore/bash/docs/$special[modelName].md b/samples/client/petstore/bash/docs/$special[modelName].md new file mode 100644 index 00000000000..884128c8b39 --- /dev/null +++ b/samples/client/petstore/bash/docs/$special[modelName].md @@ -0,0 +1,10 @@ +# $special[model.name] + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DollarspecialLeft_Square_BracketpropertyPeriodnameRight_Square_Bracket** | **integer** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/200Response.md b/samples/client/petstore/bash/docs/200Response.md new file mode 100644 index 00000000000..b575df6f2eb --- /dev/null +++ b/samples/client/petstore/bash/docs/200Response.md @@ -0,0 +1,11 @@ +# 200_response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **integer** | | [optional] [default to null] +**class** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/bash/docs/AdditionalPropertiesAnyType.md new file mode 100644 index 00000000000..dfb55fb51b4 --- /dev/null +++ b/samples/client/petstore/bash/docs/AdditionalPropertiesAnyType.md @@ -0,0 +1,10 @@ +# AdditionalPropertiesAnyType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/AdditionalPropertiesArray.md b/samples/client/petstore/bash/docs/AdditionalPropertiesArray.md new file mode 100644 index 00000000000..5edd62c9050 --- /dev/null +++ b/samples/client/petstore/bash/docs/AdditionalPropertiesArray.md @@ -0,0 +1,10 @@ +# AdditionalPropertiesArray + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/bash/docs/AdditionalPropertiesBoolean.md new file mode 100644 index 00000000000..3223701aa4c --- /dev/null +++ b/samples/client/petstore/bash/docs/AdditionalPropertiesBoolean.md @@ -0,0 +1,10 @@ +# AdditionalPropertiesBoolean + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/AdditionalPropertiesClass.md b/samples/client/petstore/bash/docs/AdditionalPropertiesClass.md index 70fe49c1edf..5b1ed2dce63 100644 --- a/samples/client/petstore/bash/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/bash/docs/AdditionalPropertiesClass.md @@ -3,8 +3,17 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**map_property** | **map[String, string]** | | [optional] [default to null] -**map_of_map_property** | **map[String, map[String, string]]** | | [optional] [default to null] +**mapUnderscorestring** | **map[String, string]** | | [optional] [default to null] +**mapUnderscorenumber** | **map[String, integer]** | | [optional] [default to null] +**mapUnderscoreinteger** | **map[String, integer]** | | [optional] [default to null] +**mapUnderscoreboolean** | **map[String, boolean]** | | [optional] [default to null] +**mapUnderscorearrayUnderscoreinteger** | **map[String, array[integer]]** | | [optional] [default to null] +**mapUnderscorearrayUnderscoreanytype** | **map[String, array[map]]** | | [optional] [default to null] +**mapUnderscoremapUnderscorestring** | **map[String, map[String, string]]** | | [optional] [default to null] +**mapUnderscoremapUnderscoreanytype** | **map[String, map[String, map]]** | | [optional] [default to null] +**anytypeUnderscore1** | [**map**](.md) | | [optional] [default to null] +**anytypeUnderscore2** | [**map**](.md) | | [optional] [default to null] +**anytypeUnderscore3** | [**map**](.md) | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/bash/docs/AdditionalPropertiesInteger.md new file mode 100644 index 00000000000..c95116042e2 --- /dev/null +++ b/samples/client/petstore/bash/docs/AdditionalPropertiesInteger.md @@ -0,0 +1,10 @@ +# AdditionalPropertiesInteger + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/bash/docs/AdditionalPropertiesNumber.md new file mode 100644 index 00000000000..5ba50ecfe5e --- /dev/null +++ b/samples/client/petstore/bash/docs/AdditionalPropertiesNumber.md @@ -0,0 +1,10 @@ +# AdditionalPropertiesNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/AdditionalPropertiesObject.md b/samples/client/petstore/bash/docs/AdditionalPropertiesObject.md new file mode 100644 index 00000000000..5694b15649a --- /dev/null +++ b/samples/client/petstore/bash/docs/AdditionalPropertiesObject.md @@ -0,0 +1,10 @@ +# AdditionalPropertiesObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/AdditionalPropertiesString.md b/samples/client/petstore/bash/docs/AdditionalPropertiesString.md new file mode 100644 index 00000000000..f39e11d88e5 --- /dev/null +++ b/samples/client/petstore/bash/docs/AdditionalPropertiesString.md @@ -0,0 +1,10 @@ +# AdditionalPropertiesString + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/AnotherFakeApi.md b/samples/client/petstore/bash/docs/AnotherFakeApi.md index f5b70880abc..f93603717d2 100644 --- a/samples/client/petstore/bash/docs/AnotherFakeApi.md +++ b/samples/client/petstore/bash/docs/AnotherFakeApi.md @@ -4,25 +4,28 @@ All URIs are relative to */v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +[**123Test@$%SpecialTags**](AnotherFakeApi.md#123Test@$%SpecialTags) | **PATCH** /another-fake/dummy | To test special tags -## **testSpecialTags** + +## 123Test@$%SpecialTags To test special tags -To test special tags +To test special tags and operation ID starting with number ### Example + ```bash -petstore-cli testSpecialTags +petstore-cli 123Test@$%SpecialTags ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md) | client model | + **body** | [**Client**](Client.md) | client model | ### Return type @@ -34,8 +37,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/ArrayTest.md b/samples/client/petstore/bash/docs/ArrayTest.md index 6c86d88f309..ee047cb7370 100644 --- a/samples/client/petstore/bash/docs/ArrayTest.md +++ b/samples/client/petstore/bash/docs/ArrayTest.md @@ -3,9 +3,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**array_of_string** | **array[string]** | | [optional] [default to null] -**array_array_of_integer** | **array[array[integer]]** | | [optional] [default to null] -**array_array_of_model** | **array[array[ReadOnlyFirst]]** | | [optional] [default to null] +**arrayUnderscoreofUnderscorestring** | **array[string]** | | [optional] [default to null] +**arrayUnderscorearrayUnderscoreofUnderscoreinteger** | **array[array[integer]]** | | [optional] [default to null] +**arrayUnderscorearrayUnderscoreofUnderscoremodel** | **array[array[ReadOnlyFirst]]** | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/Capitalization.md b/samples/client/petstore/bash/docs/Capitalization.md index 362258aa0d4..3a6e754d44d 100644 --- a/samples/client/petstore/bash/docs/Capitalization.md +++ b/samples/client/petstore/bash/docs/Capitalization.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **smallCamel** | **string** | | [optional] [default to null] **CapitalCamel** | **string** | | [optional] [default to null] -**small_Snake** | **string** | | [optional] [default to null] -**Capital_Snake** | **string** | | [optional] [default to null] -**SCA_ETH_Flow_Points** | **string** | | [optional] [default to null] -**ATT_NAME** | **string** | | [optional] [default to null] +**smallUnderscoreSnake** | **string** | | [optional] [default to null] +**CapitalUnderscoreSnake** | **string** | | [optional] [default to null] +**SCAUnderscoreETHUnderscoreFlowUnderscorePoints** | **string** | | [optional] [default to null] +**ATTUnderscoreNAME** | **string** | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/CatAllOf.md b/samples/client/petstore/bash/docs/CatAllOf.md new file mode 100644 index 00000000000..99ba1bec860 --- /dev/null +++ b/samples/client/petstore/bash/docs/CatAllOf.md @@ -0,0 +1,10 @@ +# Cat_allOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **boolean** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/Category.md b/samples/client/petstore/bash/docs/Category.md index 5af29e81851..25078d7ad51 100644 --- a/samples/client/petstore/bash/docs/Category.md +++ b/samples/client/petstore/bash/docs/Category.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **integer** | | [optional] [default to null] -**name** | **string** | | [optional] [default to null] +**name** | **string** | | [default to default-name] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/ClassModel.md b/samples/client/petstore/bash/docs/ClassModel.md index 7979502a642..2e1cda38387 100644 --- a/samples/client/petstore/bash/docs/ClassModel.md +++ b/samples/client/petstore/bash/docs/ClassModel.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_class** | **string** | | [optional] [default to null] +**Underscoreclass** | **string** | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/DefaultApi.md b/samples/client/petstore/bash/docs/DefaultApi.md new file mode 100644 index 00000000000..5ef9511145b --- /dev/null +++ b/samples/client/petstore/bash/docs/DefaultApi.md @@ -0,0 +1,39 @@ +# DefaultApi + +All URIs are relative to */v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fooGet**](DefaultApi.md#fooGet) | **GET** /foo | + + + +## fooGet + + + +### Example + +```bash + fooGet +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**InlineResponseDefault**](InlineResponseDefault.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not Applicable +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/bash/docs/DogAllOf.md b/samples/client/petstore/bash/docs/DogAllOf.md new file mode 100644 index 00000000000..2bf2fdd3478 --- /dev/null +++ b/samples/client/petstore/bash/docs/DogAllOf.md @@ -0,0 +1,10 @@ +# Dog_allOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/EnumArrays.md b/samples/client/petstore/bash/docs/EnumArrays.md index 70798f4be67..965ac8323cc 100644 --- a/samples/client/petstore/bash/docs/EnumArrays.md +++ b/samples/client/petstore/bash/docs/EnumArrays.md @@ -3,8 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**just_symbol** | **string** | | [optional] [default to null] -**array_enum** | **array[string]** | | [optional] [default to null] +**justUnderscoresymbol** | **string** | | [optional] [default to null] +**arrayUnderscoreenum** | **array[string]** | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/EnumTest.md b/samples/client/petstore/bash/docs/EnumTest.md new file mode 100644 index 00000000000..30b30efa730 --- /dev/null +++ b/samples/client/petstore/bash/docs/EnumTest.md @@ -0,0 +1,14 @@ +# Enum_Test + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumUnderscorestring** | **string** | | [optional] [default to null] +**enumUnderscorestringUnderscorerequired** | **string** | | [default to null] +**enumUnderscoreinteger** | **integer** | | [optional] [default to null] +**enumUnderscorenumber** | **float** | | [optional] [default to null] +**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/FakeApi.md b/samples/client/petstore/bash/docs/FakeApi.md index 458397e6727..0f9bf109d34 100644 --- a/samples/client/petstore/bash/docs/FakeApi.md +++ b/samples/client/petstore/bash/docs/FakeApi.md @@ -4,10 +4,12 @@ All URIs are relative to */v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**createXmlItem**](FakeApi.md#createXmlItem) | **POST** /fake/create_xml_item | creates an XmlItem [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | [**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters @@ -15,23 +17,62 @@ Method | HTTP request | Description 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +[**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data -## **fakeOuterBooleanSerialize** + +## createXmlItem + +creates an XmlItem + +this route creates an XmlItem + +### Example + +```bash +petstore-cli createXmlItem +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xmlItem** | [**XmlItem**](XmlItem.md) | XmlItem Body | + +### Return type + +(empty response body) + +### Authorization + +No authorization required + +### 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 +- **Accept**: Not Applicable + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## fakeOuterBooleanSerialize Test serialization of outer boolean types ### Example + ```bash petstore-cli fakeOuterBooleanSerialize ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | **boolean** | Input boolean as post body | [optional] @@ -46,27 +87,30 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not Applicable - - **Accept**: */* +- **Content-Type**: Not Applicable +- **Accept**: */* [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## **fakeOuterCompositeSerialize** + +## fakeOuterCompositeSerialize Test serialization of object with outer number type ### Example + ```bash petstore-cli fakeOuterCompositeSerialize ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **outerComposite** | [**OuterComposite**](OuterComposite.md) | Input composite as post body | [optional] + **body** | [**OuterComposite**](OuterComposite.md) | Input composite as post body | [optional] ### Return type @@ -78,24 +122,27 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not Applicable - - **Accept**: */* +- **Content-Type**: Not Applicable +- **Accept**: */* [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## **fakeOuterNumberSerialize** + +## fakeOuterNumberSerialize Test serialization of outer number types ### Example + ```bash petstore-cli fakeOuterNumberSerialize ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | **integer** | Input number as post body | [optional] @@ -110,24 +157,27 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not Applicable - - **Accept**: */* +- **Content-Type**: Not Applicable +- **Accept**: */* [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## **fakeOuterStringSerialize** + +## fakeOuterStringSerialize Test serialization of outer string types ### Example + ```bash petstore-cli fakeOuterStringSerialize ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | **string** | Input string as post body | [optional] @@ -142,26 +192,30 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not Applicable - - **Accept**: */* +- **Content-Type**: Not Applicable +- **Accept**: */* [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## **testBodyWithQueryParams** + +## testBodyWithFileSchema +For this test, the body for this request much reference a schema named 'File'. + ### Example + ```bash -petstore-cli testBodyWithQueryParams query=value +petstore-cli testBodyWithFileSchema ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **query** | **string** | | - **user** | [**User**](User.md) | | + **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md) | | ### Return type @@ -173,27 +227,64 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not Applicable +- **Content-Type**: application/json +- **Accept**: Not Applicable [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## **testClientModel** + +## testBodyWithQueryParams + + + +### Example + +```bash +petstore-cli testBodyWithQueryParams query=value +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **string** | | [default to null] + **body** | [**User**](User.md) | | + +### Return type + +(empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not Applicable + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## testClientModel To test \"client\" model To test \"client\" model ### Example + ```bash petstore-cli testClientModel ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md) | client model | + **body** | [**Client**](Client.md) | client model | ### Return type @@ -205,12 +296,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## **testEndpointParameters** + +## testEndpointParameters Fake endpoint for testing various parameters 假端點 @@ -223,12 +315,14 @@ Fake endpoint for testing various parameters 가짜 엔드 포인트 ### Example + ```bash petstore-cli testEndpointParameters ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **number** | **integer** | None | [default to null] @@ -256,33 +350,36 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not Applicable +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not Applicable [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## **testEnumParameters** + +## testEnumParameters To test enum parameters To test enum parameters ### Example + ```bash petstore-cli testEnumParameters enum_header_string_array:value enum_header_string:value Specify as: enum_query_string_array="value1,value2,..." enum_query_string=value enum_query_integer=value enum_query_double=value ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**array[string]**](string.md) | Header parameter enum test (string array) | [optional] + **enumHeaderStringArray** | [**array[string]**](string.md) | Header parameter enum test (string array) | [optional] [default to null] **enumHeaderString** | **string** | Header parameter enum test (string) | [optional] [default to -efg] - **enumQueryStringArray** | [**array[string]**](string.md) | Query parameter enum test (string array) | [optional] + **enumQueryStringArray** | [**array[string]**](string.md) | Query parameter enum test (string array) | [optional] [default to null] **enumQueryString** | **string** | Query parameter enum test (string) | [optional] [default to -efg] - **enumQueryInteger** | **integer** | Query parameter enum test (double) | [optional] - **enumQueryDouble** | **float** | Query parameter enum test (double) | [optional] - **enumFormStringArray** | **array[string]** | Form parameter enum test (string array) | [optional] [default to $] + **enumQueryInteger** | **integer** | Query parameter enum test (double) | [optional] [default to null] + **enumQueryDouble** | **float** | Query parameter enum test (double) | [optional] [default to null] + **enumFormStringArray** | [**array[string]**](string.md) | Form parameter enum test (string array) | [optional] [default to $] **enumFormString** | **string** | Form parameter enum test (string) | [optional] [default to -efg] ### Return type @@ -295,25 +392,35 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not Applicable +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not Applicable [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## **testInlineAdditionalProperties** -test inline additionalProperties +## testGroupParameters + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) ### Example + ```bash -petstore-cli testInlineAdditionalProperties +petstore-cli testGroupParameters required_string_group=value required_boolean_group:value required_int64_group=value string_group=value boolean_group:value int64_group=value ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **requestBody** | [**map[String, string]**](string.md) | request body | + **requiredStringGroup** | **integer** | Required String in group parameters | [default to null] + **requiredBooleanGroup** | **boolean** | Required Boolean in group parameters | [default to null] + **requiredInt64Group** | **integer** | Required Integer in group parameters | [default to null] + **stringGroup** | **integer** | String in group parameters | [optional] [default to null] + **booleanGroup** | **boolean** | Boolean in group parameters | [optional] [default to null] + **int64Group** | **integer** | Integer in group parameters | [optional] [default to null] ### Return type @@ -325,22 +432,58 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not Applicable +- **Content-Type**: Not Applicable +- **Accept**: Not Applicable [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## **testJsonFormData** + +## testInlineAdditionalProperties + +test inline additionalProperties + +### Example + +```bash +petstore-cli testInlineAdditionalProperties +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | [**map[String, string]**](string.md) | request body | + +### Return type + +(empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not Applicable + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## testJsonFormData test json serialization of form data ### Example + ```bash petstore-cli testJsonFormData ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **param** | **string** | field1 | [default to null] @@ -356,8 +499,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not Applicable +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not Applicable [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/FakeClassnameTags123Api.md b/samples/client/petstore/bash/docs/FakeClassnameTags123Api.md index 6499a704868..19b3d386d38 100644 --- a/samples/client/petstore/bash/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/bash/docs/FakeClassnameTags123Api.md @@ -7,22 +7,25 @@ Method | HTTP request | Description [**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case -## **testClassname** + +## testClassname To test class name in snake case To test class name in snake case ### Example + ```bash petstore-cli testClassname ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md) | client model | + **body** | [**Client**](Client.md) | client model | ### Return type @@ -34,8 +37,8 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/FileSchemaTestClass.md b/samples/client/petstore/bash/docs/FileSchemaTestClass.md new file mode 100644 index 00000000000..47de5903a44 --- /dev/null +++ b/samples/client/petstore/bash/docs/FileSchemaTestClass.md @@ -0,0 +1,11 @@ +# FileSchemaTestClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**File**](File.md) | | [optional] [default to null] +**files** | [**array[File]**](File.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/Foo.md b/samples/client/petstore/bash/docs/Foo.md new file mode 100644 index 00000000000..69ef867a797 --- /dev/null +++ b/samples/client/petstore/bash/docs/Foo.md @@ -0,0 +1,10 @@ +# Foo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **string** | | [optional] [default to bar] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/FormatTest.md b/samples/client/petstore/bash/docs/FormatTest.md new file mode 100644 index 00000000000..8f73bb59bbc --- /dev/null +++ b/samples/client/petstore/bash/docs/FormatTest.md @@ -0,0 +1,22 @@ +# format_test + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **integer** | | [optional] [default to null] +**int32** | **integer** | | [optional] [default to null] +**int64** | **integer** | | [optional] [default to null] +**number** | **integer** | | [default to null] +**float** | **float** | | [optional] [default to null] +**double** | **float** | | [optional] [default to null] +**string** | **string** | | [optional] [default to null] +**byte** | **string** | | [default to null] +**binary** | **binary** | | [optional] [default to null] +**date** | **string** | | [default to null] +**dateTime** | **string** | | [optional] [default to null] +**uuid** | **string** | | [optional] [default to null] +**password** | **string** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/HealthCheckResult.md b/samples/client/petstore/bash/docs/HealthCheckResult.md new file mode 100644 index 00000000000..fcfa835d21e --- /dev/null +++ b/samples/client/petstore/bash/docs/HealthCheckResult.md @@ -0,0 +1,10 @@ +# HealthCheckResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NullableMessage** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/InlineObject.md b/samples/client/petstore/bash/docs/InlineObject.md new file mode 100644 index 00000000000..4606c548920 --- /dev/null +++ b/samples/client/petstore/bash/docs/InlineObject.md @@ -0,0 +1,11 @@ +# inline_object + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] [default to null] +**status** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/InlineObject1.md b/samples/client/petstore/bash/docs/InlineObject1.md new file mode 100644 index 00000000000..13ab3ed546d --- /dev/null +++ b/samples/client/petstore/bash/docs/InlineObject1.md @@ -0,0 +1,11 @@ +# inline_object_1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **string** | | [optional] [default to null] +**file** | **binary** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/InlineObject2.md b/samples/client/petstore/bash/docs/InlineObject2.md new file mode 100644 index 00000000000..3ad0a1d2e0c --- /dev/null +++ b/samples/client/petstore/bash/docs/InlineObject2.md @@ -0,0 +1,11 @@ +# inline_object_2 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumUnderscoreformUnderscorestringUnderscorearray** | **array[string]** | | [optional] [default to null] +**enumUnderscoreformUnderscorestring** | **string** | | [optional] [default to -efg] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/InlineObject3.md b/samples/client/petstore/bash/docs/InlineObject3.md new file mode 100644 index 00000000000..080c4051cc4 --- /dev/null +++ b/samples/client/petstore/bash/docs/InlineObject3.md @@ -0,0 +1,23 @@ +# inline_object_3 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **integer** | | [optional] [default to null] +**int32** | **integer** | | [optional] [default to null] +**int64** | **integer** | | [optional] [default to null] +**number** | **integer** | | [default to null] +**float** | **float** | | [optional] [default to null] +**double** | **float** | | [default to null] +**string** | **string** | | [optional] [default to null] +**patternUnderscorewithoutUnderscoredelimiter** | **string** | | [default to null] +**byte** | **string** | | [default to null] +**binary** | **binary** | | [optional] [default to null] +**date** | **string** | | [optional] [default to null] +**dateTime** | **string** | | [optional] [default to null] +**password** | **string** | | [optional] [default to null] +**callback** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/InlineObject4.md b/samples/client/petstore/bash/docs/InlineObject4.md new file mode 100644 index 00000000000..a75f87f5fef --- /dev/null +++ b/samples/client/petstore/bash/docs/InlineObject4.md @@ -0,0 +1,11 @@ +# inline_object_4 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**param** | **string** | | [default to null] +**param2** | **string** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/InlineObject5.md b/samples/client/petstore/bash/docs/InlineObject5.md new file mode 100644 index 00000000000..89121b040e2 --- /dev/null +++ b/samples/client/petstore/bash/docs/InlineObject5.md @@ -0,0 +1,11 @@ +# inline_object_5 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **string** | | [optional] [default to null] +**requiredFile** | **binary** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/InlineResponseDefault.md b/samples/client/petstore/bash/docs/InlineResponseDefault.md new file mode 100644 index 00000000000..ef6d219bac4 --- /dev/null +++ b/samples/client/petstore/bash/docs/InlineResponseDefault.md @@ -0,0 +1,10 @@ +# inline_response_default + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string** | [**Foo**](Foo.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/MapTest.md b/samples/client/petstore/bash/docs/MapTest.md index 31ca86b91c1..e4ed4a23382 100644 --- a/samples/client/petstore/bash/docs/MapTest.md +++ b/samples/client/petstore/bash/docs/MapTest.md @@ -3,8 +3,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**map_map_of_string** | **map[String, map[String, string]]** | | [optional] [default to null] -**map_of_enum_string** | **map[String, string]** | | [optional] [default to null] +**mapUnderscoremapUnderscoreofUnderscorestring** | **map[String, map[String, string]]** | | [optional] [default to null] +**mapUnderscoreofUnderscoreenumUnderscorestring** | **map[String, string]** | | [optional] [default to null] +**directUnderscoremap** | **map[String, boolean]** | | [optional] [default to null] +**indirectUnderscoremap** | **map[String, boolean]** | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/Name.md b/samples/client/petstore/bash/docs/Name.md index 8f59de26d01..5c3afc21594 100644 --- a/samples/client/petstore/bash/docs/Name.md +++ b/samples/client/petstore/bash/docs/Name.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **integer** | | [default to null] -**snake_case** | **integer** | | [optional] [default to null] +**snakeUnderscorecase** | **integer** | | [optional] [default to null] **property** | **string** | | [optional] [default to null] **123Number** | **integer** | | [optional] [default to null] diff --git a/samples/client/petstore/bash/docs/NullableClass.md b/samples/client/petstore/bash/docs/NullableClass.md new file mode 100644 index 00000000000..8b85103f58f --- /dev/null +++ b/samples/client/petstore/bash/docs/NullableClass.md @@ -0,0 +1,21 @@ +# NullableClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integerUnderscoreprop** | **integer** | | [optional] [default to null] +**numberUnderscoreprop** | **integer** | | [optional] [default to null] +**booleanUnderscoreprop** | **boolean** | | [optional] [default to null] +**stringUnderscoreprop** | **string** | | [optional] [default to null] +**dateUnderscoreprop** | **string** | | [optional] [default to null] +**datetimeUnderscoreprop** | **string** | | [optional] [default to null] +**arrayUnderscorenullableUnderscoreprop** | **array[map]** | | [optional] [default to null] +**arrayUnderscoreandUnderscoreitemsUnderscorenullableUnderscoreprop** | **array[map]** | | [optional] [default to null] +**arrayUnderscoreitemsUnderscorenullable** | **array[map]** | | [optional] [default to null] +**objectUnderscorenullableUnderscoreprop** | **map[String, map]** | | [optional] [default to null] +**objectUnderscoreandUnderscoreitemsUnderscorenullableUnderscoreprop** | **map[String, map]** | | [optional] [default to null] +**objectUnderscoreitemsUnderscorenullable** | **map[String, map]** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/OuterComposite.md b/samples/client/petstore/bash/docs/OuterComposite.md index 2a4eb8388e8..afe7b21b8d7 100644 --- a/samples/client/petstore/bash/docs/OuterComposite.md +++ b/samples/client/petstore/bash/docs/OuterComposite.md @@ -3,9 +3,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**my_number** | **integer** | | [optional] [default to null] -**my_string** | **string** | | [optional] [default to null] -**my_boolean** | **boolean** | | [optional] [default to null] +**myUnderscorenumber** | **integer** | | [optional] [default to null] +**myUnderscorestring** | **string** | | [optional] [default to null] +**myUnderscoreboolean** | **boolean** | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/OuterEnumDefaultValue.md b/samples/client/petstore/bash/docs/OuterEnumDefaultValue.md new file mode 100644 index 00000000000..1487a710393 --- /dev/null +++ b/samples/client/petstore/bash/docs/OuterEnumDefaultValue.md @@ -0,0 +1,9 @@ +# OuterEnumDefaultValue + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/OuterEnumInteger.md b/samples/client/petstore/bash/docs/OuterEnumInteger.md new file mode 100644 index 00000000000..8be15eee6a2 --- /dev/null +++ b/samples/client/petstore/bash/docs/OuterEnumInteger.md @@ -0,0 +1,9 @@ +# OuterEnumInteger + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/bash/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 00000000000..27d962f106e --- /dev/null +++ b/samples/client/petstore/bash/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,9 @@ +# OuterEnumIntegerDefaultValue + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/PetApi.md b/samples/client/petstore/bash/docs/PetApi.md index d9728a14ac7..32086308206 100644 --- a/samples/client/petstore/bash/docs/PetApi.md +++ b/samples/client/petstore/bash/docs/PetApi.md @@ -12,22 +12,26 @@ Method | HTTP request | Description [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -## **addPet** + +## addPet Add a new pet to the store ### Example + ```bash petstore-cli addPet ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | ### Return type @@ -39,26 +43,29 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: Not Applicable +- **Content-Type**: application/json, application/xml +- **Accept**: Not Applicable [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## **deletePet** + +## deletePet Deletes a pet ### Example + ```bash petstore-cli deletePet petId=value api_key:value ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **integer** | Pet id to delete | - **apiKey** | **string** | | [optional] + **petId** | **integer** | Pet id to delete | [default to null] + **apiKey** | **string** | | [optional] [default to null] ### Return type @@ -70,27 +77,30 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not Applicable - - **Accept**: Not Applicable +- **Content-Type**: Not Applicable +- **Accept**: Not Applicable [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## **findPetsByStatus** + +## findPetsByStatus Finds Pets by status Multiple status values can be provided with comma separated strings ### Example + ```bash petstore-cli findPetsByStatus Specify as: status="value1,value2,..." ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**array[string]**](string.md) | Status values that need to be considered for filter | + **status** | [**array[string]**](string.md) | Status values that need to be considered for filter | [default to null] ### Return type @@ -102,27 +112,30 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not Applicable - - **Accept**: application/xml, application/json +- **Content-Type**: Not Applicable +- **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## **findPetsByTags** + +## findPetsByTags Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. ### Example + ```bash petstore-cli findPetsByTags Specify as: tags="value1,value2,..." ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**array[string]**](string.md) | Tags to filter by | + **tags** | [**array[string]**](string.md) | Tags to filter by | [default to null] ### Return type @@ -134,27 +147,30 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not Applicable - - **Accept**: application/xml, application/json +- **Content-Type**: Not Applicable +- **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## **getPetById** + +## getPetById Find pet by ID Returns a single pet ### Example + ```bash petstore-cli getPetById petId=value ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **integer** | ID of pet to return | + **petId** | **integer** | ID of pet to return | [default to null] ### Return type @@ -166,25 +182,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not Applicable - - **Accept**: application/xml, application/json +- **Content-Type**: Not Applicable +- **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## **updatePet** + +## updatePet Update an existing pet ### Example + ```bash petstore-cli updatePet ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | ### Return type @@ -196,25 +215,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: Not Applicable +- **Content-Type**: application/json, application/xml +- **Accept**: Not Applicable [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## **updatePetWithForm** + +## updatePetWithForm Updates a pet in the store with form data ### Example + ```bash petstore-cli updatePetWithForm petId=value ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **integer** | ID of pet that needs to be updated | + **petId** | **integer** | ID of pet that needs to be updated | [default to null] **name** | **string** | Updated name of the pet | [optional] [default to null] **status** | **string** | Updated status of the pet | [optional] [default to null] @@ -228,25 +250,28 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not Applicable +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not Applicable [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## **uploadFile** + +## uploadFile uploads an image ### Example + ```bash petstore-cli uploadFile petId=value ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **integer** | ID of pet to update | + **petId** | **integer** | ID of pet to update | [default to null] **additionalMetadata** | **string** | Additional data to pass to server | [optional] [default to null] **file** | **binary** | file to upload | [optional] [default to null] @@ -260,8 +285,43 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: multipart/form-data - - **Accept**: application/json +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## uploadFileWithRequiredFile + +uploads an image (required) + +### Example + +```bash +petstore-cli uploadFileWithRequiredFile petId=value +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **integer** | ID of pet to update | [default to null] + **requiredFile** | **binary** | file to upload | [default to null] + **additionalMetadata** | **string** | Additional data to pass to server | [optional] [default to null] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/SpecialModelName.md b/samples/client/petstore/bash/docs/SpecialModelName.md new file mode 100644 index 00000000000..0ba2b4da02d --- /dev/null +++ b/samples/client/petstore/bash/docs/SpecialModelName.md @@ -0,0 +1,10 @@ +# _special_model.name_ + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DollarspecialLeft_Square_BracketpropertyPeriodnameRight_Square_Bracket** | **integer** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/StoreApi.md b/samples/client/petstore/bash/docs/StoreApi.md index f7f5c324b05..56b2934562b 100644 --- a/samples/client/petstore/bash/docs/StoreApi.md +++ b/samples/client/petstore/bash/docs/StoreApi.md @@ -10,22 +10,25 @@ Method | HTTP request | Description [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet -## **deleteOrder** + +## deleteOrder Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors ### Example + ```bash petstore-cli deleteOrder order_id=value ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **string** | ID of the order that needs to be deleted | + **orderId** | **string** | ID of the order that needs to be deleted | [default to null] ### Return type @@ -37,23 +40,26 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not Applicable - - **Accept**: Not Applicable +- **Content-Type**: Not Applicable +- **Accept**: Not Applicable [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## **getInventory** + +## getInventory Returns pet inventories by status Returns a map of status codes to quantities ### Example + ```bash petstore-cli getInventory ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -66,27 +72,30 @@ This endpoint does not need any parameter. ### HTTP request headers - - **Content-Type**: Not Applicable - - **Accept**: application/json +- **Content-Type**: Not Applicable +- **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## **getOrderById** + +## getOrderById Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions ### Example + ```bash petstore-cli getOrderById order_id=value ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **integer** | ID of pet that needs to be fetched | + **orderId** | **integer** | ID of pet that needs to be fetched | [default to null] ### Return type @@ -98,25 +107,28 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not Applicable - - **Accept**: application/xml, application/json +- **Content-Type**: Not Applicable +- **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## **placeOrder** + +## placeOrder Place an order for a pet ### Example + ```bash petstore-cli placeOrder ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md) | order placed for purchasing the pet | + **body** | [**Order**](Order.md) | order placed for purchasing the pet | ### Return type @@ -128,8 +140,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not Applicable - - **Accept**: application/xml, application/json +- **Content-Type**: Not Applicable +- **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/TypeHolderDefault.md b/samples/client/petstore/bash/docs/TypeHolderDefault.md new file mode 100644 index 00000000000..91c3f8fe015 --- /dev/null +++ b/samples/client/petstore/bash/docs/TypeHolderDefault.md @@ -0,0 +1,14 @@ +# TypeHolderDefault + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**stringUnderscoreitem** | **string** | | [default to what] +**numberUnderscoreitem** | **integer** | | [default to null] +**integerUnderscoreitem** | **integer** | | [default to null] +**boolUnderscoreitem** | **boolean** | | [default to true] +**arrayUnderscoreitem** | **array[integer]** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/TypeHolderExample.md b/samples/client/petstore/bash/docs/TypeHolderExample.md new file mode 100644 index 00000000000..411eda40870 --- /dev/null +++ b/samples/client/petstore/bash/docs/TypeHolderExample.md @@ -0,0 +1,14 @@ +# TypeHolderExample + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**stringUnderscoreitem** | **string** | | [default to null] +**numberUnderscoreitem** | **integer** | | [default to null] +**integerUnderscoreitem** | **integer** | | [default to null] +**boolUnderscoreitem** | **boolean** | | [default to null] +**arrayUnderscoreitem** | **array[integer]** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/docs/UserApi.md b/samples/client/petstore/bash/docs/UserApi.md index 54a393a46be..9663a425b73 100644 --- a/samples/client/petstore/bash/docs/UserApi.md +++ b/samples/client/petstore/bash/docs/UserApi.md @@ -14,22 +14,25 @@ Method | HTTP request | Description [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user -## **createUser** + +## createUser Create user This can only be done by the logged in user. ### Example + ```bash petstore-cli createUser ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md) | Created user object | + **body** | [**User**](User.md) | Created user object | ### Return type @@ -41,25 +44,28 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not Applicable - - **Accept**: Not Applicable +- **Content-Type**: Not Applicable +- **Accept**: Not Applicable [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## **createUsersWithArrayInput** + +## createUsersWithArrayInput Creates list of users with given input array ### Example + ```bash petstore-cli createUsersWithArrayInput ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**array[User]**](array.md) | List of user object | + **body** | [**array[User]**](User.md) | List of user object | ### Return type @@ -71,25 +77,28 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not Applicable - - **Accept**: Not Applicable +- **Content-Type**: Not Applicable +- **Accept**: Not Applicable [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## **createUsersWithListInput** + +## createUsersWithListInput Creates list of users with given input array ### Example + ```bash petstore-cli createUsersWithListInput ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**array[User]**](array.md) | List of user object | + **body** | [**array[User]**](User.md) | List of user object | ### Return type @@ -101,27 +110,30 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not Applicable - - **Accept**: Not Applicable +- **Content-Type**: Not Applicable +- **Accept**: Not Applicable [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## **deleteUser** + +## deleteUser Delete user This can only be done by the logged in user. ### Example + ```bash petstore-cli deleteUser username=value ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **string** | The name that needs to be deleted | + **username** | **string** | The name that needs to be deleted | [default to null] ### Return type @@ -133,25 +145,28 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not Applicable - - **Accept**: Not Applicable +- **Content-Type**: Not Applicable +- **Accept**: Not Applicable [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## **getUserByName** + +## getUserByName Get user by user name ### Example + ```bash petstore-cli getUserByName username=value ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **string** | The name that needs to be fetched. Use user1 for testing. | + **username** | **string** | The name that needs to be fetched. Use user1 for testing. | [default to null] ### Return type @@ -163,26 +178,29 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not Applicable - - **Accept**: application/xml, application/json +- **Content-Type**: Not Applicable +- **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## **loginUser** + +## loginUser Logs user into the system ### Example + ```bash petstore-cli loginUser username=value password=value ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **string** | The user name for login | - **password** | **string** | The password for login in clear text | + **username** | **string** | The user name for login | [default to null] + **password** | **string** | The password for login in clear text | [default to null] ### Return type @@ -194,21 +212,24 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not Applicable - - **Accept**: application/xml, application/json +- **Content-Type**: Not Applicable +- **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## **logoutUser** + +## logoutUser Logs out current logged in user session ### Example + ```bash petstore-cli logoutUser ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -221,28 +242,31 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not Applicable - - **Accept**: Not Applicable +- **Content-Type**: Not Applicable +- **Accept**: Not Applicable [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -## **updateUser** + +## updateUser Updated user This can only be done by the logged in user. ### Example + ```bash petstore-cli updateUser username=value ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **string** | name that need to be deleted | - **user** | [**User**](User.md) | Updated user object | + **username** | **string** | name that need to be deleted | [default to null] + **body** | [**User**](User.md) | Updated user object | ### Return type @@ -254,8 +278,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not Applicable - - **Accept**: Not Applicable +- **Content-Type**: Not Applicable +- **Accept**: Not Applicable [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/bash/docs/XmlItem.md b/samples/client/petstore/bash/docs/XmlItem.md new file mode 100644 index 00000000000..7f60d6cd52e --- /dev/null +++ b/samples/client/petstore/bash/docs/XmlItem.md @@ -0,0 +1,38 @@ +# XmlItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributeUnderscorestring** | **string** | | [optional] [default to null] +**attributeUnderscorenumber** | **integer** | | [optional] [default to null] +**attributeUnderscoreinteger** | **integer** | | [optional] [default to null] +**attributeUnderscoreboolean** | **boolean** | | [optional] [default to null] +**wrappedUnderscorearray** | **array[integer]** | | [optional] [default to null] +**nameUnderscorestring** | **string** | | [optional] [default to null] +**nameUnderscorenumber** | **integer** | | [optional] [default to null] +**nameUnderscoreinteger** | **integer** | | [optional] [default to null] +**nameUnderscoreboolean** | **boolean** | | [optional] [default to null] +**nameUnderscorearray** | **array[integer]** | | [optional] [default to null] +**nameUnderscorewrappedUnderscorearray** | **array[integer]** | | [optional] [default to null] +**prefixUnderscorestring** | **string** | | [optional] [default to null] +**prefixUnderscorenumber** | **integer** | | [optional] [default to null] +**prefixUnderscoreinteger** | **integer** | | [optional] [default to null] +**prefixUnderscoreboolean** | **boolean** | | [optional] [default to null] +**prefixUnderscorearray** | **array[integer]** | | [optional] [default to null] +**prefixUnderscorewrappedUnderscorearray** | **array[integer]** | | [optional] [default to null] +**namespaceUnderscorestring** | **string** | | [optional] [default to null] +**namespaceUnderscorenumber** | **integer** | | [optional] [default to null] +**namespaceUnderscoreinteger** | **integer** | | [optional] [default to null] +**namespaceUnderscoreboolean** | **boolean** | | [optional] [default to null] +**namespaceUnderscorearray** | **array[integer]** | | [optional] [default to null] +**namespaceUnderscorewrappedUnderscorearray** | **array[integer]** | | [optional] [default to null] +**prefixUnderscorensUnderscorestring** | **string** | | [optional] [default to null] +**prefixUnderscorensUnderscorenumber** | **integer** | | [optional] [default to null] +**prefixUnderscorensUnderscoreinteger** | **integer** | | [optional] [default to null] +**prefixUnderscorensUnderscoreboolean** | **boolean** | | [optional] [default to null] +**prefixUnderscorensUnderscorearray** | **array[integer]** | | [optional] [default to null] +**prefixUnderscorensUnderscorewrappedUnderscorearray** | **array[integer]** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/bash/petstore-cli b/samples/client/petstore/bash/petstore-cli index b74ebf8b204..dabf7c50485 100755 --- a/samples/client/petstore/bash/petstore-cli +++ b/samples/client/petstore/bash/petstore-cli @@ -95,14 +95,16 @@ declare -a result_color_table=( "$WHITE" "$WHITE" "$GREEN" "$YELLOW" "$WHITE" "$ # 0 - optional # 1 - required declare -A operation_parameters_minimum_occurrences -operation_parameters_minimum_occurrences["testSpecialTags:::Client"]=1 +operation_parameters_minimum_occurrences["123Test@$%SpecialTags:::body"]=1 +operation_parameters_minimum_occurrences["createXmlItem:::XmlItem"]=1 operation_parameters_minimum_occurrences["fakeOuterBooleanSerialize:::body"]=0 -operation_parameters_minimum_occurrences["fakeOuterCompositeSerialize:::OuterComposite"]=0 +operation_parameters_minimum_occurrences["fakeOuterCompositeSerialize:::body"]=0 operation_parameters_minimum_occurrences["fakeOuterNumberSerialize:::body"]=0 operation_parameters_minimum_occurrences["fakeOuterStringSerialize:::body"]=0 +operation_parameters_minimum_occurrences["testBodyWithFileSchema:::body"]=1 operation_parameters_minimum_occurrences["testBodyWithQueryParams:::query"]=1 -operation_parameters_minimum_occurrences["testBodyWithQueryParams:::User"]=1 -operation_parameters_minimum_occurrences["testClientModel:::Client"]=1 +operation_parameters_minimum_occurrences["testBodyWithQueryParams:::body"]=1 +operation_parameters_minimum_occurrences["testClientModel:::body"]=1 operation_parameters_minimum_occurrences["testEndpointParameters:::number"]=1 operation_parameters_minimum_occurrences["testEndpointParameters:::double"]=1 operation_parameters_minimum_occurrences["testEndpointParameters:::pattern_without_delimiter"]=1 @@ -125,35 +127,44 @@ operation_parameters_minimum_occurrences["testEnumParameters:::enum_query_intege operation_parameters_minimum_occurrences["testEnumParameters:::enum_query_double"]=0 operation_parameters_minimum_occurrences["testEnumParameters:::enum_form_string_array"]=0 operation_parameters_minimum_occurrences["testEnumParameters:::enum_form_string"]=0 -operation_parameters_minimum_occurrences["testInlineAdditionalProperties:::request_body"]=1 +operation_parameters_minimum_occurrences["testGroupParameters:::required_string_group"]=1 +operation_parameters_minimum_occurrences["testGroupParameters:::required_boolean_group"]=1 +operation_parameters_minimum_occurrences["testGroupParameters:::required_int64_group"]=1 +operation_parameters_minimum_occurrences["testGroupParameters:::string_group"]=0 +operation_parameters_minimum_occurrences["testGroupParameters:::boolean_group"]=0 +operation_parameters_minimum_occurrences["testGroupParameters:::int64_group"]=0 +operation_parameters_minimum_occurrences["testInlineAdditionalProperties:::param"]=1 operation_parameters_minimum_occurrences["testJsonFormData:::param"]=1 operation_parameters_minimum_occurrences["testJsonFormData:::param2"]=1 -operation_parameters_minimum_occurrences["testClassname:::Client"]=1 -operation_parameters_minimum_occurrences["addPet:::Pet"]=1 +operation_parameters_minimum_occurrences["testClassname:::body"]=1 +operation_parameters_minimum_occurrences["addPet:::body"]=1 operation_parameters_minimum_occurrences["deletePet:::petId"]=1 operation_parameters_minimum_occurrences["deletePet:::api_key"]=0 operation_parameters_minimum_occurrences["findPetsByStatus:::status"]=1 operation_parameters_minimum_occurrences["findPetsByTags:::tags"]=1 operation_parameters_minimum_occurrences["getPetById:::petId"]=1 -operation_parameters_minimum_occurrences["updatePet:::Pet"]=1 +operation_parameters_minimum_occurrences["updatePet:::body"]=1 operation_parameters_minimum_occurrences["updatePetWithForm:::petId"]=1 operation_parameters_minimum_occurrences["updatePetWithForm:::name"]=0 operation_parameters_minimum_occurrences["updatePetWithForm:::status"]=0 operation_parameters_minimum_occurrences["uploadFile:::petId"]=1 operation_parameters_minimum_occurrences["uploadFile:::additionalMetadata"]=0 operation_parameters_minimum_occurrences["uploadFile:::file"]=0 +operation_parameters_minimum_occurrences["uploadFileWithRequiredFile:::petId"]=1 +operation_parameters_minimum_occurrences["uploadFileWithRequiredFile:::requiredFile"]=1 +operation_parameters_minimum_occurrences["uploadFileWithRequiredFile:::additionalMetadata"]=0 operation_parameters_minimum_occurrences["deleteOrder:::order_id"]=1 operation_parameters_minimum_occurrences["getOrderById:::order_id"]=1 -operation_parameters_minimum_occurrences["placeOrder:::Order"]=1 -operation_parameters_minimum_occurrences["createUser:::User"]=1 -operation_parameters_minimum_occurrences["createUsersWithArrayInput:::User"]=1 -operation_parameters_minimum_occurrences["createUsersWithListInput:::User"]=1 +operation_parameters_minimum_occurrences["placeOrder:::body"]=1 +operation_parameters_minimum_occurrences["createUser:::body"]=1 +operation_parameters_minimum_occurrences["createUsersWithArrayInput:::body"]=1 +operation_parameters_minimum_occurrences["createUsersWithListInput:::body"]=1 operation_parameters_minimum_occurrences["deleteUser:::username"]=1 operation_parameters_minimum_occurrences["getUserByName:::username"]=1 operation_parameters_minimum_occurrences["loginUser:::username"]=1 operation_parameters_minimum_occurrences["loginUser:::password"]=1 operation_parameters_minimum_occurrences["updateUser:::username"]=1 -operation_parameters_minimum_occurrences["updateUser:::User"]=1 +operation_parameters_minimum_occurrences["updateUser:::body"]=1 ## # This array stores the maximum number of allowed occurrences for parameter @@ -162,14 +173,16 @@ operation_parameters_minimum_occurrences["updateUser:::User"]=1 # N - N values # 0 - unlimited declare -A operation_parameters_maximum_occurrences -operation_parameters_maximum_occurrences["testSpecialTags:::Client"]=0 +operation_parameters_maximum_occurrences["123Test@$%SpecialTags:::body"]=0 +operation_parameters_maximum_occurrences["createXmlItem:::XmlItem"]=0 operation_parameters_maximum_occurrences["fakeOuterBooleanSerialize:::body"]=0 -operation_parameters_maximum_occurrences["fakeOuterCompositeSerialize:::OuterComposite"]=0 +operation_parameters_maximum_occurrences["fakeOuterCompositeSerialize:::body"]=0 operation_parameters_maximum_occurrences["fakeOuterNumberSerialize:::body"]=0 operation_parameters_maximum_occurrences["fakeOuterStringSerialize:::body"]=0 +operation_parameters_maximum_occurrences["testBodyWithFileSchema:::body"]=0 operation_parameters_maximum_occurrences["testBodyWithQueryParams:::query"]=0 -operation_parameters_maximum_occurrences["testBodyWithQueryParams:::User"]=0 -operation_parameters_maximum_occurrences["testClientModel:::Client"]=0 +operation_parameters_maximum_occurrences["testBodyWithQueryParams:::body"]=0 +operation_parameters_maximum_occurrences["testClientModel:::body"]=0 operation_parameters_maximum_occurrences["testEndpointParameters:::number"]=0 operation_parameters_maximum_occurrences["testEndpointParameters:::double"]=0 operation_parameters_maximum_occurrences["testEndpointParameters:::pattern_without_delimiter"]=0 @@ -192,48 +205,59 @@ operation_parameters_maximum_occurrences["testEnumParameters:::enum_query_intege operation_parameters_maximum_occurrences["testEnumParameters:::enum_query_double"]=0 operation_parameters_maximum_occurrences["testEnumParameters:::enum_form_string_array"]=0 operation_parameters_maximum_occurrences["testEnumParameters:::enum_form_string"]=0 -operation_parameters_maximum_occurrences["testInlineAdditionalProperties:::request_body"]=0 +operation_parameters_maximum_occurrences["testGroupParameters:::required_string_group"]=0 +operation_parameters_maximum_occurrences["testGroupParameters:::required_boolean_group"]=0 +operation_parameters_maximum_occurrences["testGroupParameters:::required_int64_group"]=0 +operation_parameters_maximum_occurrences["testGroupParameters:::string_group"]=0 +operation_parameters_maximum_occurrences["testGroupParameters:::boolean_group"]=0 +operation_parameters_maximum_occurrences["testGroupParameters:::int64_group"]=0 +operation_parameters_maximum_occurrences["testInlineAdditionalProperties:::param"]=0 operation_parameters_maximum_occurrences["testJsonFormData:::param"]=0 operation_parameters_maximum_occurrences["testJsonFormData:::param2"]=0 -operation_parameters_maximum_occurrences["testClassname:::Client"]=0 -operation_parameters_maximum_occurrences["addPet:::Pet"]=0 +operation_parameters_maximum_occurrences["testClassname:::body"]=0 +operation_parameters_maximum_occurrences["addPet:::body"]=0 operation_parameters_maximum_occurrences["deletePet:::petId"]=0 operation_parameters_maximum_occurrences["deletePet:::api_key"]=0 operation_parameters_maximum_occurrences["findPetsByStatus:::status"]=0 operation_parameters_maximum_occurrences["findPetsByTags:::tags"]=0 operation_parameters_maximum_occurrences["getPetById:::petId"]=0 -operation_parameters_maximum_occurrences["updatePet:::Pet"]=0 +operation_parameters_maximum_occurrences["updatePet:::body"]=0 operation_parameters_maximum_occurrences["updatePetWithForm:::petId"]=0 operation_parameters_maximum_occurrences["updatePetWithForm:::name"]=0 operation_parameters_maximum_occurrences["updatePetWithForm:::status"]=0 operation_parameters_maximum_occurrences["uploadFile:::petId"]=0 operation_parameters_maximum_occurrences["uploadFile:::additionalMetadata"]=0 operation_parameters_maximum_occurrences["uploadFile:::file"]=0 +operation_parameters_maximum_occurrences["uploadFileWithRequiredFile:::petId"]=0 +operation_parameters_maximum_occurrences["uploadFileWithRequiredFile:::requiredFile"]=0 +operation_parameters_maximum_occurrences["uploadFileWithRequiredFile:::additionalMetadata"]=0 operation_parameters_maximum_occurrences["deleteOrder:::order_id"]=0 operation_parameters_maximum_occurrences["getOrderById:::order_id"]=0 -operation_parameters_maximum_occurrences["placeOrder:::Order"]=0 -operation_parameters_maximum_occurrences["createUser:::User"]=0 -operation_parameters_maximum_occurrences["createUsersWithArrayInput:::User"]=0 -operation_parameters_maximum_occurrences["createUsersWithListInput:::User"]=0 +operation_parameters_maximum_occurrences["placeOrder:::body"]=0 +operation_parameters_maximum_occurrences["createUser:::body"]=0 +operation_parameters_maximum_occurrences["createUsersWithArrayInput:::body"]=0 +operation_parameters_maximum_occurrences["createUsersWithListInput:::body"]=0 operation_parameters_maximum_occurrences["deleteUser:::username"]=0 operation_parameters_maximum_occurrences["getUserByName:::username"]=0 operation_parameters_maximum_occurrences["loginUser:::username"]=0 operation_parameters_maximum_occurrences["loginUser:::password"]=0 operation_parameters_maximum_occurrences["updateUser:::username"]=0 -operation_parameters_maximum_occurrences["updateUser:::User"]=0 +operation_parameters_maximum_occurrences["updateUser:::body"]=0 ## # The type of collection for specifying multiple values for parameter: # - multi, csv, ssv, tsv declare -A operation_parameters_collection_type -operation_parameters_collection_type["testSpecialTags:::Client"]="" +operation_parameters_collection_type["123Test@$%SpecialTags:::body"]="" +operation_parameters_collection_type["createXmlItem:::XmlItem"]="" operation_parameters_collection_type["fakeOuterBooleanSerialize:::body"]="" -operation_parameters_collection_type["fakeOuterCompositeSerialize:::OuterComposite"]="" +operation_parameters_collection_type["fakeOuterCompositeSerialize:::body"]="" operation_parameters_collection_type["fakeOuterNumberSerialize:::body"]="" operation_parameters_collection_type["fakeOuterStringSerialize:::body"]="" +operation_parameters_collection_type["testBodyWithFileSchema:::body"]="" operation_parameters_collection_type["testBodyWithQueryParams:::query"]="" -operation_parameters_collection_type["testBodyWithQueryParams:::User"]="" -operation_parameters_collection_type["testClientModel:::Client"]="" +operation_parameters_collection_type["testBodyWithQueryParams:::body"]="" +operation_parameters_collection_type["testClientModel:::body"]="" operation_parameters_collection_type["testEndpointParameters:::number"]="" operation_parameters_collection_type["testEndpointParameters:::double"]="" operation_parameters_collection_type["testEndpointParameters:::pattern_without_delimiter"]="" @@ -256,35 +280,44 @@ operation_parameters_collection_type["testEnumParameters:::enum_query_integer"]= operation_parameters_collection_type["testEnumParameters:::enum_query_double"]="" operation_parameters_collection_type["testEnumParameters:::enum_form_string_array"]= operation_parameters_collection_type["testEnumParameters:::enum_form_string"]="" -operation_parameters_collection_type["testInlineAdditionalProperties:::request_body"]= +operation_parameters_collection_type["testGroupParameters:::required_string_group"]="" +operation_parameters_collection_type["testGroupParameters:::required_boolean_group"]="" +operation_parameters_collection_type["testGroupParameters:::required_int64_group"]="" +operation_parameters_collection_type["testGroupParameters:::string_group"]="" +operation_parameters_collection_type["testGroupParameters:::boolean_group"]="" +operation_parameters_collection_type["testGroupParameters:::int64_group"]="" +operation_parameters_collection_type["testInlineAdditionalProperties:::param"]= operation_parameters_collection_type["testJsonFormData:::param"]="" operation_parameters_collection_type["testJsonFormData:::param2"]="" -operation_parameters_collection_type["testClassname:::Client"]="" -operation_parameters_collection_type["addPet:::Pet"]="" +operation_parameters_collection_type["testClassname:::body"]="" +operation_parameters_collection_type["addPet:::body"]="" operation_parameters_collection_type["deletePet:::petId"]="" operation_parameters_collection_type["deletePet:::api_key"]="" operation_parameters_collection_type["findPetsByStatus:::status"]="csv" operation_parameters_collection_type["findPetsByTags:::tags"]="csv" operation_parameters_collection_type["getPetById:::petId"]="" -operation_parameters_collection_type["updatePet:::Pet"]="" +operation_parameters_collection_type["updatePet:::body"]="" operation_parameters_collection_type["updatePetWithForm:::petId"]="" operation_parameters_collection_type["updatePetWithForm:::name"]="" operation_parameters_collection_type["updatePetWithForm:::status"]="" operation_parameters_collection_type["uploadFile:::petId"]="" operation_parameters_collection_type["uploadFile:::additionalMetadata"]="" operation_parameters_collection_type["uploadFile:::file"]="" +operation_parameters_collection_type["uploadFileWithRequiredFile:::petId"]="" +operation_parameters_collection_type["uploadFileWithRequiredFile:::requiredFile"]="" +operation_parameters_collection_type["uploadFileWithRequiredFile:::additionalMetadata"]="" operation_parameters_collection_type["deleteOrder:::order_id"]="" operation_parameters_collection_type["getOrderById:::order_id"]="" -operation_parameters_collection_type["placeOrder:::Order"]="" -operation_parameters_collection_type["createUser:::User"]="" -operation_parameters_collection_type["createUsersWithArrayInput:::User"]= -operation_parameters_collection_type["createUsersWithListInput:::User"]= +operation_parameters_collection_type["placeOrder:::body"]="" +operation_parameters_collection_type["createUser:::body"]="" +operation_parameters_collection_type["createUsersWithArrayInput:::body"]= +operation_parameters_collection_type["createUsersWithListInput:::body"]= operation_parameters_collection_type["deleteUser:::username"]="" operation_parameters_collection_type["getUserByName:::username"]="" operation_parameters_collection_type["loginUser:::username"]="" operation_parameters_collection_type["loginUser:::password"]="" operation_parameters_collection_type["updateUser:::username"]="" -operation_parameters_collection_type["updateUser:::User"]="" +operation_parameters_collection_type["updateUser:::body"]="" ## @@ -527,18 +560,16 @@ build_request_path() { local query_request_part="" - local count=0 for qparam in "${query_params[@]}"; do + if [[ "${operation_parameters[$qparam]}" == "" ]]; then + continue + fi + # Get the array of parameter values local parameter_value="" local parameter_values mapfile -t parameter_values < <(sed -e 's/'":::"'/\n/g' <<<"${operation_parameters[$qparam]}") - if [[ -n "${parameter_values[*]}" ]]; then - if [[ $((count++)) -gt 0 ]]; then - query_request_part+="&" - fi - fi if [[ ${qparam} == "api_key_query" ]]; then if [[ -n "${parameter_values[*]}" ]]; then @@ -617,6 +648,9 @@ build_request_path() { fi if [[ -n "${parameter_value}" ]]; then + if [[ -n "${query_request_part}" ]]; then + query_request_part+="&" + fi query_request_part+="${parameter_value}" fi @@ -687,16 +721,18 @@ EOF echo "" echo -e "${BOLD}${WHITE}[anotherFake]${OFF}" read -r -d '' ops < 10. Other values will generated exceptions" | paste -sd' ' | fold -sw 80 echo -e "" echo -e "${BOLD}${WHITE}Parameters${OFF}" - echo -e " * ${GREEN}order_id${OFF} ${BLUE}[integer]${OFF} ${RED}(required)${OFF}${OFF} - ID of pet that needs to be fetched ${YELLOW}Specify as: order_id=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e " * ${GREEN}order_id${OFF} ${BLUE}[integer]${OFF} ${RED}(required)${OFF} ${CYAN}(default: null)${OFF} - ID of pet that needs to be fetched ${YELLOW}Specify as: order_id=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' echo "" echo -e "${BOLD}${WHITE}Responses${OFF}" code=200 @@ -1331,7 +1456,7 @@ print_deleteUser_help() { echo -e "This can only be done by the logged in user." | paste -sd' ' | fold -sw 80 echo -e "" echo -e "${BOLD}${WHITE}Parameters${OFF}" - echo -e " * ${GREEN}username${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF}${OFF} - The name that needs to be deleted ${YELLOW}Specify as: username=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e " * ${GREEN}username${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF} ${CYAN}(default: null)${OFF} - The name that needs to be deleted ${YELLOW}Specify as: username=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' echo "" echo -e "${BOLD}${WHITE}Responses${OFF}" code=400 @@ -1349,7 +1474,7 @@ print_getUserByName_help() { echo -e "${BOLD}${WHITE}getUserByName - Get user by user name${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' echo -e "" echo -e "${BOLD}${WHITE}Parameters${OFF}" - echo -e " * ${GREEN}username${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF}${OFF} - The name that needs to be fetched. Use user1 for testing. ${YELLOW}Specify as: username=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e " * ${GREEN}username${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF} ${CYAN}(default: null)${OFF} - The name that needs to be fetched. Use user1 for testing. ${YELLOW}Specify as: username=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' echo "" echo -e "${BOLD}${WHITE}Responses${OFF}" code=200 @@ -1369,9 +1494,9 @@ print_loginUser_help() { echo -e "${BOLD}${WHITE}loginUser - Logs user into the system${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' echo -e "" echo -e "${BOLD}${WHITE}Parameters${OFF}" - echo -e " * ${GREEN}username${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF}${OFF} - The user name for login${YELLOW} Specify as: username=value${OFF}" \ + echo -e " * ${GREEN}username${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF} ${CYAN}(default: null)${OFF} - The user name for login${YELLOW} Specify as: username=value${OFF}" \ | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo -e " * ${GREEN}password${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF}${OFF} - The password for login in clear text${YELLOW} Specify as: password=value${OFF}" \ + echo -e " * ${GREEN}password${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF} ${CYAN}(default: null)${OFF} - The password for login in clear text${YELLOW} Specify as: password=value${OFF}" \ | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' echo "" echo -e "${BOLD}${WHITE}Responses${OFF}" @@ -1409,7 +1534,7 @@ print_updateUser_help() { echo -e "This can only be done by the logged in user." | paste -sd' ' | fold -sw 80 echo -e "" echo -e "${BOLD}${WHITE}Parameters${OFF}" - echo -e " * ${GREEN}username${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF}${OFF} - name that need to be deleted ${YELLOW}Specify as: username=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' + echo -e " * ${GREEN}username${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF} ${CYAN}(default: null)${OFF} - name that need to be deleted ${YELLOW}Specify as: username=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' echo -e " * ${GREEN}body${OFF} ${BLUE}[]${OFF} ${RED}(required)${OFF}${OFF} - Updated user object" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' echo -e "" echo "" @@ -1423,10 +1548,10 @@ print_updateUser_help() { ############################################################################## # -# Call testSpecialTags operation +# Call 123Test@$%SpecialTags operation # ############################################################################## -call_testSpecialTags() { +call_123Test@$%SpecialTags() { # ignore error about 'path_parameter_names' being unused; passed by reference # shellcheck disable=SC2034 local path_parameter_names=() @@ -1499,6 +1624,86 @@ call_testSpecialTags() { fi } +############################################################################## +# +# Call createXmlItem operation +# +############################################################################## +call_createXmlItem() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=() + local path + + if ! path=$(build_request_path "/v2/fake/create_xml_item" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="POST" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + local body_json_curl="" + + # + # Check if the user provided 'Content-type' headers in the + # command line. If not try to set them based on the OpenAPI specification + # if values produces and consumes are defined unambigously + # + + + if [[ -z $header_content_type && "$force" = false ]]; then + : + echo "ERROR: Request's content-type not specified!!!" + echo "This operation expects content-type in one of the following formats:" + echo -e "\\t- application/xml" + echo -e "\\t- application/xml; charset=utf-8" + echo -e "\\t- application/xml; charset=utf-16" + echo -e "\\t- text/xml" + echo -e "\\t- text/xml; charset=utf-8" + echo -e "\\t- text/xml; charset=utf-16" + echo "" + echo "Use '--content-type' to set proper content type" + exit 1 + else + headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" + fi + + + # + # If we have received some body content over pipe, pass it from the + # temporary file to cURL + # + if [[ -n $body_content_temp_file ]]; then + if [[ "$print_curl" = true ]]; then + echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + else + eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + fi + rm "${body_content_temp_file}" + # + # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE + # + else + body_json_curl=$(body_parameters_to_json) + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + fi + fi +} + ############################################################################## # # Call fakeOuterBooleanSerialize operation @@ -1775,6 +1980,84 @@ call_fakeOuterStringSerialize() { fi } +############################################################################## +# +# Call testBodyWithFileSchema operation +# +############################################################################## +call_testBodyWithFileSchema() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=() + local path + + if ! path=$(build_request_path "/v2/fake/body-with-file-schema" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="PUT" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + local body_json_curl="" + + # + # Check if the user provided 'Content-type' headers in the + # command line. If not try to set them based on the OpenAPI specification + # if values produces and consumes are defined unambigously + # + if [[ -z $header_content_type ]]; then + header_content_type="application/json" + fi + + + if [[ -z $header_content_type && "$force" = false ]]; then + : + echo "ERROR: Request's content-type not specified!!!" + echo "This operation expects content-type in one of the following formats:" + echo -e "\\t- application/json" + echo "" + echo "Use '--content-type' to set proper content type" + exit 1 + else + headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" + fi + + + # + # If we have received some body content over pipe, pass it from the + # temporary file to cURL + # + if [[ -n $body_content_temp_file ]]; then + if [[ "$print_curl" = true ]]; then + echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + else + eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" + fi + rm "${body_content_temp_file}" + # + # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE + # + else + body_json_curl=$(body_parameters_to_json) + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" + fi + fi +} + ############################################################################## # # Call testBodyWithQueryParams operation @@ -2003,6 +2286,42 @@ call_testEnumParameters() { fi } +############################################################################## +# +# Call testGroupParameters operation +# +############################################################################## +call_testGroupParameters() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=() + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=(required_string_group required_int64_group string_group int64_group) + local path + + if ! path=$(build_request_path "/v2/fake" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="DELETE" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + fi +} + ############################################################################## # # Call testInlineAdditionalProperties operation @@ -2563,6 +2882,42 @@ call_uploadFile() { fi } +############################################################################## +# +# Call uploadFileWithRequiredFile operation +# +############################################################################## +call_uploadFileWithRequiredFile() { + # ignore error about 'path_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local path_parameter_names=(petId) + # ignore error about 'query_parameter_names' being unused; passed by reference + # shellcheck disable=SC2034 + local query_parameter_names=( ) + local path + + if ! path=$(build_request_path "/v2/fake/{petId}/uploadImageWithRequiredFile" path_parameter_names query_parameter_names); then + ERROR_MSG=$path + exit 1 + fi + local method="POST" + local headers_curl + headers_curl=$(header_arguments_to_curl) + if [[ -n $header_accept ]]; then + headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" + fi + + local basic_auth_option="" + if [[ -n $basic_auth_credential ]]; then + basic_auth_option="-u ${basic_auth_credential}" + fi + if [[ "$print_curl" = true ]]; then + echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + else + eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" + fi +} + ############################################################################## # # Call deleteOrder operation @@ -3257,8 +3612,11 @@ case $key in OFF="" result_color_table=( "" "" "" "" "" "" "" ) ;; - testSpecialTags) - operation="testSpecialTags" + 123Test@$%SpecialTags) + operation="123Test@$%SpecialTags" + ;; + createXmlItem) + operation="createXmlItem" ;; fakeOuterBooleanSerialize) operation="fakeOuterBooleanSerialize" @@ -3272,6 +3630,9 @@ case $key in fakeOuterStringSerialize) operation="fakeOuterStringSerialize" ;; + testBodyWithFileSchema) + operation="testBodyWithFileSchema" + ;; testBodyWithQueryParams) operation="testBodyWithQueryParams" ;; @@ -3284,6 +3645,9 @@ case $key in testEnumParameters) operation="testEnumParameters" ;; + testGroupParameters) + operation="testGroupParameters" + ;; testInlineAdditionalProperties) operation="testInlineAdditionalProperties" ;; @@ -3317,6 +3681,9 @@ case $key in uploadFile) operation="uploadFile" ;; + uploadFileWithRequiredFile) + operation="uploadFileWithRequiredFile" + ;; deleteOrder) operation="deleteOrder" ;; @@ -3437,8 +3804,11 @@ fi # Run cURL command based on the operation ID case $operation in - testSpecialTags) - call_testSpecialTags + 123Test@$%SpecialTags) + call_123Test@$%SpecialTags + ;; + createXmlItem) + call_createXmlItem ;; fakeOuterBooleanSerialize) call_fakeOuterBooleanSerialize @@ -3452,6 +3822,9 @@ case $operation in fakeOuterStringSerialize) call_fakeOuterStringSerialize ;; + testBodyWithFileSchema) + call_testBodyWithFileSchema + ;; testBodyWithQueryParams) call_testBodyWithQueryParams ;; @@ -3464,6 +3837,9 @@ case $operation in testEnumParameters) call_testEnumParameters ;; + testGroupParameters) + call_testGroupParameters + ;; testInlineAdditionalProperties) call_testInlineAdditionalProperties ;; @@ -3497,6 +3873,9 @@ case $operation in uploadFile) call_uploadFile ;; + uploadFileWithRequiredFile) + call_uploadFileWithRequiredFile + ;; deleteOrder) call_deleteOrder ;; diff --git a/samples/client/petstore/bash/petstore-cli.bash-completion b/samples/client/petstore/bash/petstore-cli.bash-completion index 872c13b683c..d65b8a8efff 100644 --- a/samples/client/petstore/bash/petstore-cli.bash-completion +++ b/samples/client/petstore/bash/petstore-cli.bash-completion @@ -68,15 +68,18 @@ _petstore-cli() # The list of available operation in the REST service # It's modelled as an associative array for efficient key lookup declare -A operations - operations["testSpecialTags"]=1 + operations["123Test@$%SpecialTags"]=1 + operations["createXmlItem"]=1 operations["fakeOuterBooleanSerialize"]=1 operations["fakeOuterCompositeSerialize"]=1 operations["fakeOuterNumberSerialize"]=1 operations["fakeOuterStringSerialize"]=1 + operations["testBodyWithFileSchema"]=1 operations["testBodyWithQueryParams"]=1 operations["testClientModel"]=1 operations["testEndpointParameters"]=1 operations["testEnumParameters"]=1 + operations["testGroupParameters"]=1 operations["testInlineAdditionalProperties"]=1 operations["testJsonFormData"]=1 operations["testClassname"]=1 @@ -88,6 +91,7 @@ _petstore-cli() operations["updatePet"]=1 operations["updatePetWithForm"]=1 operations["uploadFile"]=1 + operations["uploadFileWithRequiredFile"]=1 operations["deleteOrder"]=1 operations["getInventory"]=1 operations["getOrderById"]=1 @@ -104,15 +108,18 @@ _petstore-cli() # An associative array of operations to their parameters # Only include path, query and header parameters declare -A operation_parameters - operation_parameters["testSpecialTags"]="" + operation_parameters["123Test@$%SpecialTags"]="" + operation_parameters["createXmlItem"]="" operation_parameters["fakeOuterBooleanSerialize"]="" operation_parameters["fakeOuterCompositeSerialize"]="" operation_parameters["fakeOuterNumberSerialize"]="" operation_parameters["fakeOuterStringSerialize"]="" + operation_parameters["testBodyWithFileSchema"]="" operation_parameters["testBodyWithQueryParams"]="query= " operation_parameters["testClientModel"]="" operation_parameters["testEndpointParameters"]="" operation_parameters["testEnumParameters"]="enum_query_string_array= enum_query_string= enum_query_integer= enum_query_double= enum_header_string_array: enum_header_string: " + operation_parameters["testGroupParameters"]="required_string_group= required_int64_group= string_group= int64_group= required_boolean_group: boolean_group: " operation_parameters["testInlineAdditionalProperties"]="" operation_parameters["testJsonFormData"]="" operation_parameters["testClassname"]="" @@ -124,6 +131,7 @@ _petstore-cli() operation_parameters["updatePet"]="" operation_parameters["updatePetWithForm"]="petId= " operation_parameters["uploadFile"]="petId= " + operation_parameters["uploadFileWithRequiredFile"]="petId= " operation_parameters["deleteOrder"]="order_id= " operation_parameters["getInventory"]="" operation_parameters["getOrderById"]="order_id= " @@ -139,6 +147,18 @@ _petstore-cli() # An associative array of possible values for enum parameters declare -A operation_parameters_enum_values + operation_parameters_enum_values["testGroupParameters::required_boolean_group"]="true false" + operation_parameters_enum_values["testGroupParameters::boolean_group"]="true false" + operation_parameters_enum_values["testGroupParameters::required_boolean_group"]="true false" + operation_parameters_enum_values["testGroupParameters::boolean_group"]="true false" + operation_parameters_enum_values["testGroupParameters::required_boolean_group"]="true false" + operation_parameters_enum_values["testGroupParameters::boolean_group"]="true false" + operation_parameters_enum_values["testGroupParameters::required_boolean_group"]="true false" + operation_parameters_enum_values["testGroupParameters::boolean_group"]="true false" + operation_parameters_enum_values["testGroupParameters::required_boolean_group"]="true false" + operation_parameters_enum_values["testGroupParameters::boolean_group"]="true false" + operation_parameters_enum_values["testGroupParameters::required_boolean_group"]="true false" + operation_parameters_enum_values["testGroupParameters::boolean_group"]="true false" # # Check if this is OSX and use special __osx_init_completion function From b9e863a9ca538a980a385cb4e1af93cdb4872a6f Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 27 Jul 2019 22:49:01 +0800 Subject: [PATCH 02/75] Add bbdouglas as the template creator of Java (Java 11 Native HTTP client) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e56010617bf..0aaf86e953b 100644 --- a/README.md +++ b/README.md @@ -673,6 +673,7 @@ Here is a list of template creators: * Java (Vertx): @lopesmcc * Java (Google APIs Client Library): @charlescapps * Java (Rest-assured): @viclovsky + * Java (Java 11 Native HTTP client): @bbdouglas * Javascript/NodeJS: @jfiala * Javascript (Closure-annotated Angular) @achew22 * Javascript (Flow types) @jaypea From 049f69c55b5e0ac899407dc7f780cd078193562b Mon Sep 17 00:00:00 2001 From: Guillaume SMAHA Date: Sat, 27 Jul 2019 22:40:10 -0400 Subject: [PATCH 03/75] Use range for dependencies in python-flask (#3470) --- .../python-flask/requirements.mustache | 8 +++---- .../.openapi-generator/VERSION | 2 +- .../test/test_user_controller.py | 22 +++++++++++++++++-- .../python-flask-python2/requirements.txt | 8 +++---- .../python-flask/.openapi-generator/VERSION | 2 +- .../test/test_user_controller.py | 22 +++++++++++++++++-- .../petstore/python-flask/requirements.txt | 6 ++--- .../.openapi-generator/VERSION | 2 +- .../test/test_user_controller.py | 4 ++-- .../python-flask-python2/requirements.txt | 8 +++---- .../python-flask/.openapi-generator/VERSION | 2 +- .../test/test_user_controller.py | 4 ++-- .../petstore/python-flask/requirements.txt | 6 ++--- 13 files changed, 66 insertions(+), 30 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python-flask/requirements.mustache b/modules/openapi-generator/src/main/resources/python-flask/requirements.mustache index 8d4d653bfd7..b5a702d5de8 100644 --- a/modules/openapi-generator/src/main/resources/python-flask/requirements.mustache +++ b/modules/openapi-generator/src/main/resources/python-flask/requirements.mustache @@ -1,7 +1,7 @@ -connexion == 2.0.2 -swagger-ui-bundle == 0.0.2 -python_dateutil == 2.6.0 +connexion >= 2.0.2 +swagger-ui-bundle >= 0.0.2 +python_dateutil >= 2.6.0 {{#supportPython2}} -typing == 3.5.2.2 +typing >= 3.5.2.2 {{/supportPython2}} setuptools >= 21.0.0 diff --git a/samples/openapi3/server/petstore/python-flask-python2/.openapi-generator/VERSION b/samples/openapi3/server/petstore/python-flask-python2/.openapi-generator/VERSION index 0c89fc927e3..83a328a9227 100644 --- a/samples/openapi3/server/petstore/python-flask-python2/.openapi-generator/VERSION +++ b/samples/openapi3/server/petstore/python-flask-python2/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0 \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/python-flask-python2/openapi_server/test/test_user_controller.py b/samples/openapi3/server/petstore/python-flask-python2/openapi_server/test/test_user_controller.py index 0675b6d294e..8f634b7cd6b 100644 --- a/samples/openapi3/server/petstore/python-flask-python2/openapi_server/test/test_user_controller.py +++ b/samples/openapi3/server/petstore/python-flask-python2/openapi_server/test/test_user_controller.py @@ -46,7 +46,16 @@ class TestUserController(BaseTestCase): Creates list of users with given input array """ - user = [] + user = { + "firstName" : "firstName", + "lastName" : "lastName", + "password" : "password", + "userStatus" : 6, + "phone" : "phone", + "id" : 0, + "email" : "email", + "username" : "username" +} headers = { 'Content-Type': 'application/json', 'auth_cookie': 'special-key', @@ -65,7 +74,16 @@ class TestUserController(BaseTestCase): Creates list of users with given input array """ - user = [] + user = { + "firstName" : "firstName", + "lastName" : "lastName", + "password" : "password", + "userStatus" : 6, + "phone" : "phone", + "id" : 0, + "email" : "email", + "username" : "username" +} headers = { 'Content-Type': 'application/json', 'auth_cookie': 'special-key', diff --git a/samples/openapi3/server/petstore/python-flask-python2/requirements.txt b/samples/openapi3/server/petstore/python-flask-python2/requirements.txt index de4b8821af6..bc535706622 100644 --- a/samples/openapi3/server/petstore/python-flask-python2/requirements.txt +++ b/samples/openapi3/server/petstore/python-flask-python2/requirements.txt @@ -1,5 +1,5 @@ -connexion == 2.0.2 -swagger-ui-bundle == 0.0.2 -python_dateutil == 2.6.0 -typing == 3.5.2.2 +connexion >= 2.0.2 +swagger-ui-bundle >= 0.0.2 +python_dateutil >= 2.6.0 +typing >= 3.5.2.2 setuptools >= 21.0.0 diff --git a/samples/openapi3/server/petstore/python-flask/.openapi-generator/VERSION b/samples/openapi3/server/petstore/python-flask/.openapi-generator/VERSION index 0c89fc927e3..83a328a9227 100644 --- a/samples/openapi3/server/petstore/python-flask/.openapi-generator/VERSION +++ b/samples/openapi3/server/petstore/python-flask/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0 \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/python-flask/openapi_server/test/test_user_controller.py b/samples/openapi3/server/petstore/python-flask/openapi_server/test/test_user_controller.py index 0675b6d294e..8f634b7cd6b 100644 --- a/samples/openapi3/server/petstore/python-flask/openapi_server/test/test_user_controller.py +++ b/samples/openapi3/server/petstore/python-flask/openapi_server/test/test_user_controller.py @@ -46,7 +46,16 @@ class TestUserController(BaseTestCase): Creates list of users with given input array """ - user = [] + user = { + "firstName" : "firstName", + "lastName" : "lastName", + "password" : "password", + "userStatus" : 6, + "phone" : "phone", + "id" : 0, + "email" : "email", + "username" : "username" +} headers = { 'Content-Type': 'application/json', 'auth_cookie': 'special-key', @@ -65,7 +74,16 @@ class TestUserController(BaseTestCase): Creates list of users with given input array """ - user = [] + user = { + "firstName" : "firstName", + "lastName" : "lastName", + "password" : "password", + "userStatus" : 6, + "phone" : "phone", + "id" : 0, + "email" : "email", + "username" : "username" +} headers = { 'Content-Type': 'application/json', 'auth_cookie': 'special-key', diff --git a/samples/openapi3/server/petstore/python-flask/requirements.txt b/samples/openapi3/server/petstore/python-flask/requirements.txt index 66ecf7c2685..1a01b580490 100644 --- a/samples/openapi3/server/petstore/python-flask/requirements.txt +++ b/samples/openapi3/server/petstore/python-flask/requirements.txt @@ -1,4 +1,4 @@ -connexion == 2.0.2 -swagger-ui-bundle == 0.0.2 -python_dateutil == 2.6.0 +connexion >= 2.0.2 +swagger-ui-bundle >= 0.0.2 +python_dateutil >= 2.6.0 setuptools >= 21.0.0 diff --git a/samples/server/petstore/python-flask-python2/.openapi-generator/VERSION b/samples/server/petstore/python-flask-python2/.openapi-generator/VERSION index 0c89fc927e3..83a328a9227 100644 --- a/samples/server/petstore/python-flask-python2/.openapi-generator/VERSION +++ b/samples/server/petstore/python-flask-python2/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0 \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/python-flask-python2/openapi_server/test/test_user_controller.py b/samples/server/petstore/python-flask-python2/openapi_server/test/test_user_controller.py index 78cce39287e..172ff22d13d 100644 --- a/samples/server/petstore/python-flask-python2/openapi_server/test/test_user_controller.py +++ b/samples/server/petstore/python-flask-python2/openapi_server/test/test_user_controller.py @@ -38,7 +38,7 @@ class TestUserController(BaseTestCase): Creates list of users with given input array """ - body = [] + body = [{}] headers = { 'Content-Type': 'application/json', } @@ -57,7 +57,7 @@ class TestUserController(BaseTestCase): Creates list of users with given input array """ - body = [] + body = [{}] headers = { 'Content-Type': 'application/json', } diff --git a/samples/server/petstore/python-flask-python2/requirements.txt b/samples/server/petstore/python-flask-python2/requirements.txt index de4b8821af6..bc535706622 100644 --- a/samples/server/petstore/python-flask-python2/requirements.txt +++ b/samples/server/petstore/python-flask-python2/requirements.txt @@ -1,5 +1,5 @@ -connexion == 2.0.2 -swagger-ui-bundle == 0.0.2 -python_dateutil == 2.6.0 -typing == 3.5.2.2 +connexion >= 2.0.2 +swagger-ui-bundle >= 0.0.2 +python_dateutil >= 2.6.0 +typing >= 3.5.2.2 setuptools >= 21.0.0 diff --git a/samples/server/petstore/python-flask/.openapi-generator/VERSION b/samples/server/petstore/python-flask/.openapi-generator/VERSION index 0c89fc927e3..83a328a9227 100644 --- a/samples/server/petstore/python-flask/.openapi-generator/VERSION +++ b/samples/server/petstore/python-flask/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0 \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/python-flask/openapi_server/test/test_user_controller.py b/samples/server/petstore/python-flask/openapi_server/test/test_user_controller.py index 78cce39287e..172ff22d13d 100644 --- a/samples/server/petstore/python-flask/openapi_server/test/test_user_controller.py +++ b/samples/server/petstore/python-flask/openapi_server/test/test_user_controller.py @@ -38,7 +38,7 @@ class TestUserController(BaseTestCase): Creates list of users with given input array """ - body = [] + body = [{}] headers = { 'Content-Type': 'application/json', } @@ -57,7 +57,7 @@ class TestUserController(BaseTestCase): Creates list of users with given input array """ - body = [] + body = [{}] headers = { 'Content-Type': 'application/json', } diff --git a/samples/server/petstore/python-flask/requirements.txt b/samples/server/petstore/python-flask/requirements.txt index 66ecf7c2685..1a01b580490 100644 --- a/samples/server/petstore/python-flask/requirements.txt +++ b/samples/server/petstore/python-flask/requirements.txt @@ -1,4 +1,4 @@ -connexion == 2.0.2 -swagger-ui-bundle == 0.0.2 -python_dateutil == 2.6.0 +connexion >= 2.0.2 +swagger-ui-bundle >= 0.0.2 +python_dateutil >= 2.6.0 setuptools >= 21.0.0 From 1713c7610d6a55a39e81d3c43c99537632efcad6 Mon Sep 17 00:00:00 2001 From: cgensoul <53224246+cgensoul@users.noreply.github.com> Date: Sun, 28 Jul 2019 15:50:53 +0200 Subject: [PATCH 04/75] [OCaml] new client generator (#3446) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Début d'un générateur pour OCaml. * Ajout du script bash de generation pour OCaml. * Implémentation de la partie model du générateur OCaml. * Suppression du fichier Model.mustache. * Légère modification dans le générateur OCaml. * Début d'implémentation de la génération des opérations. * Avancées dans l'implémenatation des opérations. * Avancée dans la gestion des enums : reste à traiter le fait que Yojson sérialize les variants comme des tableaux JSON. * Prise en compte du fait que Yojson représente les variants constants sous forme d'un tableau JSON contenant une unique string. * Utilisation des variants polymorphe pour les enums car il se peut que plusieurs énumérations partagent des valeurs communes ce que ne permettent pas les variants ordinaires au sein d'un même module. * Avancées dans le générateur de code OCaml : le code produit compile et prendre en compte les pathParams, les queryParams, les headersParams, les bodyParams et la réponse JSON. Manque le support du multipart, du form encoded et des mécanismes d'authentification. * More tests. * Correction de problèmes dans la génération mis en évidence par l'utilisation d'un fichier OAS plus gros et complexe que Petstore. * Mapping du case Error de Ppx_deriving_yojson_runtime.ok_error vers l'exception Failure pour avoir des types plus simples et non dépendants de Pppx_deriving_yoson_runtime dans les APIs générées. * Ajout de la génération des fichiers d'interfaces .mli pour les APIs. * Ajout du support des parametres de type x-www-form-urlencoded. * Le paramètres d'url de type number étaient mal gérés. * Cleanup. * Replace block comment start and end sequences in input text. * Make apis calls without a return type return unit rather than Yojson.Safe.t. * Make modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml generate properly. * Added generated code for modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml. * Better handling of enums and map container and better sanitizing of generated identifiers to support all the corner cases present in modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml. * Correcting a violation : using toLowerCase without relying on the default Locale. * Changed authoring in partial_header.mustache. * Deleted commented code. * Collect enum schemas in items properties of operation parameters in the case of ArraySchema parameters. This allows correct processing of modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml. * Collect enums also in additional properties schemas of operation parameters in the case of MapSchema parameters (if this type of parameter can is allowed). * Removed copy-pasted Copyright notice from SmartBear. * update doc * Use Locale.ROOT instead of Locale.ENGLISH for toLowerCase calls. * Make GET operations with body generate compilable code. * Updated ocaml-client generated samples using the latest version of the OCaml code generator. * Added [@default None] for record fields with option types so that if those fields are missing at deserialization time, None is assumed. * Added support of api keys in query params. * Updated generated ocaml samples to reflect latest changes in templates. * Added [@default] on enum record fields for which the enum type has only one accepted value so that those fields can be deserialized even if the value is absent of the json payload. * Delete useless space character in template. * Added proper handling of http response codes. * Updated generated ocaml samples to reflect latest changes in templates. --- bin/ocaml-client-petstore.sh | 34 + bin/openapi3/ocaml-client-petstore.sh | 34 + docs/generators.md | 1 + docs/generators/ocaml-client.md | 13 + .../codegen/languages/OCamlClientCodegen.java | 728 ++++++++++++++++++ .../org.openapitools.codegen.CodegenConfig | 1 + .../resources/ocaml-client/api-impl.mustache | 30 + .../resources/ocaml-client/api-intf.mustache | 15 + .../ocaml-client/dune-project.mustache | 2 + .../main/resources/ocaml-client/dune.mustache | 9 + .../resources/ocaml-client/enums.mustache | 25 + .../main/resources/ocaml-client/json.mustache | 55 ++ .../main/resources/ocaml-client/lib.mustache | 15 + .../resources/ocaml-client/model.mustache | 38 + .../resources/ocaml-client/of_json.mustache | 1 + .../ocaml-client/partial_header.mustache | 5 + .../resources/ocaml-client/support.mustache | 48 ++ .../resources/ocaml-client/to_json.mustache | 1 + .../resources/ocaml-client/to_string.mustache | 1 + .../ocaml-client/.openapi-generator-ignore | 23 + .../ocaml-client/.openapi-generator/VERSION | 1 + samples/client/petstore/ocaml-client/bin/dune | 6 + .../client/petstore/ocaml-client/bin/test.ml | 19 + samples/client/petstore/ocaml-client/dune | 9 + .../client/petstore/ocaml-client/dune-project | 2 + .../ocaml-client/petstore_client.opam | 15 + .../petstore/ocaml-client/src/apis/pet_api.ml | 80 ++ .../ocaml-client/src/apis/pet_api.mli | 15 + .../ocaml-client/src/apis/store_api.ml | 38 + .../ocaml-client/src/apis/store_api.mli | 11 + .../ocaml-client/src/apis/user_api.ml | 72 ++ .../ocaml-client/src/apis/user_api.mli | 15 + .../ocaml-client/src/models/api_response.ml | 21 + .../ocaml-client/src/models/category.ml | 19 + .../petstore/ocaml-client/src/models/order.ml | 28 + .../petstore/ocaml-client/src/models/pet.ml | 28 + .../petstore/ocaml-client/src/models/tag.ml | 19 + .../petstore/ocaml-client/src/models/user.ml | 32 + .../ocaml-client/src/support/enums.ml | 30 + .../ocaml-client/src/support/jsonSupport.ml | 55 ++ .../ocaml-client/src/support/request.ml | 48 ++ .../ocaml-client/.openapi-generator-ignore | 23 + .../ocaml-client/.openapi-generator/VERSION | 1 + .../client/petstore/ocaml-client/dune | 9 + .../client/petstore/ocaml-client/dune-project | 2 + .../ocaml-client/petstore_client.opam | 15 + .../ocaml-client/src/apis/another_fake_api.ml | 15 + .../src/apis/another_fake_api.mli | 8 + .../ocaml-client/src/apis/default_api.ml | 14 + .../ocaml-client/src/apis/default_api.mli | 8 + .../ocaml-client/src/apis/fake_api.ml | 136 ++++ .../ocaml-client/src/apis/fake_api.mli | 20 + .../src/apis/fake_classname_tags123_api.ml | 15 + .../src/apis/fake_classname_tags123_api.mli | 8 + .../petstore/ocaml-client/src/apis/pet_api.ml | 88 +++ .../ocaml-client/src/apis/pet_api.mli | 16 + .../ocaml-client/src/apis/store_api.ml | 37 + .../ocaml-client/src/apis/store_api.mli | 11 + .../ocaml-client/src/apis/user_api.ml | 66 ++ .../ocaml-client/src/apis/user_api.mli | 15 + .../src/models/additional_properties_class.ml | 17 + .../ocaml-client/src/models/animal.ml | 17 + .../ocaml-client/src/models/api_response.ml | 19 + .../models/array_of_array_of_number_only.ml | 15 + .../src/models/array_of_number_only.ml | 15 + .../ocaml-client/src/models/array_test.ml | 19 + .../ocaml-client/src/models/capitalization.ml | 26 + .../petstore/ocaml-client/src/models/cat.ml | 19 + .../ocaml-client/src/models/cat_all_of.ml | 15 + .../ocaml-client/src/models/category.ml | 17 + .../ocaml-client/src/models/class_model.ml | 17 + .../ocaml-client/src/models/client.ml | 15 + .../petstore/ocaml-client/src/models/dog.ml | 19 + .../ocaml-client/src/models/dog_all_of.ml | 15 + .../ocaml-client/src/models/enum_arrays.ml | 17 + .../ocaml-client/src/models/enum_test.ml | 29 + .../petstore/ocaml-client/src/models/file.ml | 18 + .../src/models/file_schema_test_class.ml | 17 + .../petstore/ocaml-client/src/models/foo.ml | 15 + .../ocaml-client/src/models/format_test.ml | 45 ++ .../src/models/has_only_read_only.ml | 17 + .../src/models/health_check_result.ml | 17 + .../ocaml-client/src/models/inline_object.ml | 19 + .../src/models/inline_object_1.ml | 19 + .../src/models/inline_object_2.ml | 19 + .../src/models/inline_object_3.ml | 55 ++ .../src/models/inline_object_4.ml | 19 + .../src/models/inline_object_5.ml | 19 + .../src/models/inline_response_default.ml | 15 + .../ocaml-client/src/models/map_test.ml | 21 + ...perties_and_additional_properties_class.ml | 19 + .../src/models/model_200_response.ml | 19 + .../src/models/model__special_model_name_.ml | 15 + .../petstore/ocaml-client/src/models/name.ml | 23 + .../ocaml-client/src/models/nullable_class.ml | 37 + .../ocaml-client/src/models/number_only.ml | 15 + .../petstore/ocaml-client/src/models/order.ml | 26 + .../src/models/outer_composite.ml | 19 + .../petstore/ocaml-client/src/models/pet.ml | 26 + .../src/models/read_only_first.ml | 17 + .../ocaml-client/src/models/return.ml | 17 + .../petstore/ocaml-client/src/models/tag.ml | 17 + .../petstore/ocaml-client/src/models/user.ml | 30 + .../ocaml-client/src/support/enums.ml | 142 ++++ .../ocaml-client/src/support/jsonSupport.ml | 55 ++ .../ocaml-client/src/support/request.ml | 39 + 106 files changed, 3271 insertions(+) create mode 100755 bin/ocaml-client-petstore.sh create mode 100755 bin/openapi3/ocaml-client-petstore.sh create mode 100644 docs/generators/ocaml-client.md create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java create mode 100644 modules/openapi-generator/src/main/resources/ocaml-client/api-impl.mustache create mode 100644 modules/openapi-generator/src/main/resources/ocaml-client/api-intf.mustache create mode 100644 modules/openapi-generator/src/main/resources/ocaml-client/dune-project.mustache create mode 100644 modules/openapi-generator/src/main/resources/ocaml-client/dune.mustache create mode 100644 modules/openapi-generator/src/main/resources/ocaml-client/enums.mustache create mode 100644 modules/openapi-generator/src/main/resources/ocaml-client/json.mustache create mode 100644 modules/openapi-generator/src/main/resources/ocaml-client/lib.mustache create mode 100644 modules/openapi-generator/src/main/resources/ocaml-client/model.mustache create mode 100644 modules/openapi-generator/src/main/resources/ocaml-client/of_json.mustache create mode 100644 modules/openapi-generator/src/main/resources/ocaml-client/partial_header.mustache create mode 100644 modules/openapi-generator/src/main/resources/ocaml-client/support.mustache create mode 100644 modules/openapi-generator/src/main/resources/ocaml-client/to_json.mustache create mode 100644 modules/openapi-generator/src/main/resources/ocaml-client/to_string.mustache create mode 100644 samples/client/petstore/ocaml-client/.openapi-generator-ignore create mode 100644 samples/client/petstore/ocaml-client/.openapi-generator/VERSION create mode 100644 samples/client/petstore/ocaml-client/bin/dune create mode 100644 samples/client/petstore/ocaml-client/bin/test.ml create mode 100644 samples/client/petstore/ocaml-client/dune create mode 100644 samples/client/petstore/ocaml-client/dune-project create mode 100644 samples/client/petstore/ocaml-client/petstore_client.opam create mode 100644 samples/client/petstore/ocaml-client/src/apis/pet_api.ml create mode 100644 samples/client/petstore/ocaml-client/src/apis/pet_api.mli create mode 100644 samples/client/petstore/ocaml-client/src/apis/store_api.ml create mode 100644 samples/client/petstore/ocaml-client/src/apis/store_api.mli create mode 100644 samples/client/petstore/ocaml-client/src/apis/user_api.ml create mode 100644 samples/client/petstore/ocaml-client/src/apis/user_api.mli create mode 100644 samples/client/petstore/ocaml-client/src/models/api_response.ml create mode 100644 samples/client/petstore/ocaml-client/src/models/category.ml create mode 100644 samples/client/petstore/ocaml-client/src/models/order.ml create mode 100644 samples/client/petstore/ocaml-client/src/models/pet.ml create mode 100644 samples/client/petstore/ocaml-client/src/models/tag.ml create mode 100644 samples/client/petstore/ocaml-client/src/models/user.ml create mode 100644 samples/client/petstore/ocaml-client/src/support/enums.ml create mode 100644 samples/client/petstore/ocaml-client/src/support/jsonSupport.ml create mode 100644 samples/client/petstore/ocaml-client/src/support/request.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/ocaml-client/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/ocaml-client/dune create mode 100644 samples/openapi3/client/petstore/ocaml-client/dune-project create mode 100644 samples/openapi3/client/petstore/ocaml-client/petstore_client.opam create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/another_fake_api.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/another_fake_api.mli create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/default_api.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/default_api.mli create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/fake_api.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/fake_api.mli create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/fake_classname_tags123_api.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/fake_classname_tags123_api.mli create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/pet_api.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/pet_api.mli create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/store_api.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/store_api.mli create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/user_api.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/user_api.mli create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/additional_properties_class.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/animal.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/api_response.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/array_of_array_of_number_only.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/array_of_number_only.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/array_test.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/capitalization.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/cat.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/cat_all_of.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/category.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/class_model.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/client.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/dog.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/dog_all_of.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/enum_arrays.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/enum_test.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/file.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/file_schema_test_class.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/foo.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/format_test.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/has_only_read_only.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/health_check_result.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/inline_object.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_1.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_2.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_3.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_4.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_5.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/inline_response_default.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/map_test.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/mixed_properties_and_additional_properties_class.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/model_200_response.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/model__special_model_name_.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/name.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/nullable_class.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/number_only.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/order.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/outer_composite.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/pet.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/read_only_first.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/return.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/tag.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/user.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/support/enums.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/support/jsonSupport.ml create mode 100644 samples/openapi3/client/petstore/ocaml-client/src/support/request.ml diff --git a/bin/ocaml-client-petstore.sh b/bin/ocaml-client-petstore.sh new file mode 100755 index 00000000000..d124ad74b0a --- /dev/null +++ b/bin/ocaml-client-petstore.sh @@ -0,0 +1,34 @@ +#!/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 -B clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DdebugOperations -DloggerPath=conf/log4j.properties" + +args="generate -t modules/openapi-generator/src/main/resources/ocaml-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g ocaml-client -o samples/client/petstore/ocaml-client --additional-properties packageName=petstore_client $@" + +echo "java ${JAVA_OPTS} -jar ${executable} ${args}" +java $JAVA_OPTS -jar $executable $args diff --git a/bin/openapi3/ocaml-client-petstore.sh b/bin/openapi3/ocaml-client-petstore.sh new file mode 100755 index 00000000000..7c9aeb7c55a --- /dev/null +++ b/bin/openapi3/ocaml-client-petstore.sh @@ -0,0 +1,34 @@ +#!/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 -B clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DdebugOperations -DloggerPath=conf/log4j.properties" + +args="generate -t modules/openapi-generator/src/main/resources/ocaml-client -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ocaml-client -o samples/openapi3/client/petstore/ocaml-client/ --additional-properties packageName=petstore_client $@" + +echo "java ${JAVA_OPTS} -jar ${executable} ${args}" +java $JAVA_OPTS -jar $executable $args diff --git a/docs/generators.md b/docs/generators.md index ecb4edfd40c..12c7ecdfedc 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -39,6 +39,7 @@ The following generators are available: - [kotlin](generators/kotlin.md) - [lua](generators/lua.md) - [objc](generators/objc.md) + - [ocaml-client](generators/ocaml-client.md) - [perl](generators/perl.md) - [php](generators/php.md) - [powershell](generators/powershell.md) diff --git a/docs/generators/ocaml-client.md b/docs/generators/ocaml-client.md new file mode 100644 index 00000000000..52874232c1e --- /dev/null +++ b/docs/generators/ocaml-client.md @@ -0,0 +1,13 @@ + +--- +id: generator-opts-client-ocaml-client +title: Config Options for ocaml-client +sidebar_label: ocaml-client +--- + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java new file mode 100644 index 00000000000..5df13a046b1 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java @@ -0,0 +1,728 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.languages; + +import com.google.common.base.Strings; +import io.swagger.v3.oas.models.*; +import io.swagger.v3.oas.models.media.*; +import io.swagger.v3.oas.models.parameters.Parameter; +import io.swagger.v3.oas.models.responses.ApiResponse; +import org.openapitools.codegen.*; +import org.openapitools.codegen.utils.ModelUtils; +import org.openapitools.codegen.utils.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.*; +import java.util.stream.Collectors; + +import static org.apache.commons.lang3.StringUtils.capitalize; +import static org.openapitools.codegen.utils.StringUtils.underscore; + +public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig { + private static final Logger LOGGER = LoggerFactory.getLogger(OCamlClientCodegen.class); + public static final String PACKAGE_NAME = "packageName"; + public static final String PACKAGE_VERSION = "packageVersion"; + + static final String X_MODEL_MODULE = "x-modelModule"; + + public static final String CO_HTTP = "cohttp"; + + protected String packageName = "openapi"; + protected String packageVersion = "1.0.0"; + protected String apiDocPath = "docs/"; + protected String modelDocPath = "docs/"; + protected String apiFolder = "src/apis"; + protected String modelFolder = "src/models"; + + private Map> enumNames = new HashMap<>(); + private Map enumHash = new HashMap<>(); + private Map enumUniqNames; + + public CodegenType getTag() { + return CodegenType.CLIENT; + } + + public String getName() { + return "ocaml-client"; + } + + public String getHelp() { + return "Generates an OCaml client library (beta)."; + } + + public OCamlClientCodegen() { + super(); + outputFolder = "generated-code/ocaml-client"; + modelTemplateFiles.put("model.mustache", ".ml"); + + // default HIDE_GENERATION_TIMESTAMP to true + hideGenerationTimestamp = Boolean.TRUE; + + embeddedTemplateDir = templateDir = "ocaml-client"; + + setReservedWordsLowerCase( + Arrays.asList( + "and", "as", "assert", "asr", "begin", "class", + "constraint", "do", "done", "downto", "else", "end", + "exception", "external", "false", "for ", "fun", "function", + "functor", "if", "in", "include", "inherit", "initializer", + "land", "lazy", "let", "lor", "lsl", "lsr", + "lxor", "match", "method", "mod", "module", "mutable", + "new", "nonrec", "object", "of", "open", "or", + "private", "rec", "sig", "struct", "then", "to", + "true", "try", "type", "val", "virtual", "when", + "while", "with" + ) + ); + + importMapping.remove("File"); + + supportingFiles.add(new SupportingFile("dune.mustache", "", "dune")); + supportingFiles.add(new SupportingFile("dune-project.mustache", "", "dune-project")); + + defaultIncludes = new HashSet<>( + Arrays.asList( + "int", + "int32", + "int64", + "float", + "bool", + "char", + "string", + "list" + ) + ); + + languageSpecificPrimitives = new HashSet<>( + Arrays.asList( + "int", + "int32", + "int64", + "float", + "bool", + "char", + "string", + "bytes", + "list", + "Yojson.Safe.t" + ) + ); + + instantiationTypes.clear(); + + typeMapping.clear(); + typeMapping.put("boolean", "bool"); + typeMapping.put("int", "int32"); + typeMapping.put("long", "int64"); + typeMapping.put("short", "int"); + typeMapping.put("char", "char"); + typeMapping.put("float", "float"); + typeMapping.put("double", "float"); + typeMapping.put("integer", "int32"); + typeMapping.put("number", "float"); + typeMapping.put("date", "string"); + typeMapping.put("object", "Yojson.Safe.t"); + typeMapping.put("any", "Yojson.Safe.t"); + typeMapping.put("file", "string"); + typeMapping.put("ByteArray", "bytes"); + // lib + typeMapping.put("string", "string"); + typeMapping.put("UUID", "string"); + typeMapping.put("URI", "string"); + typeMapping.put("set", "`Set"); + typeMapping.put("passsword", "string"); + typeMapping.put("DateTime", "string"); + +// supportedLibraries.put(CO_HTTP, "HTTP client: CoHttp."); +// +// CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use."); +// libraryOption.setEnum(supportedLibraries); +// // set hyper as the default +// libraryOption.setDefault(CO_HTTP); +// cliOptions.add(libraryOption); +// setLibrary(CO_HTTP); + } + + @Override + public Map postProcessAllModels(Map superobjs) { + List toRemove = new ArrayList<>(); + + for (Map.Entry modelEntry : superobjs.entrySet()) { + Map objs = (Map) modelEntry.getValue(); + // process enum in models + List models = (List) objs.get("models"); + for (Object _mo : models) { + Map mo = (Map) _mo; + CodegenModel cm = (CodegenModel) mo.get("model"); + + // for enum model + if (Boolean.TRUE.equals(cm.isEnum) && cm.allowableValues != null) { + toRemove.add(modelEntry.getKey()); + } else { + enrichPropertiesWithEnumDefaultValues(cm.getAllVars()); + enrichPropertiesWithEnumDefaultValues(cm.getReadOnlyVars()); + enrichPropertiesWithEnumDefaultValues(cm.getReadWriteVars()); + enrichPropertiesWithEnumDefaultValues(cm.getRequiredVars()); + enrichPropertiesWithEnumDefaultValues(cm.getOptionalVars()); + enrichPropertiesWithEnumDefaultValues(cm.getVars()); + enrichPropertiesWithEnumDefaultValues(cm.getParentVars()); + } + } + } + + for (String keyToRemove : toRemove) { + superobjs.remove(keyToRemove); + } + + return superobjs; + + } + + private void enrichPropertiesWithEnumDefaultValues(List properties) { + for (CodegenProperty property : properties) { + if (property.get_enum() != null && property.get_enum().size() == 1) { + String value = property.get_enum().get(0); + property.defaultValue = ocamlizeEnumValue(value); + } + } + } + + @Override + protected void updateDataTypeWithEnumForMap(CodegenProperty property) { + CodegenProperty baseItem = property.items; + while (baseItem != null && (Boolean.TRUE.equals(baseItem.isMapContainer) + || Boolean.TRUE.equals(baseItem.isListContainer))) { + baseItem = baseItem.items; + } + + if (baseItem != null) { + // set default value for variable with inner enum + if (property.defaultValue != null) { + property.defaultValue = property.defaultValue.replace(", " + property.items.baseType, ", " + toEnumName(property.items)); + } + + updateCodegenPropertyEnum(property); + } + } + + @Override + protected void updateDataTypeWithEnumForArray(CodegenProperty property) { + CodegenProperty baseItem = property.items; + while (baseItem != null && (Boolean.TRUE.equals(baseItem.isMapContainer) + || Boolean.TRUE.equals(baseItem.isListContainer))) { + baseItem = baseItem.items; + } + if (baseItem != null) { + // set default value for variable with inner enum + if (property.defaultValue != null) { + property.defaultValue = property.defaultValue.replace(baseItem.baseType, toEnumName(baseItem)); + } + + updateCodegenPropertyEnum(property); + } + } + + @SuppressWarnings("unchecked") + private String hashEnum(Schema schema) { + return ((List) schema.getEnum()).stream().map(String::valueOf).collect(Collectors.joining(",")); + } + + private boolean isEnumSchema(Schema schema) { + return schema != null && schema.getEnum() != null && !schema.getEnum().isEmpty(); + } + + private void collectEnumSchemas(String parentName, String sName, Schema schema) { + if (schema instanceof ArraySchema) { + collectEnumSchemas(parentName, sName, ((ArraySchema)schema).getItems()); + } else if (schema instanceof MapSchema && schema.getAdditionalProperties() instanceof Schema) { + collectEnumSchemas(parentName, sName, (Schema) schema.getAdditionalProperties()); + } else if (isEnumSchema(schema)) { + String h = hashEnum(schema); + if (!enumHash.containsKey(h)) { + enumHash.put(h, schema); + enumNames.computeIfAbsent(h, k -> new ArrayList<>()).add(sName.toLowerCase(Locale.ROOT)); + if (parentName != null) { + enumNames.get(h).add((parentName + "_" + sName).toLowerCase(Locale.ROOT)); + } + } + } + } + + private void collectEnumSchemas(String sName, Schema schema) { + collectEnumSchemas(null, sName, schema); + } + + @SuppressWarnings("unchecked") + private void collectEnumSchemas(String parentName, Map schemas) { + for (String sName : schemas.keySet()) { + Schema schema = schemas.get(sName); + + collectEnumSchemas(parentName, sName, schema); + + if (schema.getProperties() != null) { + String pName = parentName != null ? parentName + "_" + sName : sName; + collectEnumSchemas(pName, schema.getProperties()); + } + + if (schema.getAdditionalProperties() != null && schema.getAdditionalProperties() instanceof Schema) { + String pName = parentName != null ? parentName + "_" + sName : sName; + collectEnumSchemas(pName, (Schema) schema.getAdditionalProperties()); + } + + if (schema instanceof ArraySchema) { + ArraySchema s = (ArraySchema) schema; + if (s.getItems() != null) { + String pName = parentName != null ? parentName + "_" + sName : sName; + collectEnumSchemas(pName, s.getItems()); + } + } + } + } + + private void collectEnumSchemas(Operation operation) { + if (operation != null) { + if (operation.getParameters() != null) { + for (Parameter parameter : operation.getParameters()) { + collectEnumSchemas(parameter.getName(), parameter.getSchema()); + } + } + if (operation.getRequestBody() != null && operation.getRequestBody().getContent() != null) { + Content content = operation.getRequestBody().getContent(); + for (String p : content.keySet()) { + collectEnumSchemas(p, content.get(p).getSchema()); + } + } + if (operation.getResponses() != null) { + for (String s : operation.getResponses().keySet()) { + ApiResponse apiResponse = operation.getResponses().get(s); + if (apiResponse.getContent() != null) { + Content content = apiResponse.getContent(); + for (String p : content.keySet()) { + collectEnumSchemas(p, content.get(p).getSchema()); + } + } + } + } + } + } + + private String sanitizeOCamlTypeName(String name) { + String typeName = name.replace("-", "_").replace(" ", "_").trim(); + int i = 0; + char c; + while (i < typeName.length() && (Character.isDigit(c = typeName.charAt(i)) || c == '_')) { + i++; + } + + return typeName.substring(i); + } + + private void computeEnumUniqNames() { + Map definitiveNames = new HashMap<>(); + for (String h : enumNames.keySet()) { + boolean hasDefName = false; + List nameCandidates = enumNames.get(h); + for (String name : nameCandidates) { + String candidate = sanitizeOCamlTypeName(name); + if (!definitiveNames.containsKey(candidate) && !reservedWords.contains(candidate)) { + definitiveNames.put(candidate, h); + hasDefName = true; + break; + } + } + if (!hasDefName) { + int i = 0; + String candidate;; + while (definitiveNames.containsKey(candidate = sanitizeOCamlTypeName(nameCandidates.get(0) + "_" + i))) { + i++; + } + definitiveNames.put(candidate, h); + } + } + + enumUniqNames = definitiveNames.entrySet().stream().collect(Collectors.toMap(Map.Entry::getValue, Map.Entry::getKey)); + } + + private void collectEnumSchemas(OpenAPI openAPI) { + Components components = openAPI.getComponents(); + if (components != null && components.getSchemas() != null && !components.getSchemas().isEmpty()) { + collectEnumSchemas(null, components.getSchemas()); + } + + Paths paths = openAPI.getPaths(); + if (paths != null && !paths.isEmpty()) { + for (String path : paths.keySet()) { + PathItem item = paths.get(path); + collectEnumSchemas(item.getGet()); + collectEnumSchemas(item.getPost()); + collectEnumSchemas(item.getPut()); + collectEnumSchemas(item.getDelete()); + collectEnumSchemas(item.getPatch()); + collectEnumSchemas(item.getOptions()); + collectEnumSchemas(item.getHead()); + collectEnumSchemas(item.getTrace()); + } + } + + computeEnumUniqNames(); + } + + @Override + public void preprocessOpenAPI(OpenAPI openAPI) { + collectEnumSchemas(openAPI); + + supportingFiles.add(new SupportingFile("lib.mustache", "", packageName + ".opam")); + supportingFiles.add(new SupportingFile("support.mustache", "src/support", "request.ml")); + supportingFiles.add(new SupportingFile("json.mustache", "src/support", "jsonSupport.ml")); + supportingFiles.add(new SupportingFile("enums.mustache", "src/support", "enums.ml")); + } + + @Override + public void processOpts() { + super.processOpts(); + + if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) { + setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME)); + } else { + setPackageName("openapi"); + } + + if (additionalProperties.containsKey(CodegenConstants.PACKAGE_VERSION)) { + setPackageVersion((String) additionalProperties.get(CodegenConstants.PACKAGE_VERSION)); + } else { + setPackageVersion("1.0.0"); + } + + additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName); + additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion); + + additionalProperties.put("apiDocPath", apiDocPath); + additionalProperties.put("modelDocPath", modelDocPath); + + apiTemplateFiles.put("api-impl.mustache", ".ml"); + apiTemplateFiles.put("api-intf.mustache", ".mli"); + + modelPackage = packageName; + apiPackage = packageName; + } + + @Override + public String escapeReservedWord(String name) { + if (this.reservedWordsMappings().containsKey(name)) { + return this.reservedWordsMappings().get(name); + } + return '_' + name; + } + + @Override + public String apiFileFolder() { + return (outputFolder + File.separator + apiFolder).replace("/", File.separator); + } + + @Override + public String modelFileFolder() { + return (outputFolder + File.separator + modelFolder).replace("/", File.separator); + } + + @Override + public String toVarName(String name) { + // replace - with _ e.g. created-at => created_at + name = sanitizeName(name.replaceAll("-", "_")); + + // snake_case, e.g. PetId => pet_id + name = underscore(name); + + // for reserved word or word starting with number, append _ + if (isReservedWord(name)) + name = escapeReservedWord(name); + + // for reserved word or word starting with number, append _ + if (name.matches("^\\d.*")) + name = "var_" + name; + + return name; + } + + @Override + public String toParamName(String name) { + return toVarName(name); + } + + @Override + public String toModelName(String name) { + // camelize the model name + // phone_number => PhoneNumber + return capitalize(toModelFilename(name)) + ".t"; + } + + @Override + public String toModelFilename(String name) { + + if (!Strings.isNullOrEmpty(modelNamePrefix)) { + name = modelNamePrefix + "_" + name; + } + + if (!Strings.isNullOrEmpty(modelNameSuffix)) { + name = name + "_" + modelNameSuffix; + } + + name = sanitizeName(name); + + // model name cannot use reserved keyword, e.g. return + if (isReservedWord(name)) { + LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + ("model_" + name)); + name = "model_" + name; // e.g. return => ModelReturn (after camelize) + } + + // model name starts with number or _ + if (name.matches("^\\d.*|^_.*")) { + LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + ("model_" + name)); + name = "model_" + name; // e.g. 200Response => Model200Response (after camelize) + } + + return underscore(name); + } + + @Override + public String toApiFilename(final String name) { + // replace - with _ e.g. created-at => created_at + final String _name = name.replaceAll("-", "_"); + + // e.g. PetApi.ml => pet_api.ml + return underscore(_name) + "_api"; + } + + @Override + public String apiDocFileFolder() { + return (outputFolder + "/" + apiDocPath).replace('/', File.separatorChar); + } + + @Override + public String modelDocFileFolder() { + return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar); + } + + @Override + public String toModelDocFilename(String name) { + return toModelName(name); + } + + @Override + public String toApiDocFilename(String name) { + return toApiName(name); + } + + @Override + public String getTypeDeclaration(Schema p) { + if (ModelUtils.isArraySchema(p)) { + ArraySchema ap = (ArraySchema) p; + Schema inner = ap.getItems(); + if (inner == null) { + LOGGER.warn(ap.getName() + "(array property) does not have a proper inner type defined.Default to string"); + inner = new StringSchema().description("TODO default missing array inner type to string"); + } + return getTypeDeclaration(inner) + " list"; + } else if (ModelUtils.isMapSchema(p)) { + Schema inner = ModelUtils.getAdditionalProperties(p); + if (inner == null) { + LOGGER.warn(p.getName() + "(map property) does not have a proper inner type defined. Default to string"); + inner = new StringSchema().description("TODO default missing map inner type to string"); + } + String prefix = inner.getEnum() != null ? "Enums." : ""; + return "(string * " + prefix + getTypeDeclaration(inner) + ") list"; + } else if (p.getEnum() != null) { + String h = hashEnum(p); + return enumUniqNames.get(h); + } + + Schema referencedSchema = ModelUtils.getReferencedSchema(openAPI, p); + if (referencedSchema != null && referencedSchema.getEnum() != null) { + String h = hashEnum(referencedSchema); + return "Enums." + enumUniqNames.get(h); + } + + // Not using the supertype invocation, because we want to UpperCamelize + // the type. + String schemaType = getSchemaType(p); + if (typeMapping.containsKey(schemaType)) { + return typeMapping.get(schemaType); + } + + if (typeMapping.containsValue(schemaType)) { + return schemaType; + } + + if (languageSpecificPrimitives.contains(schemaType)) { + return schemaType; + } + + return toModelName(schemaType); + } + + @Override + public String getSchemaType(Schema p) { + String schemaType = super.getSchemaType(p); + if (typeMapping.containsKey(schemaType)) { + String type = typeMapping.get(schemaType); + if (languageSpecificPrimitives.contains(type)) { + return type; + } + } + return capitalize(toModelFilename(schemaType)); + } + + @Override + public String toOperationId(String operationId) { + String sanitizedOperationId = sanitizeName(operationId); + + // method name cannot use reserved keyword, e.g. return + if (isReservedWord(sanitizedOperationId) || sanitizedOperationId.matches("^[0-9].*")) { + LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + StringUtils.underscore("call_" + operationId)); + sanitizedOperationId = "call_" + sanitizedOperationId; + } + + return StringUtils.underscore(sanitizedOperationId); + } + + private Map allowableValues(String valueString) { + Map result = new HashMap<>(); + result.put("values", buildEnumValues(valueString)); + return result; + } + + private List> buildEnumValues(String valueString) { + List> result = new ArrayList<>(); + + for (String v : valueString.split(",")) { + Map m = new HashMap<>(); + String value = v.isEmpty() ? "empty" : v; + m.put("name", value); + m.put("camlEnumValueName", ocamlizeEnumValue(value)); + result.add(m); + } + + return result; + } + + private String ocamlizeEnumValue(String value) { + String sanitizedValue = + super.toVarName(value.isEmpty() ? "empty" : value) + .replace(" ", "_"); + + if (!sanitizedValue.matches("^[a-zA-Z_].*")) { + sanitizedValue = "_" + sanitizedValue; + } + return "`" + capitalize(sanitizedValue); + } + + private CodegenModel buildEnumModel(String enumName, String values) { + CodegenModel m = new CodegenModel(); + m.setAllowableValues(allowableValues(values)); + m.setName(enumName); + m.setClassname(enumName); + m.setDataType(enumName); + String[] vals = values.split(","); + if (vals.length == 1) { + m.setDefaultValue(ocamlizeEnumValue(vals[0])); + } + m.isEnum = true; + + return m; + } + + private Map buildEnumModelWrapper(String enumName, String values) { + Map m = new HashMap<>(); + m.put("importPath", packageName + "." + enumName); + m.put("model", buildEnumModel(enumName, values)); + return m; + } + + @Override + public Map postProcessOperationsWithModels(Map objs, List allModels) { + @SuppressWarnings("unchecked") + Map objectMap = (Map) objs.get("operations"); + @SuppressWarnings("unchecked") + List operations = (List) objectMap.get("operation"); + for (CodegenOperation operation : operations) { + // http method verb conversion, depending on client library (e.g. Hyper: PUT => Put, Reqwest: PUT => put) + //if (CO_HTTP.equals(getLibrary())) { + for (CodegenParameter param : operation.bodyParams) { + if (param.isModel && param.dataType.endsWith(".t")) { + param.vendorExtensions.put(X_MODEL_MODULE, param.dataType.substring(0, param.dataType.lastIndexOf('.'))); + } + } + } + + for (Map.Entry e : enumUniqNames.entrySet()) { + allModels.add(buildEnumModelWrapper(e.getValue(), e.getKey())); + } + + enumUniqNames.clear(); + + return objs; + } + + @Override + protected boolean needToImport(String type) { + return !defaultIncludes.contains(type) + && !languageSpecificPrimitives.contains(type); + } + + public void setPackageName(String packageName) { + this.packageName = packageName; + } + + public void setPackageVersion(String packageVersion) { + this.packageVersion = packageVersion; + } + + @Override + public String escapeQuotationMark(String input) { + // remove " to avoid code injection + return input.replace("\"", ""); + } + + @Override + public String escapeUnsafeCharacters(String input) { + return input + .replace("*)", "*_)") + .replace("(*", "(_*") + .replace("\"", "\\\""); + } + + @Override + public String toEnumName(CodegenProperty property) { + String hash = String.join(",", property.get_enum()); + + if (enumUniqNames.containsKey(hash)) { + return enumUniqNames.get(hash); + } + + throw new IllegalArgumentException("Unreferenced enum " + hash); + } + + @Override + public String toDefaultValue(Schema p) { + if (p.getDefault() != null) { + return p.getDefault().toString(); + } else { + return null; + } + } +} diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig index ac693c68c87..a27cc518fdc 100644 --- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig +++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig @@ -62,6 +62,7 @@ org.openapitools.codegen.languages.LuaClientCodegen org.openapitools.codegen.languages.MysqlSchemaCodegen org.openapitools.codegen.languages.NodeJSServerCodegen org.openapitools.codegen.languages.ObjcClientCodegen +org.openapitools.codegen.languages.OCamlClientCodegen org.openapitools.codegen.languages.OpenAPIGenerator org.openapitools.codegen.languages.OpenAPIYamlGenerator org.openapitools.codegen.languages.PerlClientCodegen diff --git a/modules/openapi-generator/src/main/resources/ocaml-client/api-impl.mustache b/modules/openapi-generator/src/main/resources/ocaml-client/api-impl.mustache new file mode 100644 index 00000000000..5b9e498eb5f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/ocaml-client/api-impl.mustache @@ -0,0 +1,30 @@ +{{>partial_header}} +{{#operations}} +{{#operation}} +{{#description}} + * Schema {{{classname}}} : {{{description}}} +{{/description}} +{{/operation}} +{{/operations}} + *) + +{{#operations}} +{{#operation}} +let {{{operationId}}} {{^hasParams}}(){{/hasParams}}{{#allParams}}{{{paramName}}}{{#hasMore}} {{/hasMore}}{{/allParams}} = + let open Lwt in + let uri = Request.build_uri "{{{path}}}" in + let headers = Request.default_headers in{{#headerParams}} + let headers = Cohttp.Header.add{{#isContainer}}_multi{{/isContainer}} headers "{{baseName}}" ({{> to_string}}{{paramName}}) in{{/headerParams}}{{#pathParams}} + let uri = Request.replace_path_param uri "{{{baseName}}}" ({{> to_string}}{{{paramName}}}) in{{/pathParams}}{{#queryParams}} + let uri = Uri.add_query_param{{^isListContainer}}'{{/isListContainer}} uri ("{{{baseName}}}", {{> to_string}}{{{paramName}}}) in{{/queryParams}}{{#hasAuthMethods}}{{#authMethods}}{{#isApiKey}}{{#isKeyInQuery}} + let uri = Uri.add_query_param' uri ("{{{keyParamName}}}", Request.api_key) in{{/isKeyInQuery}}{{/isApiKey}}{{/authMethods}}{{/hasAuthMethods}}{{#bodyParams}} + let body = Request.write_json_body {{> to_json}} {{{paramName}}} in{{/bodyParams}}{{^hasBodyParam}}{{#hasFormParams}} + let body = Request.init_form_encoded_body () in{{/hasFormParams}}{{#formParams}} + let body = Request.add_form_encoded_body_param{{#isContainer}}s{{/isContainer}} body ("{{{paramName}}}", {{> to_string}}{{{paramName}}}) in{{/formParams}}{{#hasFormParams}} + let body = Request.finalize_form_encoded_body body in{{/hasFormParams}}{{/hasBodyParam}} + Cohttp_lwt_unix.Client.call `{{{httpMethod}}} uri ~headers {{#hasBodyParam}}~body {{/hasBodyParam}}{{^hasBodyParam}}{{#hasFormParams}}~body {{/hasFormParams}}{{/hasBodyParam}}>>= fun (resp, body) ->{{^returnType}} + Request.handle_unit_response resp{{/returnType}}{{#returnType}} + Request.read_json_body{{#returnContainer}}{{#isListContainer}}_as_list{{/isListContainer}}{{#isMapContainer}}_as_map{{/isMapContainer}}{{#returnBaseType}}_of{{/returnBaseType}}{{/returnContainer}}{{^returnContainer}}{{#returnBaseType}}_as{{/returnBaseType}}{{/returnContainer}} {{#returnType}}({{> of_json}}){{/returnType}} resp body{{/returnType}} + +{{/operation}} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/ocaml-client/api-intf.mustache b/modules/openapi-generator/src/main/resources/ocaml-client/api-intf.mustache new file mode 100644 index 00000000000..8bd8de3a4e6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/ocaml-client/api-intf.mustache @@ -0,0 +1,15 @@ +{{>partial_header}} +{{#operations}} +{{#operation}} +{{#description}} + * Schema {{{classname}}} : {{{description}}} +{{/description}} +{{/operation}} +{{/operations}} + *) + +{{#operations}} +{{#operation}} +val {{{operationId}}} : {{^hasParams}}unit{{/hasParams}}{{#allParams}}{{#isEnum}}Enums.{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#hasMore}} -> {{/hasMore}}{{/allParams}} -> {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}unit{{/returnType}} Lwt.t +{{/operation}} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/ocaml-client/dune-project.mustache b/modules/openapi-generator/src/main/resources/ocaml-client/dune-project.mustache new file mode 100644 index 00000000000..8e48d839f68 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/ocaml-client/dune-project.mustache @@ -0,0 +1,2 @@ +(lang dune 1.10) +(name {{{packageName}}}) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/ocaml-client/dune.mustache b/modules/openapi-generator/src/main/resources/ocaml-client/dune.mustache new file mode 100644 index 00000000000..e7a9352401d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/ocaml-client/dune.mustache @@ -0,0 +1,9 @@ +(include_subdirs unqualified) +(library + (name {{{packageName}}}) + (public_name {{{packageName}}}) + (flags (:standard -w -27)) + (libraries str cohttp-lwt-unix lwt yojson ppx_deriving_yojson.runtime) + (preprocess (pps ppx_deriving_yojson ppx_deriving.std)) + (wrapped true) +) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/ocaml-client/enums.mustache b/modules/openapi-generator/src/main/resources/ocaml-client/enums.mustache new file mode 100644 index 00000000000..a9aed87db27 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/ocaml-client/enums.mustache @@ -0,0 +1,25 @@ +{{>partial_header}} +{{#description}} + * Schema {{{classname}}} : {{{description}}} +{{/description}} + *) +{{#models}} +{{#model}} +{{#isEnum}} + +type {{name}} = [ +{{#allowableValues}} +{{#values}} +| {{{camlEnumValueName}}} [@printer fun fmt _ -> Format.pp_print_string fmt "{{{name}}}"] [@name "{{{name}}}"] +{{/values}} +{{/allowableValues}} +] [@@deriving yojson, show { with_path = false }];; + +let {{name}}_of_yojson json = {{name}}_of_yojson (`List [json]) +let {{name}}_to_yojson e = + match {{name}}_to_yojson e with + | `List [json] -> json + | json -> json +{{/isEnum}} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/ocaml-client/json.mustache b/modules/openapi-generator/src/main/resources/ocaml-client/json.mustache new file mode 100644 index 00000000000..4b0fac77545 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/ocaml-client/json.mustache @@ -0,0 +1,55 @@ +open Ppx_deriving_yojson_runtime + +let unwrap to_json json = + match to_json json with + | Result.Ok json -> json + | Result.Error s -> failwith s + +let to_int json = + match json with + | `Int x -> x + | `Intlit s -> int_of_string s + | _ -> failwith "JsonSupport.to_int" + +let to_bool json = + match json with + | `Bool x -> x + | _ -> failwith "JsonSupport.to_bool" + +let to_float json = + match json with + | `Float x -> x + | _ -> failwith "JsonSupport.to_float" + +let to_string json = + match json with + | `String s -> s + | _ -> failwith "JsonSupport.to_string" + +let to_int32 json : int32 = + match json with + | `Int x -> Int32.of_int x + | `Intlit s -> Int32.of_string s + | _ -> failwith "JsonSupport.to_int32" + +let to_int64 json : int64 = + match json with + | `Int x -> Int64.of_int x + | `Intlit s -> Int64.of_string s + | _ -> failwith "JsonSupport.to_int64" + +let of_int x = `Int x + +let of_bool b = `Bool b + +let of_float x = `Float x + +let of_string s = `String s + +let of_int32 x = `Intlit (Int32.to_string x) + +let of_int64 x = `Intlit (Int64.to_string x) + +let of_list_of of_f l = `List (List.map of_f l) + +let of_map_of of_f l = `Assoc (List.map (fun (k, v) -> (k, of_f v)) l) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/ocaml-client/lib.mustache b/modules/openapi-generator/src/main/resources/ocaml-client/lib.mustache new file mode 100644 index 00000000000..627f3227880 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/ocaml-client/lib.mustache @@ -0,0 +1,15 @@ +opam-version: "2.0" +name: "{{{packageName}}}" +version: "{{{packageVersion}}}" +synopsis: "{{{packageDescription}}}" +description: """ +Longer description +""" +maintainer: "Name " +authors: "Name " +license: "" +homepage: "" +bug-reports: "" +dev-repo: "" +depends: [ "ocaml" "ocamlfind" ] +build: ["dune" "build" "-p" name] \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/ocaml-client/model.mustache b/modules/openapi-generator/src/main/resources/ocaml-client/model.mustache new file mode 100644 index 00000000000..33fc27af079 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/ocaml-client/model.mustache @@ -0,0 +1,38 @@ +{{>partial_header}} +{{#models}} +{{#model}} +{{#description}} + * Schema {{{classname}}} : {{{description}}} + *) +{{/description}} +{{^description}} + *) +{{/description}} + +{{^isEnum}} +type t = { +{{#vars}} + {{#description}} + (* {{{description}}} *) + {{/description}} + {{#isEnum}} + {{{name}}}: {{^isMapContainer}}Enums.{{/isMapContainer}}{{{datatypeWithEnum}}}{{^isContainer}}{{#defaultValue}}[@default {{{defaultValue}}}]{{/defaultValue}}{{/isContainer}}{{^isContainer}}{{#required}}{{#isNullable}} option [@default None]{{/isNullable}}{{/required}}{{/isContainer}}{{^isContainer}}{{^required}} option [@default None]{{/required}}{{/isContainer}}; + {{/isEnum}} + {{^isEnum}} + {{{name}}}: {{{datatypeWithEnum}}}{{^isContainer}}{{#required}}{{#isNullable}} option{{/isNullable}}{{/required}}{{/isContainer}}{{^isContainer}}{{^required}} option [@default None]{{/required}}{{/isContainer}}; + {{/isEnum}} +{{/vars}} +} [@@deriving yojson, show ];; + +{{#description}} +(** {{{description}}} *) +{{/description}} +let create {{#requiredVars}}({{{name}}} : {{#isEnum}}Enums.{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}}option{{/isNullable}}){{^-last}} {{/-last}}{{/requiredVars}}{{^hasRequired}}(){{/hasRequired}} : t = { + {{#vars}} + {{{name}}} = {{#required}}{{{name}}}{{/required}}{{^required}}{{#isContainer}}[]{{/isContainer}}{{^isContainer}}None{{/isContainer}}{{/required}}; + {{/vars}} +} +{{/isEnum}} + +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/ocaml-client/of_json.mustache b/modules/openapi-generator/src/main/resources/ocaml-client/of_json.mustache new file mode 100644 index 00000000000..a7be3d4d7ca --- /dev/null +++ b/modules/openapi-generator/src/main/resources/ocaml-client/of_json.mustache @@ -0,0 +1 @@ +{{#isEnum}}JsonSupport.unwrap Enums.{{{datatypeWithEnum}}}_of_yojson{{/isEnum}}{{^isEnum}}{{#returnType}}{{#returnTypeIsPrimitive}}JsonSupport.to_{{{returnBaseType}}}{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{#vendorExtensions.x-modelModule}}JsonSupport.unwrap {{{vendorExtensions.x-modelModule}}}.of_yojson{{/vendorExtensions.x-modelModule}}{{^vendorExtensions.x-modelModule}}JsonSupport.unwrap {{{returnBaseType}}}.of_yojson{{/vendorExtensions.x-modelModule}}{{/returnTypeIsPrimitive}}{{/returnType}}{{/isEnum}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/ocaml-client/partial_header.mustache b/modules/openapi-generator/src/main/resources/ocaml-client/partial_header.mustache new file mode 100644 index 00000000000..c4bbcd913c4 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/ocaml-client/partial_header.mustache @@ -0,0 +1,5 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/ocaml-client/support.mustache b/modules/openapi-generator/src/main/resources/ocaml-client/support.mustache new file mode 100644 index 00000000000..e0c33b4f58a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/ocaml-client/support.mustache @@ -0,0 +1,48 @@ +let api_key = "" +let base_url = "{{{basePath}}}" +let default_headers = Cohttp.Header.init_with "Content-Type" "application/json" + +let build_uri operation_path = Uri.of_string (base_url ^ operation_path) +let write_json_body to_json payload = + to_json payload |> Yojson.Safe.to_string ~std:true |> Cohttp_lwt.Body.of_string + +let handle_response resp on_success_handler = + match Cohttp_lwt.Response.status resp with + | #Cohttp.Code.success_status -> on_success_handler () + | s -> failwith ("Server responded with status " ^ Cohttp.Code.(reason_phrase_of_code (code_of_status s))) + +let handle_unit_response resp = handle_response resp (fun () -> Lwt.return ()) + +let read_json_body resp body = + handle_response resp (fun () -> + (Lwt.(Cohttp_lwt.Body.to_string body >|= Yojson.Safe.from_string))) + +let read_json_body_as of_json resp body = + Lwt.(read_json_body resp body >|= of_json) + +let read_json_body_as_list resp body = + Lwt.(read_json_body resp body >|= Yojson.Safe.Util.to_list) + +let read_json_body_as_list_of of_json resp body = + Lwt.(read_json_body_as_list resp body >|= List.map of_json) + +let read_json_body_as_map_of of_json resp body = + Lwt.(read_json_body resp body >|= Yojson.Safe.Util.to_assoc >|= List.map (fun (s, v) -> (s, of_json v))) + +let replace_path_param uri param_name param_value = + let regexp = Str.regexp (Str.quote ("{" ^ param_name ^ "}")) in + let path = Str.global_replace regexp param_value (Uri.path uri) in + Uri.with_path uri path + +let init_form_encoded_body () = "" + +let add_form_encoded_body_param params (paramName, paramValue) = + let new_param_enc = Printf.sprintf {|%s=%s|} (Uri.pct_encode paramName) (Uri.pct_encode paramValue) in + if params = "" + then new_param_enc + else Printf.sprintf {|%s&%s|} params new_param_enc + +let add_form_encoded_body_params params (paramName, new_params) = + add_form_encoded_body_param params (paramName, String.concat "," new_params) + +let finalize_form_encoded_body body = Cohttp_lwt.Body.of_string body diff --git a/modules/openapi-generator/src/main/resources/ocaml-client/to_json.mustache b/modules/openapi-generator/src/main/resources/ocaml-client/to_json.mustache new file mode 100644 index 00000000000..6b8fea90fdc --- /dev/null +++ b/modules/openapi-generator/src/main/resources/ocaml-client/to_json.mustache @@ -0,0 +1 @@ +{{#isListContainer}}{{#items}}(JsonSupport.of_list_of {{> to_json}}){{/items}}{{/isListContainer}}{{#isMapContainer}}{{#items}}(JsonSupport.of_map_of {{> to_json}}){{/items}}{{/isMapContainer}}{{#isString}}JsonSupport.of_string{{/isString}}{{#isLong}}JsonSupport.of_int64{{/isLong}}{{#isInteger}}JsonSupport.of_int32{{/isInteger}}{{#isFloat}}JsonSupport.of_float{{/isFloat}}{{#isNumber}}JsonSupport.of_float{{/isNumber}}{{#isDouble}}JsonSupport.of_float{{/isDouble}}{{#isBoolean}}JsonSupport.of_bool{{/isBoolean}}{{^isEnum}}{{#isModel}}{{#vendorExtensions.x-modelModule}}{{{vendorExtensions.x-modelModule}}}.to_yojson{{/vendorExtensions.x-modelModule}}{{^vendorExtensions.x-modelModule}}{{{baseType}}}.to_yojson{{/vendorExtensions.x-modelModule}}{{/isModel}}{{/isEnum}}{{^isModel}}{{^isContainer}}{{#isEnum}}Enums.{{{datatypeWithEnum}}}_to_yojson{{/isEnum}}{{/isContainer}}{{/isModel}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/ocaml-client/to_string.mustache b/modules/openapi-generator/src/main/resources/ocaml-client/to_string.mustache new file mode 100644 index 00000000000..b7be4f380df --- /dev/null +++ b/modules/openapi-generator/src/main/resources/ocaml-client/to_string.mustache @@ -0,0 +1 @@ +{{#isContainer}}{{#items}}{{#isEnum}}List.map {{> to_string}}{{/isEnum}}{{#isModel}}List.map {{> to_string}}{{/isModel}}{{/items}}{{/isContainer}}{{^isEnum}}{{#isString}}{{/isString}}{{#isLong}}Int64.to_string {{/isLong}}{{#isInteger}}Int32.to_string {{/isInteger}}{{#isFloat}}string_of_float {{/isFloat}}{{#isNumber}}string_of_float {{/isNumber}}{{#isDouble}}string_of_float {{/isDouble}}{{#isBoolean}}string_of_bool {{/isBoolean}}{{#isByteArray}}Bytes.to_string {{/isByteArray}}{{#isModel}}{{{vendorExtensions.x-modelModule}}}.show {{/isModel}}{{/isEnum}}{{^isModel}}{{^isContainer}}{{#isEnum}}Enums.show_{{{datatypeWithEnum}}} {{/isEnum}}{{/isContainer}}{{/isModel}} \ No newline at end of file diff --git a/samples/client/petstore/ocaml-client/.openapi-generator-ignore b/samples/client/petstore/ocaml-client/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/ocaml-client/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/ocaml-client/.openapi-generator/VERSION b/samples/client/petstore/ocaml-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..717311e32e3 --- /dev/null +++ b/samples/client/petstore/ocaml-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +unset \ No newline at end of file diff --git a/samples/client/petstore/ocaml-client/bin/dune b/samples/client/petstore/ocaml-client/bin/dune new file mode 100644 index 00000000000..03e93b0036b --- /dev/null +++ b/samples/client/petstore/ocaml-client/bin/dune @@ -0,0 +1,6 @@ +(include_subdirs no) +(executable + (name test) + (libraries petstore_client) + (modules test) +) diff --git a/samples/client/petstore/ocaml-client/bin/test.ml b/samples/client/petstore/ocaml-client/bin/test.ml new file mode 100644 index 00000000000..0fe314c1e72 --- /dev/null +++ b/samples/client/petstore/ocaml-client/bin/test.ml @@ -0,0 +1,19 @@ +open Petstore_client +open Lwt + +let lift f r = Ppx_deriving_yojson_runtime.(>|=) r f + +let main () = + let p = Pet.create "Bob" [] in + Pet_api.add_pet p + +let find_pet () = + let pet_id = 9199424981609334637L in + Pet_api.get_pet_by_id pet_id >|= Pet.show >|= print_endline + +let find_pets_by_tags () = + let tags = ["dog"; "cat"] in + Pet_api.find_pets_by_tags tags >|= List.map Pet.show >|= List.map print_endline + +let _ = + Lwt_main.run (find_pets_by_tags ()) diff --git a/samples/client/petstore/ocaml-client/dune b/samples/client/petstore/ocaml-client/dune new file mode 100644 index 00000000000..ed1c4d90e3d --- /dev/null +++ b/samples/client/petstore/ocaml-client/dune @@ -0,0 +1,9 @@ +(include_subdirs unqualified) +(library + (name petstore_client) + (public_name petstore_client) + (flags (:standard -w -27)) + (libraries str cohttp-lwt-unix lwt yojson ppx_deriving_yojson.runtime) + (preprocess (pps ppx_deriving_yojson ppx_deriving.std)) + (wrapped true) +) \ No newline at end of file diff --git a/samples/client/petstore/ocaml-client/dune-project b/samples/client/petstore/ocaml-client/dune-project new file mode 100644 index 00000000000..79d86e3c901 --- /dev/null +++ b/samples/client/petstore/ocaml-client/dune-project @@ -0,0 +1,2 @@ +(lang dune 1.10) +(name petstore_client) \ No newline at end of file diff --git a/samples/client/petstore/ocaml-client/petstore_client.opam b/samples/client/petstore/ocaml-client/petstore_client.opam new file mode 100644 index 00000000000..3c3603c2f14 --- /dev/null +++ b/samples/client/petstore/ocaml-client/petstore_client.opam @@ -0,0 +1,15 @@ +opam-version: "2.0" +name: "petstore_client" +version: "1.0.0" +synopsis: "" +description: """ +Longer description +""" +maintainer: "Name " +authors: "Name " +license: "" +homepage: "" +bug-reports: "" +dev-repo: "" +depends: [ "ocaml" "ocamlfind" ] +build: ["dune" "build" "-p" name] \ No newline at end of file diff --git a/samples/client/petstore/ocaml-client/src/apis/pet_api.ml b/samples/client/petstore/ocaml-client/src/apis/pet_api.ml new file mode 100644 index 00000000000..207503b9061 --- /dev/null +++ b/samples/client/petstore/ocaml-client/src/apis/pet_api.ml @@ -0,0 +1,80 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +let add_pet body = + let open Lwt in + let uri = Request.build_uri "/pet" in + let headers = Request.default_headers in + let body = Request.write_json_body Pet.to_yojson body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let delete_pet pet_id api_key = + let open Lwt in + let uri = Request.build_uri "/pet/{petId}" in + let headers = Request.default_headers in + let headers = Cohttp.Header.add headers "api_key" (api_key) in + let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in + Cohttp_lwt_unix.Client.call `DELETE uri ~headers >>= fun (resp, body) -> + Request.handle_unit_response resp + +let find_pets_by_status status = + let open Lwt in + let uri = Request.build_uri "/pet/findByStatus" in + let headers = Request.default_headers in + let uri = Uri.add_query_param uri ("status", List.map Enums.show_pet_status status) in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as_list_of (JsonSupport.unwrap Pet.of_yojson) resp body + +let find_pets_by_tags tags = + let open Lwt in + let uri = Request.build_uri "/pet/findByTags" in + let headers = Request.default_headers in + let uri = Uri.add_query_param uri ("tags", tags) in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as_list_of (JsonSupport.unwrap Pet.of_yojson) resp body + +let get_pet_by_id pet_id = + let open Lwt in + let uri = Request.build_uri "/pet/{petId}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Pet.of_yojson) resp body + +let update_pet body = + let open Lwt in + let uri = Request.build_uri "/pet" in + let headers = Request.default_headers in + let body = Request.write_json_body Pet.to_yojson body in + Cohttp_lwt_unix.Client.call `PUT uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let update_pet_with_form pet_id name status = + let open Lwt in + let uri = Request.build_uri "/pet/{petId}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in + let body = Request.init_form_encoded_body () in + let body = Request.add_form_encoded_body_param body ("name", name) in + let body = Request.add_form_encoded_body_param body ("status", status) in + let body = Request.finalize_form_encoded_body body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let upload_file pet_id additional_metadata file = + let open Lwt in + let uri = Request.build_uri "/pet/{petId}/uploadImage" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in + let body = Request.init_form_encoded_body () in + let body = Request.add_form_encoded_body_param body ("additional_metadata", additional_metadata) in + let body = Request.add_form_encoded_body_param body ("file", file) in + let body = Request.finalize_form_encoded_body body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Api_response.of_yojson) resp body + diff --git a/samples/client/petstore/ocaml-client/src/apis/pet_api.mli b/samples/client/petstore/ocaml-client/src/apis/pet_api.mli new file mode 100644 index 00000000000..0cc31e085cf --- /dev/null +++ b/samples/client/petstore/ocaml-client/src/apis/pet_api.mli @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +val add_pet : Pet.t -> unit Lwt.t +val delete_pet : int64 -> string -> unit Lwt.t +val find_pets_by_status : Enums.pet_status list -> Pet.t list Lwt.t +val find_pets_by_tags : string list -> Pet.t list Lwt.t +val get_pet_by_id : int64 -> Pet.t Lwt.t +val update_pet : Pet.t -> unit Lwt.t +val update_pet_with_form : int64 -> string -> string -> unit Lwt.t +val upload_file : int64 -> string -> string -> Api_response.t Lwt.t diff --git a/samples/client/petstore/ocaml-client/src/apis/store_api.ml b/samples/client/petstore/ocaml-client/src/apis/store_api.ml new file mode 100644 index 00000000000..cebccabdd85 --- /dev/null +++ b/samples/client/petstore/ocaml-client/src/apis/store_api.ml @@ -0,0 +1,38 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +let delete_order order_id = + let open Lwt in + let uri = Request.build_uri "/store/order/{orderId}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "orderId" (order_id) in + Cohttp_lwt_unix.Client.call `DELETE uri ~headers >>= fun (resp, body) -> + Request.handle_unit_response resp + +let get_inventory () = + let open Lwt in + let uri = Request.build_uri "/store/inventory" in + let headers = Request.default_headers in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as_map_of (JsonSupport.to_int32) resp body + +let get_order_by_id order_id = + let open Lwt in + let uri = Request.build_uri "/store/order/{orderId}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "orderId" (Int64.to_string order_id) in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Order.of_yojson) resp body + +let place_order body = + let open Lwt in + let uri = Request.build_uri "/store/order" in + let headers = Request.default_headers in + let body = Request.write_json_body Order.to_yojson body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Order.of_yojson) resp body + diff --git a/samples/client/petstore/ocaml-client/src/apis/store_api.mli b/samples/client/petstore/ocaml-client/src/apis/store_api.mli new file mode 100644 index 00000000000..bc3c93eb494 --- /dev/null +++ b/samples/client/petstore/ocaml-client/src/apis/store_api.mli @@ -0,0 +1,11 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +val delete_order : string -> unit Lwt.t +val get_inventory : unit -> (string * int32) list Lwt.t +val get_order_by_id : int64 -> Order.t Lwt.t +val place_order : Order.t -> Order.t Lwt.t diff --git a/samples/client/petstore/ocaml-client/src/apis/user_api.ml b/samples/client/petstore/ocaml-client/src/apis/user_api.ml new file mode 100644 index 00000000000..d05d71682a3 --- /dev/null +++ b/samples/client/petstore/ocaml-client/src/apis/user_api.ml @@ -0,0 +1,72 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +let create_user body = + let open Lwt in + let uri = Request.build_uri "/user" in + let headers = Request.default_headers in + let body = Request.write_json_body User.to_yojson body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let create_users_with_array_input body = + let open Lwt in + let uri = Request.build_uri "/user/createWithArray" in + let headers = Request.default_headers in + let body = Request.write_json_body (JsonSupport.of_list_of User.to_yojson) body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let create_users_with_list_input body = + let open Lwt in + let uri = Request.build_uri "/user/createWithList" in + let headers = Request.default_headers in + let body = Request.write_json_body (JsonSupport.of_list_of User.to_yojson) body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let delete_user username = + let open Lwt in + let uri = Request.build_uri "/user/{username}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "username" (username) in + Cohttp_lwt_unix.Client.call `DELETE uri ~headers >>= fun (resp, body) -> + Request.handle_unit_response resp + +let get_user_by_name username = + let open Lwt in + let uri = Request.build_uri "/user/{username}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "username" (username) in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap User.of_yojson) resp body + +let login_user username password = + let open Lwt in + let uri = Request.build_uri "/user/login" in + let headers = Request.default_headers in + let uri = Uri.add_query_param' uri ("username", username) in + let uri = Uri.add_query_param' uri ("password", password) in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.to_string) resp body + +let logout_user () = + let open Lwt in + let uri = Request.build_uri "/user/logout" in + let headers = Request.default_headers in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.handle_unit_response resp + +let update_user username body = + let open Lwt in + let uri = Request.build_uri "/user/{username}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "username" (username) in + let body = Request.write_json_body User.to_yojson body in + Cohttp_lwt_unix.Client.call `PUT uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + diff --git a/samples/client/petstore/ocaml-client/src/apis/user_api.mli b/samples/client/petstore/ocaml-client/src/apis/user_api.mli new file mode 100644 index 00000000000..5191a2ea41b --- /dev/null +++ b/samples/client/petstore/ocaml-client/src/apis/user_api.mli @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +val create_user : User.t -> unit Lwt.t +val create_users_with_array_input : User.t list -> unit Lwt.t +val create_users_with_list_input : User.t list -> unit Lwt.t +val delete_user : string -> unit Lwt.t +val get_user_by_name : string -> User.t Lwt.t +val login_user : string -> string -> string Lwt.t +val logout_user : unit -> unit Lwt.t +val update_user : string -> User.t -> unit Lwt.t diff --git a/samples/client/petstore/ocaml-client/src/models/api_response.ml b/samples/client/petstore/ocaml-client/src/models/api_response.ml new file mode 100644 index 00000000000..f1b960d1449 --- /dev/null +++ b/samples/client/petstore/ocaml-client/src/models/api_response.ml @@ -0,0 +1,21 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema Api_response.t : Describes the result of uploading an image resource + *) + +type t = { + code: int32 option [@default None]; + _type: string option [@default None]; + message: string option [@default None]; +} [@@deriving yojson, show ];; + +(** Describes the result of uploading an image resource *) +let create () : t = { + code = None; + _type = None; + message = None; +} + diff --git a/samples/client/petstore/ocaml-client/src/models/category.ml b/samples/client/petstore/ocaml-client/src/models/category.ml new file mode 100644 index 00000000000..31b9c3aab1d --- /dev/null +++ b/samples/client/petstore/ocaml-client/src/models/category.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema Category.t : A category for a pet + *) + +type t = { + id: int64 option [@default None]; + name: string option [@default None]; +} [@@deriving yojson, show ];; + +(** A category for a pet *) +let create () : t = { + id = None; + name = None; +} + diff --git a/samples/client/petstore/ocaml-client/src/models/order.ml b/samples/client/petstore/ocaml-client/src/models/order.ml new file mode 100644 index 00000000000..6130f88fd95 --- /dev/null +++ b/samples/client/petstore/ocaml-client/src/models/order.ml @@ -0,0 +1,28 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema Order.t : An order for a pets from the pet store + *) + +type t = { + id: int64 option [@default None]; + pet_id: int64 option [@default None]; + quantity: int32 option [@default None]; + ship_date: string option [@default None]; + (* Order Status *) + status: Enums.status option [@default None]; + complete: bool option [@default None]; +} [@@deriving yojson, show ];; + +(** An order for a pets from the pet store *) +let create () : t = { + id = None; + pet_id = None; + quantity = None; + ship_date = None; + status = None; + complete = None; +} + diff --git a/samples/client/petstore/ocaml-client/src/models/pet.ml b/samples/client/petstore/ocaml-client/src/models/pet.ml new file mode 100644 index 00000000000..5d267ef32db --- /dev/null +++ b/samples/client/petstore/ocaml-client/src/models/pet.ml @@ -0,0 +1,28 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema Pet.t : A pet for sale in the pet store + *) + +type t = { + id: int64 option [@default None]; + category: Category.t option [@default None]; + name: string; + photo_urls: string list; + tags: Tag.t list; + (* pet status in the store *) + status: Enums.pet_status option [@default None]; +} [@@deriving yojson, show ];; + +(** A pet for sale in the pet store *) +let create (name : string) (photo_urls : string list) : t = { + id = None; + category = None; + name = name; + photo_urls = photo_urls; + tags = []; + status = None; +} + diff --git a/samples/client/petstore/ocaml-client/src/models/tag.ml b/samples/client/petstore/ocaml-client/src/models/tag.ml new file mode 100644 index 00000000000..5570d9c8eaf --- /dev/null +++ b/samples/client/petstore/ocaml-client/src/models/tag.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema Tag.t : A tag for a pet + *) + +type t = { + id: int64 option [@default None]; + name: string option [@default None]; +} [@@deriving yojson, show ];; + +(** A tag for a pet *) +let create () : t = { + id = None; + name = None; +} + diff --git a/samples/client/petstore/ocaml-client/src/models/user.ml b/samples/client/petstore/ocaml-client/src/models/user.ml new file mode 100644 index 00000000000..a9483d72889 --- /dev/null +++ b/samples/client/petstore/ocaml-client/src/models/user.ml @@ -0,0 +1,32 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema User.t : A User who is purchasing from the pet store + *) + +type t = { + id: int64 option [@default None]; + username: string option [@default None]; + first_name: string option [@default None]; + last_name: string option [@default None]; + email: string option [@default None]; + password: string option [@default None]; + phone: string option [@default None]; + (* User Status *) + user_status: int32 option [@default None]; +} [@@deriving yojson, show ];; + +(** A User who is purchasing from the pet store *) +let create () : t = { + id = None; + username = None; + first_name = None; + last_name = None; + email = None; + password = None; + phone = None; + user_status = None; +} + diff --git a/samples/client/petstore/ocaml-client/src/support/enums.ml b/samples/client/petstore/ocaml-client/src/support/enums.ml new file mode 100644 index 00000000000..0c64f8c042f --- /dev/null +++ b/samples/client/petstore/ocaml-client/src/support/enums.ml @@ -0,0 +1,30 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type status = [ +| `Placed [@printer fun fmt _ -> Format.pp_print_string fmt "placed"] [@name "placed"] +| `Approved [@printer fun fmt _ -> Format.pp_print_string fmt "approved"] [@name "approved"] +| `Delivered [@printer fun fmt _ -> Format.pp_print_string fmt "delivered"] [@name "delivered"] +] [@@deriving yojson, show { with_path = false }];; + +let status_of_yojson json = status_of_yojson (`List [json]) +let status_to_yojson e = + match status_to_yojson e with + | `List [json] -> json + | json -> json + +type pet_status = [ +| `Available [@printer fun fmt _ -> Format.pp_print_string fmt "available"] [@name "available"] +| `Pending [@printer fun fmt _ -> Format.pp_print_string fmt "pending"] [@name "pending"] +| `Sold [@printer fun fmt _ -> Format.pp_print_string fmt "sold"] [@name "sold"] +] [@@deriving yojson, show { with_path = false }];; + +let pet_status_of_yojson json = pet_status_of_yojson (`List [json]) +let pet_status_to_yojson e = + match pet_status_to_yojson e with + | `List [json] -> json + | json -> json diff --git a/samples/client/petstore/ocaml-client/src/support/jsonSupport.ml b/samples/client/petstore/ocaml-client/src/support/jsonSupport.ml new file mode 100644 index 00000000000..4b0fac77545 --- /dev/null +++ b/samples/client/petstore/ocaml-client/src/support/jsonSupport.ml @@ -0,0 +1,55 @@ +open Ppx_deriving_yojson_runtime + +let unwrap to_json json = + match to_json json with + | Result.Ok json -> json + | Result.Error s -> failwith s + +let to_int json = + match json with + | `Int x -> x + | `Intlit s -> int_of_string s + | _ -> failwith "JsonSupport.to_int" + +let to_bool json = + match json with + | `Bool x -> x + | _ -> failwith "JsonSupport.to_bool" + +let to_float json = + match json with + | `Float x -> x + | _ -> failwith "JsonSupport.to_float" + +let to_string json = + match json with + | `String s -> s + | _ -> failwith "JsonSupport.to_string" + +let to_int32 json : int32 = + match json with + | `Int x -> Int32.of_int x + | `Intlit s -> Int32.of_string s + | _ -> failwith "JsonSupport.to_int32" + +let to_int64 json : int64 = + match json with + | `Int x -> Int64.of_int x + | `Intlit s -> Int64.of_string s + | _ -> failwith "JsonSupport.to_int64" + +let of_int x = `Int x + +let of_bool b = `Bool b + +let of_float x = `Float x + +let of_string s = `String s + +let of_int32 x = `Intlit (Int32.to_string x) + +let of_int64 x = `Intlit (Int64.to_string x) + +let of_list_of of_f l = `List (List.map of_f l) + +let of_map_of of_f l = `Assoc (List.map (fun (k, v) -> (k, of_f v)) l) \ No newline at end of file diff --git a/samples/client/petstore/ocaml-client/src/support/request.ml b/samples/client/petstore/ocaml-client/src/support/request.ml new file mode 100644 index 00000000000..21b6f870ed9 --- /dev/null +++ b/samples/client/petstore/ocaml-client/src/support/request.ml @@ -0,0 +1,48 @@ +let api_key = "" +let base_url = "http://petstore.swagger.io/v2" +let default_headers = Cohttp.Header.init_with "Content-Type" "application/json" + +let build_uri operation_path = Uri.of_string (base_url ^ operation_path) +let write_json_body to_json payload = + to_json payload |> Yojson.Safe.to_string ~std:true |> Cohttp_lwt.Body.of_string + +let handle_response resp on_success_handler = + match Cohttp_lwt.Response.status resp with + | #Cohttp.Code.success_status -> on_success_handler () + | s -> failwith ("Server responded with status " ^ Cohttp.Code.(reason_phrase_of_code (code_of_status s))) + +let handle_unit_response resp = handle_response resp (fun () -> Lwt.return ()) + +let read_json_body resp body = + handle_response resp (fun () -> + (Lwt.(Cohttp_lwt.Body.to_string body >|= Yojson.Safe.from_string))) + +let read_json_body_as of_json resp body = + Lwt.(read_json_body resp body >|= of_json) + +let read_json_body_as_list resp body = + Lwt.(read_json_body resp body >|= Yojson.Safe.Util.to_list) + +let read_json_body_as_list_of of_json resp body = + Lwt.(read_json_body_as_list resp body >|= List.map of_json) + +let read_json_body_as_map_of of_json resp body = + Lwt.(read_json_body resp body >|= Yojson.Safe.Util.to_assoc >|= List.map (fun (s, v) -> (s, of_json v))) + +let replace_path_param uri param_name param_value = + let regexp = Str.regexp (Str.quote ("{" ^ param_name ^ "}")) in + let path = Str.global_replace regexp param_value (Uri.path uri) in + Uri.with_path uri path + +let init_form_encoded_body () = "" + +let add_form_encoded_body_param params (paramName, paramValue) = + let new_param_enc = Printf.sprintf {|%s=%s|} (Uri.pct_encode paramName) (Uri.pct_encode paramValue) in + if params = "" + then new_param_enc + else Printf.sprintf {|%s&%s|} params new_param_enc + +let add_form_encoded_body_params params (paramName, new_params) = + add_form_encoded_body_param params (paramName, String.concat "," new_params) + +let finalize_form_encoded_body body = Cohttp_lwt.Body.of_string body diff --git a/samples/openapi3/client/petstore/ocaml-client/.openapi-generator-ignore b/samples/openapi3/client/petstore/ocaml-client/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/openapi3/client/petstore/ocaml-client/.openapi-generator/VERSION b/samples/openapi3/client/petstore/ocaml-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..717311e32e3 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +unset \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ocaml-client/dune b/samples/openapi3/client/petstore/ocaml-client/dune new file mode 100644 index 00000000000..ed1c4d90e3d --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/dune @@ -0,0 +1,9 @@ +(include_subdirs unqualified) +(library + (name petstore_client) + (public_name petstore_client) + (flags (:standard -w -27)) + (libraries str cohttp-lwt-unix lwt yojson ppx_deriving_yojson.runtime) + (preprocess (pps ppx_deriving_yojson ppx_deriving.std)) + (wrapped true) +) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ocaml-client/dune-project b/samples/openapi3/client/petstore/ocaml-client/dune-project new file mode 100644 index 00000000000..79d86e3c901 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/dune-project @@ -0,0 +1,2 @@ +(lang dune 1.10) +(name petstore_client) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ocaml-client/petstore_client.opam b/samples/openapi3/client/petstore/ocaml-client/petstore_client.opam new file mode 100644 index 00000000000..3c3603c2f14 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/petstore_client.opam @@ -0,0 +1,15 @@ +opam-version: "2.0" +name: "petstore_client" +version: "1.0.0" +synopsis: "" +description: """ +Longer description +""" +maintainer: "Name " +authors: "Name " +license: "" +homepage: "" +bug-reports: "" +dev-repo: "" +depends: [ "ocaml" "ocamlfind" ] +build: ["dune" "build" "-p" name] \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/another_fake_api.ml b/samples/openapi3/client/petstore/ocaml-client/src/apis/another_fake_api.ml new file mode 100644 index 00000000000..042919109b4 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/apis/another_fake_api.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +let call_123_test_special_tags client_t = + let open Lwt in + let uri = Request.build_uri "/another-fake/dummy" in + let headers = Request.default_headers in + let body = Request.write_json_body Client.to_yojson client_t in + Cohttp_lwt_unix.Client.patch uri ~headers ~body >>= fun (_resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Client.of_yojson) body + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/another_fake_api.mli b/samples/openapi3/client/petstore/ocaml-client/src/apis/another_fake_api.mli new file mode 100644 index 00000000000..2b93c08e959 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/apis/another_fake_api.mli @@ -0,0 +1,8 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +val call_123_test_special_tags : Client.t -> Client.t Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/default_api.ml b/samples/openapi3/client/petstore/ocaml-client/src/apis/default_api.ml new file mode 100644 index 00000000000..c432362bb02 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/apis/default_api.ml @@ -0,0 +1,14 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +let foo_get () = + let open Lwt in + let uri = Request.build_uri "/foo" in + let headers = Request.default_headers in + Cohttp_lwt_unix.Client.get uri ~headers >>= fun (_resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Inline_response_default.of_yojson) body + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/default_api.mli b/samples/openapi3/client/petstore/ocaml-client/src/apis/default_api.mli new file mode 100644 index 00000000000..f1392d7621c --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/apis/default_api.mli @@ -0,0 +1,8 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +val foo_get : unit -> Inline_response_default.t Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/fake_api.ml b/samples/openapi3/client/petstore/ocaml-client/src/apis/fake_api.ml new file mode 100644 index 00000000000..5f755065062 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/apis/fake_api.ml @@ -0,0 +1,136 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +let fake_health_get () = + let open Lwt in + let uri = Request.build_uri "/fake/health" in + let headers = Request.default_headers in + Cohttp_lwt_unix.Client.get uri ~headers >>= fun (_resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Health_check_result.of_yojson) body + +let fake_outer_boolean_serialize body = + let open Lwt in + let uri = Request.build_uri "/fake/outer/boolean" in + let headers = Request.default_headers in + let body = Request.write_json_body JsonSupport.of_bool body in + Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> + Request.read_json_body_as (JsonSupport.to_bool) body + +let fake_outer_composite_serialize outer_composite_t = + let open Lwt in + let uri = Request.build_uri "/fake/outer/composite" in + let headers = Request.default_headers in + let body = Request.write_json_body Outer_composite.to_yojson outer_composite_t in + Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Outer_composite.of_yojson) body + +let fake_outer_number_serialize body = + let open Lwt in + let uri = Request.build_uri "/fake/outer/number" in + let headers = Request.default_headers in + let body = Request.write_json_body JsonSupport.of_float body in + Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> + Request.read_json_body_as (JsonSupport.to_float) body + +let fake_outer_string_serialize body = + let open Lwt in + let uri = Request.build_uri "/fake/outer/string" in + let headers = Request.default_headers in + let body = Request.write_json_body JsonSupport.of_string body in + Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> + Request.read_json_body_as (JsonSupport.to_string) body + +let test_body_with_file_schema file_schema_test_class_t = + let open Lwt in + let uri = Request.build_uri "/fake/body-with-file-schema" in + let headers = Request.default_headers in + let body = Request.write_json_body File_schema_test_class.to_yojson file_schema_test_class_t in + Cohttp_lwt_unix.Client.put uri ~headers ~body >>= fun (_resp, body) -> return () + +let test_body_with_query_params query user_t = + let open Lwt in + let uri = Request.build_uri "/fake/body-with-query-params" in + let headers = Request.default_headers in + let uri = Uri.add_query_param' uri ("query", query) in + let body = Request.write_json_body User.to_yojson user_t in + Cohttp_lwt_unix.Client.put uri ~headers ~body >>= fun (_resp, body) -> return () + +let test_client_model client_t = + let open Lwt in + let uri = Request.build_uri "/fake" in + let headers = Request.default_headers in + let body = Request.write_json_body Client.to_yojson client_t in + Cohttp_lwt_unix.Client.patch uri ~headers ~body >>= fun (_resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Client.of_yojson) body + +let test_endpoint_parameters number double pattern_without_delimiter byte integer int32 int64 float string binary date date_time password callback = + let open Lwt in + let uri = Request.build_uri "/fake" in + let headers = Request.default_headers in + let body = Request.init_form_encoded_body () in + let body = Request.add_form_encoded_body_param body ("integer", Int32.to_string integer) in + let body = Request.add_form_encoded_body_param body ("int32", Int32.to_string int32) in + let body = Request.add_form_encoded_body_param body ("int64", Int64.to_string int64) in + let body = Request.add_form_encoded_body_param body ("number", string_of_float number) in + let body = Request.add_form_encoded_body_param body ("float", string_of_float float) in + let body = Request.add_form_encoded_body_param body ("double", string_of_float double) in + let body = Request.add_form_encoded_body_param body ("string", string) in + let body = Request.add_form_encoded_body_param body ("pattern_without_delimiter", pattern_without_delimiter) in + let body = Request.add_form_encoded_body_param body ("byte", Bytes.to_string byte) in + let body = Request.add_form_encoded_body_param body ("binary", binary) in + let body = Request.add_form_encoded_body_param body ("date", date) in + let body = Request.add_form_encoded_body_param body ("date_time", date_time) in + let body = Request.add_form_encoded_body_param body ("password", password) in + let body = Request.add_form_encoded_body_param body ("callback", callback) in + let body = Request.finalize_form_encoded_body body in + Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> return () + +let test_enum_parameters enum_header_string_array enum_header_string enum_query_string_array enum_query_string enum_query_integer enum_query_double enum_form_string_array enum_form_string = + let open Lwt in + let uri = Request.build_uri "/fake" in + let headers = Request.default_headers in + let headers = Cohttp.Header.add_multi headers "enum_header_string_array" (List.map Enums.show_inline_object_2_enum_form_string_array enum_header_string_array) in + let headers = Cohttp.Header.add headers "enum_header_string" (Enums.show_enumclass enum_header_string) in + let uri = Uri.add_query_param uri ("enum_query_string_array", List.map Enums.show_inline_object_2_enum_form_string_array enum_query_string_array) in + let uri = Uri.add_query_param' uri ("enum_query_string", Enums.show_enumclass enum_query_string) in + let uri = Uri.add_query_param' uri ("enum_query_integer", Enums.show_enum_query_integer enum_query_integer) in + let uri = Uri.add_query_param' uri ("enum_query_double", Enums.show_enum_number enum_query_double) in + let body = Request.init_form_encoded_body () in + let body = Request.add_form_encoded_body_params body ("enum_form_string_array", List.map Enums.show_inline_object_2_enum_form_string_array enum_form_string_array) in + let body = Request.add_form_encoded_body_param body ("enum_form_string", Enums.show_enumclass enum_form_string) in + let body = Request.finalize_form_encoded_body body in + Cohttp_lwt_unix.Client.get uri ~headers ~body >>= fun (_resp, body) -> return () + +let test_group_parameters required_string_group required_boolean_group required_int64_group string_group boolean_group int64_group = + let open Lwt in + let uri = Request.build_uri "/fake" in + let headers = Request.default_headers in + let headers = Cohttp.Header.add headers "required_boolean_group" (string_of_bool required_boolean_group) in + let headers = Cohttp.Header.add headers "boolean_group" (string_of_bool boolean_group) in + let uri = Uri.add_query_param' uri ("required_string_group", Int32.to_string required_string_group) in + let uri = Uri.add_query_param' uri ("required_int64_group", Int64.to_string required_int64_group) in + let uri = Uri.add_query_param' uri ("string_group", Int32.to_string string_group) in + let uri = Uri.add_query_param' uri ("int64_group", Int64.to_string int64_group) in + Cohttp_lwt_unix.Client.delete uri ~headers >>= fun (_resp, body) -> return () + +let test_inline_additional_properties request_body = + let open Lwt in + let uri = Request.build_uri "/fake/inline-additionalProperties" in + let headers = Request.default_headers in + let body = Request.write_json_body (JsonSupport.of_map_of JsonSupport.of_string) request_body in + Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> return () + +let test_json_form_data param param2 = + let open Lwt in + let uri = Request.build_uri "/fake/jsonFormData" in + let headers = Request.default_headers in + let body = Request.init_form_encoded_body () in + let body = Request.add_form_encoded_body_param body ("param", param) in + let body = Request.add_form_encoded_body_param body ("param2", param2) in + let body = Request.finalize_form_encoded_body body in + Cohttp_lwt_unix.Client.get uri ~headers ~body >>= fun (_resp, body) -> return () + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/fake_api.mli b/samples/openapi3/client/petstore/ocaml-client/src/apis/fake_api.mli new file mode 100644 index 00000000000..bc6c25e2c40 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/apis/fake_api.mli @@ -0,0 +1,20 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +val fake_health_get : unit -> Health_check_result.t Lwt.t +val fake_outer_boolean_serialize : bool -> bool Lwt.t +val fake_outer_composite_serialize : Outer_composite.t -> Outer_composite.t Lwt.t +val fake_outer_number_serialize : float -> float Lwt.t +val fake_outer_string_serialize : string -> string Lwt.t +val test_body_with_file_schema : File_schema_test_class.t -> unit Lwt.t +val test_body_with_query_params : string -> User.t -> unit Lwt.t +val test_client_model : Client.t -> Client.t Lwt.t +val test_endpoint_parameters : float -> float -> string -> bytes -> int32 -> int32 -> int64 -> float -> string -> string -> string -> string -> string -> string -> unit Lwt.t +val test_enum_parameters : Enums.inline_object_2_enum_form_string_array list -> Enums.enumclass -> Enums.inline_object_2_enum_form_string_array list -> Enums.enumclass -> Enums.enum_query_integer -> Enums.enum_number -> Enums.inline_object_2_enum_form_string_array list -> Enums.enumclass -> unit Lwt.t +val test_group_parameters : int32 -> bool -> int64 -> int32 -> bool -> int64 -> unit Lwt.t +val test_inline_additional_properties : (string * string) list -> unit Lwt.t +val test_json_form_data : string -> string -> unit Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/fake_classname_tags123_api.ml b/samples/openapi3/client/petstore/ocaml-client/src/apis/fake_classname_tags123_api.ml new file mode 100644 index 00000000000..f108f7e0b20 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/apis/fake_classname_tags123_api.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +let test_classname client_t = + let open Lwt in + let uri = Request.build_uri "/fake_classname_test" in + let headers = Request.default_headers in + let body = Request.write_json_body Client.to_yojson client_t in + Cohttp_lwt_unix.Client.patch uri ~headers ~body >>= fun (_resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Client.of_yojson) body + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/fake_classname_tags123_api.mli b/samples/openapi3/client/petstore/ocaml-client/src/apis/fake_classname_tags123_api.mli new file mode 100644 index 00000000000..85059985bbe --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/apis/fake_classname_tags123_api.mli @@ -0,0 +1,8 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +val test_classname : Client.t -> Client.t Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/pet_api.ml b/samples/openapi3/client/petstore/ocaml-client/src/apis/pet_api.ml new file mode 100644 index 00000000000..9ba3f1ea0a8 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/apis/pet_api.ml @@ -0,0 +1,88 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +let add_pet pet_t = + let open Lwt in + let uri = Request.build_uri "/pet" in + let headers = Request.default_headers in + let body = Request.write_json_body Pet.to_yojson pet_t in + Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> return () + +let delete_pet pet_id api_key = + let open Lwt in + let uri = Request.build_uri "/pet/{petId}" in + let headers = Request.default_headers in + let headers = Cohttp.Header.add headers "api_key" (api_key) in + let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in + Cohttp_lwt_unix.Client.delete uri ~headers >>= fun (_resp, body) -> return () + +let find_pets_by_status status = + let open Lwt in + let uri = Request.build_uri "/pet/findByStatus" in + let headers = Request.default_headers in + let uri = Uri.add_query_param uri ("status", List.map Enums.show_pet_status status) in + Cohttp_lwt_unix.Client.get uri ~headers >>= fun (_resp, body) -> + Request.read_json_body_as_list_of (JsonSupport.unwrap Pet.of_yojson) body + +let find_pets_by_tags tags = + let open Lwt in + let uri = Request.build_uri "/pet/findByTags" in + let headers = Request.default_headers in + let uri = Uri.add_query_param uri ("tags", tags) in + Cohttp_lwt_unix.Client.get uri ~headers >>= fun (_resp, body) -> + Request.read_json_body_as_list_of (JsonSupport.unwrap Pet.of_yojson) body + +let get_pet_by_id pet_id = + let open Lwt in + let uri = Request.build_uri "/pet/{petId}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in + Cohttp_lwt_unix.Client.get uri ~headers >>= fun (_resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Pet.of_yojson) body + +let update_pet pet_t = + let open Lwt in + let uri = Request.build_uri "/pet" in + let headers = Request.default_headers in + let body = Request.write_json_body Pet.to_yojson pet_t in + Cohttp_lwt_unix.Client.put uri ~headers ~body >>= fun (_resp, body) -> return () + +let update_pet_with_form pet_id name status = + let open Lwt in + let uri = Request.build_uri "/pet/{petId}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in + let body = Request.init_form_encoded_body () in + let body = Request.add_form_encoded_body_param body ("name", name) in + let body = Request.add_form_encoded_body_param body ("status", status) in + let body = Request.finalize_form_encoded_body body in + Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> return () + +let upload_file pet_id additional_metadata file = + let open Lwt in + let uri = Request.build_uri "/pet/{petId}/uploadImage" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in + let body = Request.init_form_encoded_body () in + let body = Request.add_form_encoded_body_param body ("additional_metadata", additional_metadata) in + let body = Request.add_form_encoded_body_param body ("file", file) in + let body = Request.finalize_form_encoded_body body in + Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Api_response.of_yojson) body + +let upload_file_with_required_file pet_id required_file additional_metadata = + let open Lwt in + let uri = Request.build_uri "/fake/{petId}/uploadImageWithRequiredFile" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in + let body = Request.init_form_encoded_body () in + let body = Request.add_form_encoded_body_param body ("additional_metadata", additional_metadata) in + let body = Request.add_form_encoded_body_param body ("required_file", required_file) in + let body = Request.finalize_form_encoded_body body in + Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Api_response.of_yojson) body + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/pet_api.mli b/samples/openapi3/client/petstore/ocaml-client/src/apis/pet_api.mli new file mode 100644 index 00000000000..a1036b6c3c7 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/apis/pet_api.mli @@ -0,0 +1,16 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +val add_pet : Pet.t -> unit Lwt.t +val delete_pet : int64 -> string -> unit Lwt.t +val find_pets_by_status : Enums.pet_status list -> Pet.t list Lwt.t +val find_pets_by_tags : string list -> Pet.t list Lwt.t +val get_pet_by_id : int64 -> Pet.t Lwt.t +val update_pet : Pet.t -> unit Lwt.t +val update_pet_with_form : int64 -> string -> string -> unit Lwt.t +val upload_file : int64 -> string -> string -> Api_response.t Lwt.t +val upload_file_with_required_file : int64 -> string -> string -> Api_response.t Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/store_api.ml b/samples/openapi3/client/petstore/ocaml-client/src/apis/store_api.ml new file mode 100644 index 00000000000..79cc1ccc0ea --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/apis/store_api.ml @@ -0,0 +1,37 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +let delete_order order_id = + let open Lwt in + let uri = Request.build_uri "/store/order/{order_id}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "order_id" (order_id) in + Cohttp_lwt_unix.Client.delete uri ~headers >>= fun (_resp, body) -> return () + +let get_inventory () = + let open Lwt in + let uri = Request.build_uri "/store/inventory" in + let headers = Request.default_headers in + Cohttp_lwt_unix.Client.get uri ~headers >>= fun (_resp, body) -> + Request.read_json_body_as_map_of (JsonSupport.to_int32) body + +let get_order_by_id order_id = + let open Lwt in + let uri = Request.build_uri "/store/order/{order_id}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "order_id" (Int64.to_string order_id) in + Cohttp_lwt_unix.Client.get uri ~headers >>= fun (_resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Order.of_yojson) body + +let place_order order_t = + let open Lwt in + let uri = Request.build_uri "/store/order" in + let headers = Request.default_headers in + let body = Request.write_json_body Order.to_yojson order_t in + Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Order.of_yojson) body + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/store_api.mli b/samples/openapi3/client/petstore/ocaml-client/src/apis/store_api.mli new file mode 100644 index 00000000000..bc3c93eb494 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/apis/store_api.mli @@ -0,0 +1,11 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +val delete_order : string -> unit Lwt.t +val get_inventory : unit -> (string * int32) list Lwt.t +val get_order_by_id : int64 -> Order.t Lwt.t +val place_order : Order.t -> Order.t Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/user_api.ml b/samples/openapi3/client/petstore/ocaml-client/src/apis/user_api.ml new file mode 100644 index 00000000000..d9499ee070e --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/apis/user_api.ml @@ -0,0 +1,66 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +let create_user user_t = + let open Lwt in + let uri = Request.build_uri "/user" in + let headers = Request.default_headers in + let body = Request.write_json_body User.to_yojson user_t in + Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> return () + +let create_users_with_array_input user = + let open Lwt in + let uri = Request.build_uri "/user/createWithArray" in + let headers = Request.default_headers in + let body = Request.write_json_body (JsonSupport.of_list_of User.to_yojson) user in + Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> return () + +let create_users_with_list_input user = + let open Lwt in + let uri = Request.build_uri "/user/createWithList" in + let headers = Request.default_headers in + let body = Request.write_json_body (JsonSupport.of_list_of User.to_yojson) user in + Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> return () + +let delete_user username = + let open Lwt in + let uri = Request.build_uri "/user/{username}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "username" (username) in + Cohttp_lwt_unix.Client.delete uri ~headers >>= fun (_resp, body) -> return () + +let get_user_by_name username = + let open Lwt in + let uri = Request.build_uri "/user/{username}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "username" (username) in + Cohttp_lwt_unix.Client.get uri ~headers >>= fun (_resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap User.of_yojson) body + +let login_user username password = + let open Lwt in + let uri = Request.build_uri "/user/login" in + let headers = Request.default_headers in + let uri = Uri.add_query_param' uri ("username", username) in + let uri = Uri.add_query_param' uri ("password", password) in + Cohttp_lwt_unix.Client.get uri ~headers >>= fun (_resp, body) -> + Request.read_json_body_as (JsonSupport.to_string) body + +let logout_user () = + let open Lwt in + let uri = Request.build_uri "/user/logout" in + let headers = Request.default_headers in + Cohttp_lwt_unix.Client.get uri ~headers >>= fun (_resp, body) -> return () + +let update_user username user_t = + let open Lwt in + let uri = Request.build_uri "/user/{username}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "username" (username) in + let body = Request.write_json_body User.to_yojson user_t in + Cohttp_lwt_unix.Client.put uri ~headers ~body >>= fun (_resp, body) -> return () + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/user_api.mli b/samples/openapi3/client/petstore/ocaml-client/src/apis/user_api.mli new file mode 100644 index 00000000000..5191a2ea41b --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/apis/user_api.mli @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +val create_user : User.t -> unit Lwt.t +val create_users_with_array_input : User.t list -> unit Lwt.t +val create_users_with_list_input : User.t list -> unit Lwt.t +val delete_user : string -> unit Lwt.t +val get_user_by_name : string -> User.t Lwt.t +val login_user : string -> string -> string Lwt.t +val logout_user : unit -> unit Lwt.t +val update_user : string -> User.t -> unit Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/additional_properties_class.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/additional_properties_class.ml new file mode 100644 index 00000000000..8e5f7b075f9 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/additional_properties_class.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + map_property: (string * string) list; + map_of_map_property: (string * (string * string) list) list; +} [@@deriving yojson, show ];; + +let create () : t = { + map_property = []; + map_of_map_property = []; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/animal.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/animal.ml new file mode 100644 index 00000000000..637ecdf60a9 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/animal.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + class_name: string; + color: string option; +} [@@deriving yojson, show ];; + +let create (class_name : string) : t = { + class_name = class_name; + color = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/api_response.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/api_response.ml new file mode 100644 index 00000000000..3f23662e01a --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/api_response.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + code: int32 option; + _type: string option; + message: string option; +} [@@deriving yojson, show ];; + +let create () : t = { + code = None; + _type = None; + message = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/array_of_array_of_number_only.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/array_of_array_of_number_only.ml new file mode 100644 index 00000000000..2204bac4b6c --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/array_of_array_of_number_only.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + array_array_number: float list list; +} [@@deriving yojson, show ];; + +let create () : t = { + array_array_number = []; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/array_of_number_only.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/array_of_number_only.ml new file mode 100644 index 00000000000..3708294193e --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/array_of_number_only.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + array_number: float list; +} [@@deriving yojson, show ];; + +let create () : t = { + array_number = []; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/array_test.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/array_test.ml new file mode 100644 index 00000000000..6198edd88a6 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/array_test.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + array_of_string: string list; + array_array_of_integer: int64 list list; + array_array_of_model: Read_only_first.t list list; +} [@@deriving yojson, show ];; + +let create () : t = { + array_of_string = []; + array_array_of_integer = []; + array_array_of_model = []; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/capitalization.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/capitalization.ml new file mode 100644 index 00000000000..c75a3e4574b --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/capitalization.ml @@ -0,0 +1,26 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + small_camel: string option; + capital_camel: string option; + small_snake: string option; + capital_snake: string option; + sca_eth_flow_points: string option; + (* Name of the pet *) + att_name: string option; +} [@@deriving yojson, show ];; + +let create () : t = { + small_camel = None; + capital_camel = None; + small_snake = None; + capital_snake = None; + sca_eth_flow_points = None; + att_name = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/cat.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/cat.ml new file mode 100644 index 00000000000..1d79ca8716f --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/cat.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + class_name: string; + color: string option; + declawed: bool option; +} [@@deriving yojson, show ];; + +let create (class_name : string) : t = { + class_name = class_name; + color = None; + declawed = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/cat_all_of.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/cat_all_of.ml new file mode 100644 index 00000000000..d0c18e1a505 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/cat_all_of.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + declawed: bool option; +} [@@deriving yojson, show ];; + +let create () : t = { + declawed = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/category.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/category.ml new file mode 100644 index 00000000000..fdace8a8372 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/category.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + id: int64 option; + name: string; +} [@@deriving yojson, show ];; + +let create (name : string) : t = { + id = None; + name = name; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/class_model.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/class_model.ml new file mode 100644 index 00000000000..8023b7cdcbd --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/class_model.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema Class_model.t : Model for testing model with \\"_class\\" property + *) + +type t = { + _class: string option; +} [@@deriving yojson, show ];; + +(** Model for testing model with \\"_class\\" property *) +let create () : t = { + _class = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/client.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/client.ml new file mode 100644 index 00000000000..259a2b3c139 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/client.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + client: string option; +} [@@deriving yojson, show ];; + +let create () : t = { + client = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/dog.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/dog.ml new file mode 100644 index 00000000000..ceaa4b66b7d --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/dog.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + class_name: string; + color: string option; + breed: string option; +} [@@deriving yojson, show ];; + +let create (class_name : string) : t = { + class_name = class_name; + color = None; + breed = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/dog_all_of.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/dog_all_of.ml new file mode 100644 index 00000000000..7bbf7ec7275 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/dog_all_of.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + breed: string option; +} [@@deriving yojson, show ];; + +let create () : t = { + breed = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/enum_arrays.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/enum_arrays.ml new file mode 100644 index 00000000000..5dc755407d1 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/enum_arrays.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + just_symbol: Enums.just_symbol option; + array_enum: Enums.enumarrays_array_enum list; +} [@@deriving yojson, show ];; + +let create () : t = { + just_symbol = None; + array_enum = []; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/enum_test.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/enum_test.ml new file mode 100644 index 00000000000..5a92f51ff70 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/enum_test.ml @@ -0,0 +1,29 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + enum_string: Enums.enum_string option; + enum_string_required: Enums.enum_string; + enum_integer: Enums.enum_integer option; + enum_number: Enums.enum_number option; + outer_enum: Enums.status option; + outer_enum_integer: Enums.outerenuminteger option; + outer_enum_default_value: Enums.status option; + outer_enum_integer_default_value: Enums.outerenuminteger option; +} [@@deriving yojson, show ];; + +let create (enum_string_required : Enums.enum_string) : t = { + enum_string = None; + enum_string_required = enum_string_required; + enum_integer = None; + enum_number = None; + outer_enum = None; + outer_enum_integer = None; + outer_enum_default_value = None; + outer_enum_integer_default_value = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/file.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/file.ml new file mode 100644 index 00000000000..fd79bb76abf --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/file.ml @@ -0,0 +1,18 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema File.t : Must be named `File` for test. + *) + +type t = { + (* Test capitalization *) + source_uri: string option; +} [@@deriving yojson, show ];; + +(** Must be named `File` for test. *) +let create () : t = { + source_uri = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/file_schema_test_class.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/file_schema_test_class.ml new file mode 100644 index 00000000000..b0938b230f2 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/file_schema_test_class.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + file: File.t option; + files: File.t list; +} [@@deriving yojson, show ];; + +let create () : t = { + file = None; + files = []; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/foo.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/foo.ml new file mode 100644 index 00000000000..e4d05a7971a --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/foo.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + bar: string option; +} [@@deriving yojson, show ];; + +let create () : t = { + bar = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/format_test.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/format_test.ml new file mode 100644 index 00000000000..1a5b28c9af2 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/format_test.ml @@ -0,0 +1,45 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + integer: int32 option; + int32: int32 option; + int64: int64 option; + number: float; + float: float option; + double: float option; + string: string option; + byte: bytes; + binary: string option; + date: string; + date_time: string option; + uuid: string option; + password: string; + (* A string that is a 10 digit number. Can have leading zeros. *) + pattern_with_digits: string option; + (* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. *) + pattern_with_digits_and_delimiter: string option; +} [@@deriving yojson, show ];; + +let create (number : float) (byte : bytes) (date : string) (password : string) : t = { + integer = None; + int32 = None; + int64 = None; + number = number; + float = None; + double = None; + string = None; + byte = byte; + binary = None; + date = date; + date_time = None; + uuid = None; + password = password; + pattern_with_digits = None; + pattern_with_digits_and_delimiter = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/has_only_read_only.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/has_only_read_only.ml new file mode 100644 index 00000000000..f1fb4c639c9 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/has_only_read_only.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + bar: string option; + foo: string option; +} [@@deriving yojson, show ];; + +let create () : t = { + bar = None; + foo = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/health_check_result.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/health_check_result.ml new file mode 100644 index 00000000000..6103f54fa2c --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/health_check_result.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema Health_check_result.t : Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + *) + +type t = { + nullable_message: string option; +} [@@deriving yojson, show ];; + +(** Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. *) +let create () : t = { + nullable_message = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object.ml new file mode 100644 index 00000000000..092a7bca691 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + (* Updated name of the pet *) + name: string option; + (* Updated status of the pet *) + status: string option; +} [@@deriving yojson, show ];; + +let create () : t = { + name = None; + status = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_1.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_1.ml new file mode 100644 index 00000000000..be3c829f5e0 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_1.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + (* Additional data to pass to server *) + additional_metadata: string option; + (* file to upload *) + file: string option; +} [@@deriving yojson, show ];; + +let create () : t = { + additional_metadata = None; + file = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_2.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_2.ml new file mode 100644 index 00000000000..433587a195c --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_2.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + (* Form parameter enum test (string array) *) + enum_form_string_array: Enums.inline_object_2_enum_form_string_array list; + (* Form parameter enum test (string) *) + enum_form_string: Enums.enumclass option; +} [@@deriving yojson, show ];; + +let create () : t = { + enum_form_string_array = []; + enum_form_string = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_3.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_3.ml new file mode 100644 index 00000000000..9ae5a0c464d --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_3.ml @@ -0,0 +1,55 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + (* None *) + integer: int32 option; + (* None *) + int32: int32 option; + (* None *) + int64: int64 option; + (* None *) + number: float; + (* None *) + float: float option; + (* None *) + double: float; + (* None *) + string: string option; + (* None *) + pattern_without_delimiter: string; + (* None *) + byte: bytes; + (* None *) + binary: string option; + (* None *) + date: string option; + (* None *) + date_time: string option; + (* None *) + password: string option; + (* None *) + callback: string option; +} [@@deriving yojson, show ];; + +let create (number : float) (double : float) (pattern_without_delimiter : string) (byte : bytes) : t = { + integer = None; + int32 = None; + int64 = None; + number = number; + float = None; + double = double; + string = None; + pattern_without_delimiter = pattern_without_delimiter; + byte = byte; + binary = None; + date = None; + date_time = None; + password = None; + callback = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_4.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_4.ml new file mode 100644 index 00000000000..1291f3285ed --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_4.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + (* field1 *) + param: string; + (* field2 *) + param2: string; +} [@@deriving yojson, show ];; + +let create (param : string) (param2 : string) : t = { + param = param; + param2 = param2; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_5.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_5.ml new file mode 100644 index 00000000000..9e4f0b04b27 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_5.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + (* Additional data to pass to server *) + additional_metadata: string option; + (* file to upload *) + required_file: string; +} [@@deriving yojson, show ];; + +let create (required_file : string) : t = { + additional_metadata = None; + required_file = required_file; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/inline_response_default.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/inline_response_default.ml new file mode 100644 index 00000000000..c5b36a2ffd4 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/inline_response_default.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + string: Foo.t option; +} [@@deriving yojson, show ];; + +let create () : t = { + string = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/map_test.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/map_test.ml new file mode 100644 index 00000000000..8b463f70791 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/map_test.ml @@ -0,0 +1,21 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + map_map_of_string: (string * (string * string) list) list; + map_of_enum_string: (string * Enums.maptest_map_of_enum_string) list; + direct_map: (string * bool) list; + indirect_map: (string * bool) list; +} [@@deriving yojson, show ];; + +let create () : t = { + map_map_of_string = []; + map_of_enum_string = []; + direct_map = []; + indirect_map = []; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/mixed_properties_and_additional_properties_class.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/mixed_properties_and_additional_properties_class.ml new file mode 100644 index 00000000000..3cae9de2711 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/mixed_properties_and_additional_properties_class.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + uuid: string option; + date_time: string option; + map: (string * Animal.t) list; +} [@@deriving yojson, show ];; + +let create () : t = { + uuid = None; + date_time = None; + map = []; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/model_200_response.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/model_200_response.ml new file mode 100644 index 00000000000..f8065e45dfc --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/model_200_response.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema Model_200_response.t : Model for testing model name starting with number + *) + +type t = { + name: int32 option; + _class: string option; +} [@@deriving yojson, show ];; + +(** Model for testing model name starting with number *) +let create () : t = { + name = None; + _class = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/model__special_model_name_.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/model__special_model_name_.ml new file mode 100644 index 00000000000..5e70029989c --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/model__special_model_name_.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + special_property_name: int64 option; +} [@@deriving yojson, show ];; + +let create () : t = { + special_property_name = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/name.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/name.ml new file mode 100644 index 00000000000..6a8377a933d --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/name.ml @@ -0,0 +1,23 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema Name.t : Model for testing model name same as property name + *) + +type t = { + name: int32; + snake_case: int32 option; + property: string option; + var_123_number: int32 option; +} [@@deriving yojson, show ];; + +(** Model for testing model name same as property name *) +let create (name : int32) : t = { + name = name; + snake_case = None; + property = None; + var_123_number = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/nullable_class.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/nullable_class.ml new file mode 100644 index 00000000000..1787dd6dd00 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/nullable_class.ml @@ -0,0 +1,37 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + integer_prop: int32 option; + number_prop: float option; + boolean_prop: bool option; + string_prop: string option; + date_prop: string option; + datetime_prop: string option; + array_nullable_prop: Yojson.Safe.t list; + array_and_items_nullable_prop: Yojson.Safe.t list; + array_items_nullable: Yojson.Safe.t list; + object_nullable_prop: (string * Yojson.Safe.t) list; + object_and_items_nullable_prop: (string * Yojson.Safe.t) list; + object_items_nullable: (string * Yojson.Safe.t) list; +} [@@deriving yojson, show ];; + +let create () : t = { + integer_prop = None; + number_prop = None; + boolean_prop = None; + string_prop = None; + date_prop = None; + datetime_prop = None; + array_nullable_prop = []; + array_and_items_nullable_prop = []; + array_items_nullable = []; + object_nullable_prop = []; + object_and_items_nullable_prop = []; + object_items_nullable = []; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/number_only.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/number_only.ml new file mode 100644 index 00000000000..db1cefc7ef1 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/number_only.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + just_number: float option; +} [@@deriving yojson, show ];; + +let create () : t = { + just_number = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/order.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/order.ml new file mode 100644 index 00000000000..b2325d39c1e --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/order.ml @@ -0,0 +1,26 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + id: int64 option; + pet_id: int64 option; + quantity: int32 option; + ship_date: string option; + (* Order Status *) + status: Enums.status option; + complete: bool option; +} [@@deriving yojson, show ];; + +let create () : t = { + id = None; + pet_id = None; + quantity = None; + ship_date = None; + status = None; + complete = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/outer_composite.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/outer_composite.ml new file mode 100644 index 00000000000..82aa40fedd8 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/outer_composite.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + my_number: float option; + my_string: string option; + my_boolean: bool option; +} [@@deriving yojson, show ];; + +let create () : t = { + my_number = None; + my_string = None; + my_boolean = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/pet.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/pet.ml new file mode 100644 index 00000000000..05a7481357c --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/pet.ml @@ -0,0 +1,26 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + id: int64 option; + category: Category.t option; + name: string; + photo_urls: string list; + tags: Tag.t list; + (* pet status in the store *) + status: Enums.pet_status option; +} [@@deriving yojson, show ];; + +let create (name : string) (photo_urls : string list) : t = { + id = None; + category = None; + name = name; + photo_urls = photo_urls; + tags = []; + status = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/read_only_first.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/read_only_first.ml new file mode 100644 index 00000000000..c44891ba066 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/read_only_first.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + bar: string option; + baz: string option; +} [@@deriving yojson, show ];; + +let create () : t = { + bar = None; + baz = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/return.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/return.ml new file mode 100644 index 00000000000..73f59b66e3c --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/return.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema Return.t : Model for testing reserved words + *) + +type t = { + return: int32 option; +} [@@deriving yojson, show ];; + +(** Model for testing reserved words *) +let create () : t = { + return = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/tag.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/tag.ml new file mode 100644 index 00000000000..00f8072ef9c --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/tag.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + id: int64 option; + name: string option; +} [@@deriving yojson, show ];; + +let create () : t = { + id = None; + name = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/user.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/user.ml new file mode 100644 index 00000000000..2791779acad --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/models/user.ml @@ -0,0 +1,30 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + id: int64 option; + username: string option; + first_name: string option; + last_name: string option; + email: string option; + password: string option; + phone: string option; + (* User Status *) + user_status: int32 option; +} [@@deriving yojson, show ];; + +let create () : t = { + id = None; + username = None; + first_name = None; + last_name = None; + email = None; + password = None; + phone = None; + user_status = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml-client/src/support/enums.ml b/samples/openapi3/client/petstore/ocaml-client/src/support/enums.ml new file mode 100644 index 00000000000..13e0e6d0064 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/support/enums.ml @@ -0,0 +1,142 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type outerenuminteger = [ +| `_0 [@printer fun fmt _ -> Format.pp_print_string fmt "0"] [@name "0"] +| `_1 [@printer fun fmt _ -> Format.pp_print_string fmt "1"] [@name "1"] +| `_2 [@printer fun fmt _ -> Format.pp_print_string fmt "2"] [@name "2"] +] [@@deriving yojson, show { with_path = false }];; + +let outerenuminteger_of_yojson json = outerenuminteger_of_yojson (`List [json]) +let outerenuminteger_to_yojson e = + match outerenuminteger_to_yojson e with + | `List [json] -> json + | json -> json + +type status = [ +| `Placed [@printer fun fmt _ -> Format.pp_print_string fmt "placed"] [@name "placed"] +| `Approved [@printer fun fmt _ -> Format.pp_print_string fmt "approved"] [@name "approved"] +| `Delivered [@printer fun fmt _ -> Format.pp_print_string fmt "delivered"] [@name "delivered"] +] [@@deriving yojson, show { with_path = false }];; + +let status_of_yojson json = status_of_yojson (`List [json]) +let status_to_yojson e = + match status_to_yojson e with + | `List [json] -> json + | json -> json + +type inline_object_2_enum_form_string_array = [ +| `Greater_Than [@printer fun fmt _ -> Format.pp_print_string fmt ">"] [@name ">"] +| `Dollar [@printer fun fmt _ -> Format.pp_print_string fmt "$"] [@name "$"] +] [@@deriving yojson, show { with_path = false }];; + +let inline_object_2_enum_form_string_array_of_yojson json = inline_object_2_enum_form_string_array_of_yojson (`List [json]) +let inline_object_2_enum_form_string_array_to_yojson e = + match inline_object_2_enum_form_string_array_to_yojson e with + | `List [json] -> json + | json -> json + +type enum_query_integer = [ +| `_1 [@printer fun fmt _ -> Format.pp_print_string fmt "1"] [@name "1"] +| `Minus2 [@printer fun fmt _ -> Format.pp_print_string fmt "-2"] [@name "-2"] +] [@@deriving yojson, show { with_path = false }];; + +let enum_query_integer_of_yojson json = enum_query_integer_of_yojson (`List [json]) +let enum_query_integer_to_yojson e = + match enum_query_integer_to_yojson e with + | `List [json] -> json + | json -> json + +type enum_number = [ +| `_1Period1 [@printer fun fmt _ -> Format.pp_print_string fmt "1.1"] [@name "1.1"] +| `Minus1Period2 [@printer fun fmt _ -> Format.pp_print_string fmt "-1.2"] [@name "-1.2"] +] [@@deriving yojson, show { with_path = false }];; + +let enum_number_of_yojson json = enum_number_of_yojson (`List [json]) +let enum_number_to_yojson e = + match enum_number_to_yojson e with + | `List [json] -> json + | json -> json + +type maptest_map_of_enum_string = [ +| `UPPER [@printer fun fmt _ -> Format.pp_print_string fmt "UPPER"] [@name "UPPER"] +| `Lower [@printer fun fmt _ -> Format.pp_print_string fmt "lower"] [@name "lower"] +] [@@deriving yojson, show { with_path = false }];; + +let maptest_map_of_enum_string_of_yojson json = maptest_map_of_enum_string_of_yojson (`List [json]) +let maptest_map_of_enum_string_to_yojson e = + match maptest_map_of_enum_string_to_yojson e with + | `List [json] -> json + | json -> json + +type enum_integer = [ +| `_1 [@printer fun fmt _ -> Format.pp_print_string fmt "1"] [@name "1"] +| `Minus1 [@printer fun fmt _ -> Format.pp_print_string fmt "-1"] [@name "-1"] +] [@@deriving yojson, show { with_path = false }];; + +let enum_integer_of_yojson json = enum_integer_of_yojson (`List [json]) +let enum_integer_to_yojson e = + match enum_integer_to_yojson e with + | `List [json] -> json + | json -> json + +type just_symbol = [ +| `Greater_ThanEqual [@printer fun fmt _ -> Format.pp_print_string fmt ">="] [@name ">="] +| `Dollar [@printer fun fmt _ -> Format.pp_print_string fmt "$"] [@name "$"] +] [@@deriving yojson, show { with_path = false }];; + +let just_symbol_of_yojson json = just_symbol_of_yojson (`List [json]) +let just_symbol_to_yojson e = + match just_symbol_to_yojson e with + | `List [json] -> json + | json -> json + +type enumarrays_array_enum = [ +| `Fish [@printer fun fmt _ -> Format.pp_print_string fmt "fish"] [@name "fish"] +| `Crab [@printer fun fmt _ -> Format.pp_print_string fmt "crab"] [@name "crab"] +] [@@deriving yojson, show { with_path = false }];; + +let enumarrays_array_enum_of_yojson json = enumarrays_array_enum_of_yojson (`List [json]) +let enumarrays_array_enum_to_yojson e = + match enumarrays_array_enum_to_yojson e with + | `List [json] -> json + | json -> json + +type pet_status = [ +| `Available [@printer fun fmt _ -> Format.pp_print_string fmt "available"] [@name "available"] +| `Pending [@printer fun fmt _ -> Format.pp_print_string fmt "pending"] [@name "pending"] +| `Sold [@printer fun fmt _ -> Format.pp_print_string fmt "sold"] [@name "sold"] +] [@@deriving yojson, show { with_path = false }];; + +let pet_status_of_yojson json = pet_status_of_yojson (`List [json]) +let pet_status_to_yojson e = + match pet_status_to_yojson e with + | `List [json] -> json + | json -> json + +type enumclass = [ +| `Underscoreabc [@printer fun fmt _ -> Format.pp_print_string fmt "_abc"] [@name "_abc"] +| `Minusefg [@printer fun fmt _ -> Format.pp_print_string fmt "-efg"] [@name "-efg"] +| `Left_ParenthesisxyzRight_Parenthesis [@printer fun fmt _ -> Format.pp_print_string fmt "(xyz)"] [@name "(xyz)"] +] [@@deriving yojson, show { with_path = false }];; + +let enumclass_of_yojson json = enumclass_of_yojson (`List [json]) +let enumclass_to_yojson e = + match enumclass_to_yojson e with + | `List [json] -> json + | json -> json + +type enum_string = [ +| `UPPER [@printer fun fmt _ -> Format.pp_print_string fmt "UPPER"] [@name "UPPER"] +| `Lower [@printer fun fmt _ -> Format.pp_print_string fmt "lower"] [@name "lower"] +] [@@deriving yojson, show { with_path = false }];; + +let enum_string_of_yojson json = enum_string_of_yojson (`List [json]) +let enum_string_to_yojson e = + match enum_string_to_yojson e with + | `List [json] -> json + | json -> json diff --git a/samples/openapi3/client/petstore/ocaml-client/src/support/jsonSupport.ml b/samples/openapi3/client/petstore/ocaml-client/src/support/jsonSupport.ml new file mode 100644 index 00000000000..4b0fac77545 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/support/jsonSupport.ml @@ -0,0 +1,55 @@ +open Ppx_deriving_yojson_runtime + +let unwrap to_json json = + match to_json json with + | Result.Ok json -> json + | Result.Error s -> failwith s + +let to_int json = + match json with + | `Int x -> x + | `Intlit s -> int_of_string s + | _ -> failwith "JsonSupport.to_int" + +let to_bool json = + match json with + | `Bool x -> x + | _ -> failwith "JsonSupport.to_bool" + +let to_float json = + match json with + | `Float x -> x + | _ -> failwith "JsonSupport.to_float" + +let to_string json = + match json with + | `String s -> s + | _ -> failwith "JsonSupport.to_string" + +let to_int32 json : int32 = + match json with + | `Int x -> Int32.of_int x + | `Intlit s -> Int32.of_string s + | _ -> failwith "JsonSupport.to_int32" + +let to_int64 json : int64 = + match json with + | `Int x -> Int64.of_int x + | `Intlit s -> Int64.of_string s + | _ -> failwith "JsonSupport.to_int64" + +let of_int x = `Int x + +let of_bool b = `Bool b + +let of_float x = `Float x + +let of_string s = `String s + +let of_int32 x = `Intlit (Int32.to_string x) + +let of_int64 x = `Intlit (Int64.to_string x) + +let of_list_of of_f l = `List (List.map of_f l) + +let of_map_of of_f l = `Assoc (List.map (fun (k, v) -> (k, of_f v)) l) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ocaml-client/src/support/request.ml b/samples/openapi3/client/petstore/ocaml-client/src/support/request.ml new file mode 100644 index 00000000000..5f864b36583 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml-client/src/support/request.ml @@ -0,0 +1,39 @@ +let base_url = "http://petstore.swagger.io:80/v2" +let default_headers = Cohttp.Header.init_with "Content-Type" "application/json" + +let build_uri operation_path = Uri.of_string (base_url ^ operation_path) +let write_json_body to_json payload = + to_json payload |> Yojson.Safe.to_string ~std:true |> Cohttp_lwt.Body.of_string + +let read_json_body body = + Lwt.(Cohttp_lwt.Body.to_string body >|= Yojson.Safe.from_string) + +let read_json_body_as of_json body = + Lwt.(read_json_body body >|= of_json) + +let read_json_body_as_list body = + Lwt.(read_json_body body >|= Yojson.Safe.Util.to_list) + +let read_json_body_as_list_of of_json body = + Lwt.(read_json_body_as_list body >|= List.map of_json) + +let read_json_body_as_map_of of_json body = + Lwt.(read_json_body body >|= Yojson.Safe.Util.to_assoc >|= List.map (fun (s, v) -> (s, of_json v))) + +let replace_path_param uri param_name param_value = + let regexp = Str.regexp (Str.quote ("{" ^ param_name ^ "}")) in + let path = Str.global_replace regexp param_value (Uri.path uri) in + Uri.with_path uri path + +let init_form_encoded_body () = "" + +let add_form_encoded_body_param params (paramName, paramValue) = + let new_param_enc = Printf.sprintf {|%s=%s|} (Uri.pct_encode paramName) (Uri.pct_encode paramValue) in + if params = "" + then new_param_enc + else Printf.sprintf {|%s&%s|} params new_param_enc + +let add_form_encoded_body_params params (paramName, new_params) = + add_form_encoded_body_param params (paramName, String.concat "," new_params) + +let finalize_form_encoded_body body = Cohttp_lwt.Body.of_string body \ No newline at end of file From 6e3176557c162e793eca2d2597f4fc668e905152 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 29 Jul 2019 10:07:32 +0800 Subject: [PATCH 05/75] [OCaml] various enhancements (#3483) * add ocaml template creator * various enhancement to ocaml generator * update instruction * update doc * remove readme * add back readme --- README.md | 3 +- ...l-client-petstore.sh => ocaml-petstore.sh} | 4 +- bin/windows/ocaml-petstore.bat | 10 +++ docs/generators.md | 2 +- docs/generators/ocaml.md | 13 +++ .../codegen/languages/OCamlClientCodegen.java | 15 ++-- .../{ocaml-client => ocaml}/api-impl.mustache | 0 .../{ocaml-client => ocaml}/api-intf.mustache | 0 .../dune-project.mustache | 0 .../{ocaml-client => ocaml}/dune.mustache | 0 .../{ocaml-client => ocaml}/enums.mustache | 0 .../{ocaml-client => ocaml}/json.mustache | 0 .../{ocaml-client => ocaml}/lib.mustache | 0 .../{ocaml-client => ocaml}/model.mustache | 0 .../{ocaml-client => ocaml}/of_json.mustache | 0 .../partial_header.mustache | 0 .../src/main/resources/ocaml/readme.mustache | 35 ++++++++ .../{ocaml-client => ocaml}/support.mustache | 0 .../{ocaml-client => ocaml}/to_json.mustache | 0 .../to_string.mustache | 0 .../petstore/ocaml/.openapi-generator-ignore | 23 ++++++ .../petstore/ocaml/.openapi-generator/VERSION | 1 + samples/client/petstore/ocaml/README.md | 26 ++++++ samples/client/petstore/ocaml/dune | 9 +++ samples/client/petstore/ocaml/dune-project | 2 + .../petstore/ocaml/petstore_client.opam | 15 ++++ .../client/petstore/ocaml/src/apis/pet_api.ml | 80 +++++++++++++++++++ .../petstore/ocaml/src/apis/pet_api.mli | 15 ++++ .../petstore/ocaml/src/apis/store_api.ml | 38 +++++++++ .../petstore/ocaml/src/apis/store_api.mli | 11 +++ .../petstore/ocaml/src/apis/user_api.ml | 72 +++++++++++++++++ .../petstore/ocaml/src/apis/user_api.mli | 15 ++++ .../petstore/ocaml/src/models/api_response.ml | 21 +++++ .../petstore/ocaml/src/models/category.ml | 19 +++++ .../client/petstore/ocaml/src/models/order.ml | 28 +++++++ .../client/petstore/ocaml/src/models/pet.ml | 28 +++++++ .../client/petstore/ocaml/src/models/tag.ml | 19 +++++ .../client/petstore/ocaml/src/models/user.ml | 32 ++++++++ .../petstore/ocaml/src/support/enums.ml | 30 +++++++ .../petstore/ocaml/src/support/jsonSupport.ml | 55 +++++++++++++ .../petstore/ocaml/src/support/request.ml | 48 +++++++++++ 41 files changed, 658 insertions(+), 11 deletions(-) rename bin/{ocaml-client-petstore.sh => ocaml-petstore.sh} (71%) create mode 100755 bin/windows/ocaml-petstore.bat create mode 100644 docs/generators/ocaml.md rename modules/openapi-generator/src/main/resources/{ocaml-client => ocaml}/api-impl.mustache (100%) rename modules/openapi-generator/src/main/resources/{ocaml-client => ocaml}/api-intf.mustache (100%) rename modules/openapi-generator/src/main/resources/{ocaml-client => ocaml}/dune-project.mustache (100%) rename modules/openapi-generator/src/main/resources/{ocaml-client => ocaml}/dune.mustache (100%) rename modules/openapi-generator/src/main/resources/{ocaml-client => ocaml}/enums.mustache (100%) rename modules/openapi-generator/src/main/resources/{ocaml-client => ocaml}/json.mustache (100%) rename modules/openapi-generator/src/main/resources/{ocaml-client => ocaml}/lib.mustache (100%) rename modules/openapi-generator/src/main/resources/{ocaml-client => ocaml}/model.mustache (100%) rename modules/openapi-generator/src/main/resources/{ocaml-client => ocaml}/of_json.mustache (100%) rename modules/openapi-generator/src/main/resources/{ocaml-client => ocaml}/partial_header.mustache (100%) create mode 100644 modules/openapi-generator/src/main/resources/ocaml/readme.mustache rename modules/openapi-generator/src/main/resources/{ocaml-client => ocaml}/support.mustache (100%) rename modules/openapi-generator/src/main/resources/{ocaml-client => ocaml}/to_json.mustache (100%) rename modules/openapi-generator/src/main/resources/{ocaml-client => ocaml}/to_string.mustache (100%) create mode 100644 samples/client/petstore/ocaml/.openapi-generator-ignore create mode 100644 samples/client/petstore/ocaml/.openapi-generator/VERSION create mode 100644 samples/client/petstore/ocaml/README.md create mode 100644 samples/client/petstore/ocaml/dune create mode 100644 samples/client/petstore/ocaml/dune-project create mode 100644 samples/client/petstore/ocaml/petstore_client.opam create mode 100644 samples/client/petstore/ocaml/src/apis/pet_api.ml create mode 100644 samples/client/petstore/ocaml/src/apis/pet_api.mli create mode 100644 samples/client/petstore/ocaml/src/apis/store_api.ml create mode 100644 samples/client/petstore/ocaml/src/apis/store_api.mli create mode 100644 samples/client/petstore/ocaml/src/apis/user_api.ml create mode 100644 samples/client/petstore/ocaml/src/apis/user_api.mli create mode 100644 samples/client/petstore/ocaml/src/models/api_response.ml create mode 100644 samples/client/petstore/ocaml/src/models/category.ml create mode 100644 samples/client/petstore/ocaml/src/models/order.ml create mode 100644 samples/client/petstore/ocaml/src/models/pet.ml create mode 100644 samples/client/petstore/ocaml/src/models/tag.ml create mode 100644 samples/client/petstore/ocaml/src/models/user.ml create mode 100644 samples/client/petstore/ocaml/src/support/enums.ml create mode 100644 samples/client/petstore/ocaml/src/support/jsonSupport.ml create mode 100644 samples/client/petstore/ocaml/src/support/request.ml diff --git a/README.md b/README.md index 0aaf86e953b..065ec69d340 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se | | Languages/Frameworks | |-|-| -**API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later), **C++** (cpp-restsdk, Qt5, Tizen), **Clojure**, **Dart (1.x, 2.x)**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client), **Kotlin**, **Lua**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types) **Objective-C**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (rust, rust-server), **Scala** (akka, http4s, scalaz, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x), **Typescript** (AngularJS, Angular (2.x - 7.x), Aurelia, Axios, Fetch, Inversify, jQuery, Node, Rxjs) +**API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later), **C++** (cpp-restsdk, Qt5, Tizen), **Clojure**, **Dart (1.x, 2.x)**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client), **Kotlin**, **Lua**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (rust, rust-server), **Scala** (akka, http4s, scalaz, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x), **Typescript** (AngularJS, Angular (2.x - 7.x), Aurelia, Axios, Fetch, Inversify, jQuery, Node, Rxjs) **Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin), **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples)), **Kotlin** (Spring Boot, Ktor), **PHP** (Laravel, Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** ([Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra) **API documentation generators** | **HTML**, **Confluence Wiki** **Configuration files** | [**Apache2**](https://httpd.apache.org/) @@ -680,6 +680,7 @@ Here is a list of template creators: * JMeter: @davidkiss * Kotlin: @jimschubert [:heart:](https://www.patreon.com/jimschubert) * Lua: @daurnimator + * OCaml: @cgensoul * Perl: @wing328 [:heart:](https://www.patreon.com/wing328) * PHP (Guzzle): @baartosz * PowerShell: @beatcracker diff --git a/bin/ocaml-client-petstore.sh b/bin/ocaml-petstore.sh similarity index 71% rename from bin/ocaml-client-petstore.sh rename to bin/ocaml-petstore.sh index d124ad74b0a..9b3cb70990e 100755 --- a/bin/ocaml-client-petstore.sh +++ b/bin/ocaml-petstore.sh @@ -26,9 +26,9 @@ then fi # if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DdebugOperations -DloggerPath=conf/log4j.properties" +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -args="generate -t modules/openapi-generator/src/main/resources/ocaml-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g ocaml-client -o samples/client/petstore/ocaml-client --additional-properties packageName=petstore_client $@" +args="generate -t modules/openapi-generator/src/main/resources/ocaml -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g ocaml -o samples/client/petstore/ocaml --additional-properties packageName=petstore_client $@" echo "java ${JAVA_OPTS} -jar ${executable} ${args}" java $JAVA_OPTS -jar $executable $args diff --git a/bin/windows/ocaml-petstore.bat b/bin/windows/ocaml-petstore.bat new file mode 100755 index 00000000000..aa59c18b827 --- /dev/null +++ b/bin/windows/ocaml-petstore.bat @@ -0,0 +1,10 @@ +set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties +set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g ocaml -o samples\client\petstore\ocaml + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/docs/generators.md b/docs/generators.md index 12c7ecdfedc..46a9c92365f 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -39,7 +39,7 @@ The following generators are available: - [kotlin](generators/kotlin.md) - [lua](generators/lua.md) - [objc](generators/objc.md) - - [ocaml-client](generators/ocaml-client.md) + - [ocaml](generators/ocaml.md) - [perl](generators/perl.md) - [php](generators/php.md) - [powershell](generators/powershell.md) diff --git a/docs/generators/ocaml.md b/docs/generators/ocaml.md new file mode 100644 index 00000000000..7397b1c31bf --- /dev/null +++ b/docs/generators/ocaml.md @@ -0,0 +1,13 @@ + +--- +id: generator-opts-client-ocaml +title: Config Options for ocaml +sidebar_label: ocaml +--- + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java index 5df13a046b1..2ad91492b2e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java @@ -59,7 +59,7 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig } public String getName() { - return "ocaml-client"; + return "ocaml"; } public String getHelp() { @@ -68,13 +68,13 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig public OCamlClientCodegen() { super(); - outputFolder = "generated-code/ocaml-client"; + outputFolder = "generated-code/ocaml"; modelTemplateFiles.put("model.mustache", ".ml"); // default HIDE_GENERATION_TIMESTAMP to true hideGenerationTimestamp = Boolean.TRUE; - embeddedTemplateDir = templateDir = "ocaml-client"; + embeddedTemplateDir = templateDir = "ocaml"; setReservedWordsLowerCase( Arrays.asList( @@ -95,6 +95,7 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig supportingFiles.add(new SupportingFile("dune.mustache", "", "dune")); supportingFiles.add(new SupportingFile("dune-project.mustache", "", "dune-project")); + supportingFiles.add(new SupportingFile("readme.mustache", "", "README.md")); defaultIncludes = new HashSet<>( Arrays.asList( @@ -106,7 +107,7 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig "char", "string", "list" - ) + ) ); languageSpecificPrimitives = new HashSet<>( @@ -249,7 +250,7 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig private void collectEnumSchemas(String parentName, String sName, Schema schema) { if (schema instanceof ArraySchema) { - collectEnumSchemas(parentName, sName, ((ArraySchema)schema).getItems()); + collectEnumSchemas(parentName, sName, ((ArraySchema) schema).getItems()); } else if (schema instanceof MapSchema && schema.getAdditionalProperties() instanceof Schema) { collectEnumSchemas(parentName, sName, (Schema) schema.getAdditionalProperties()); } else if (isEnumSchema(schema)) { @@ -348,7 +349,7 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig } if (!hasDefName) { int i = 0; - String candidate;; + String candidate; while (definitiveNames.containsKey(candidate = sanitizeOCamlTypeName(nameCandidates.get(0) + "_" + i))) { i++; } @@ -361,7 +362,7 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig private void collectEnumSchemas(OpenAPI openAPI) { Components components = openAPI.getComponents(); - if (components != null && components.getSchemas() != null && !components.getSchemas().isEmpty()) { + if (components != null && components.getSchemas() != null && !components.getSchemas().isEmpty()) { collectEnumSchemas(null, components.getSchemas()); } diff --git a/modules/openapi-generator/src/main/resources/ocaml-client/api-impl.mustache b/modules/openapi-generator/src/main/resources/ocaml/api-impl.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/ocaml-client/api-impl.mustache rename to modules/openapi-generator/src/main/resources/ocaml/api-impl.mustache diff --git a/modules/openapi-generator/src/main/resources/ocaml-client/api-intf.mustache b/modules/openapi-generator/src/main/resources/ocaml/api-intf.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/ocaml-client/api-intf.mustache rename to modules/openapi-generator/src/main/resources/ocaml/api-intf.mustache diff --git a/modules/openapi-generator/src/main/resources/ocaml-client/dune-project.mustache b/modules/openapi-generator/src/main/resources/ocaml/dune-project.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/ocaml-client/dune-project.mustache rename to modules/openapi-generator/src/main/resources/ocaml/dune-project.mustache diff --git a/modules/openapi-generator/src/main/resources/ocaml-client/dune.mustache b/modules/openapi-generator/src/main/resources/ocaml/dune.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/ocaml-client/dune.mustache rename to modules/openapi-generator/src/main/resources/ocaml/dune.mustache diff --git a/modules/openapi-generator/src/main/resources/ocaml-client/enums.mustache b/modules/openapi-generator/src/main/resources/ocaml/enums.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/ocaml-client/enums.mustache rename to modules/openapi-generator/src/main/resources/ocaml/enums.mustache diff --git a/modules/openapi-generator/src/main/resources/ocaml-client/json.mustache b/modules/openapi-generator/src/main/resources/ocaml/json.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/ocaml-client/json.mustache rename to modules/openapi-generator/src/main/resources/ocaml/json.mustache diff --git a/modules/openapi-generator/src/main/resources/ocaml-client/lib.mustache b/modules/openapi-generator/src/main/resources/ocaml/lib.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/ocaml-client/lib.mustache rename to modules/openapi-generator/src/main/resources/ocaml/lib.mustache diff --git a/modules/openapi-generator/src/main/resources/ocaml-client/model.mustache b/modules/openapi-generator/src/main/resources/ocaml/model.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/ocaml-client/model.mustache rename to modules/openapi-generator/src/main/resources/ocaml/model.mustache diff --git a/modules/openapi-generator/src/main/resources/ocaml-client/of_json.mustache b/modules/openapi-generator/src/main/resources/ocaml/of_json.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/ocaml-client/of_json.mustache rename to modules/openapi-generator/src/main/resources/ocaml/of_json.mustache diff --git a/modules/openapi-generator/src/main/resources/ocaml-client/partial_header.mustache b/modules/openapi-generator/src/main/resources/ocaml/partial_header.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/ocaml-client/partial_header.mustache rename to modules/openapi-generator/src/main/resources/ocaml/partial_header.mustache diff --git a/modules/openapi-generator/src/main/resources/ocaml/readme.mustache b/modules/openapi-generator/src/main/resources/ocaml/readme.mustache new file mode 100644 index 00000000000..2ecff7daa88 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/ocaml/readme.mustache @@ -0,0 +1,35 @@ +# {{{projectName}}} +{{#appDescription}} +{{{appDescription}}} +{{/appDescription}} + +This OCaml package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: {{appVersion}} +- Package version: {{packageVersion}} +{{^hideGenerationTimestamp}} +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} +- Build package: {{generatorClass}} +{{#infoUrl}} +For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + +## Requirements. + +OCaml 4.x + +## Installation + +Please run the following commands to build the package `{{{packageName}}}`: + +```sh +opam install ppx_deriving_yojson cohttp ppx_deriving cohttp-lwt-unix +eval $(opam env) +dune build +``` + +## Getting Started + +TODO + diff --git a/modules/openapi-generator/src/main/resources/ocaml-client/support.mustache b/modules/openapi-generator/src/main/resources/ocaml/support.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/ocaml-client/support.mustache rename to modules/openapi-generator/src/main/resources/ocaml/support.mustache diff --git a/modules/openapi-generator/src/main/resources/ocaml-client/to_json.mustache b/modules/openapi-generator/src/main/resources/ocaml/to_json.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/ocaml-client/to_json.mustache rename to modules/openapi-generator/src/main/resources/ocaml/to_json.mustache diff --git a/modules/openapi-generator/src/main/resources/ocaml-client/to_string.mustache b/modules/openapi-generator/src/main/resources/ocaml/to_string.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/ocaml-client/to_string.mustache rename to modules/openapi-generator/src/main/resources/ocaml/to_string.mustache diff --git a/samples/client/petstore/ocaml/.openapi-generator-ignore b/samples/client/petstore/ocaml/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/ocaml/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/ocaml/.openapi-generator/VERSION b/samples/client/petstore/ocaml/.openapi-generator/VERSION new file mode 100644 index 00000000000..83a328a9227 --- /dev/null +++ b/samples/client/petstore/ocaml/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ocaml/README.md b/samples/client/petstore/ocaml/README.md new file mode 100644 index 00000000000..165b3533358 --- /dev/null +++ b/samples/client/petstore/ocaml/README.md @@ -0,0 +1,26 @@ +# +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + +This OCaml package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.OCamlClientCodegen + +## Requirements. + +OCaml 4.x + +## Installation + +Please run the following commands to build the package `petstore_client`: + +```sh +opam install ppx_deriving_yojson cohttp ppx_deriving cohttp-lwt-unix +dune build +``` + +## Getting Started + +TODO + diff --git a/samples/client/petstore/ocaml/dune b/samples/client/petstore/ocaml/dune new file mode 100644 index 00000000000..ed1c4d90e3d --- /dev/null +++ b/samples/client/petstore/ocaml/dune @@ -0,0 +1,9 @@ +(include_subdirs unqualified) +(library + (name petstore_client) + (public_name petstore_client) + (flags (:standard -w -27)) + (libraries str cohttp-lwt-unix lwt yojson ppx_deriving_yojson.runtime) + (preprocess (pps ppx_deriving_yojson ppx_deriving.std)) + (wrapped true) +) \ No newline at end of file diff --git a/samples/client/petstore/ocaml/dune-project b/samples/client/petstore/ocaml/dune-project new file mode 100644 index 00000000000..79d86e3c901 --- /dev/null +++ b/samples/client/petstore/ocaml/dune-project @@ -0,0 +1,2 @@ +(lang dune 1.10) +(name petstore_client) \ No newline at end of file diff --git a/samples/client/petstore/ocaml/petstore_client.opam b/samples/client/petstore/ocaml/petstore_client.opam new file mode 100644 index 00000000000..3c3603c2f14 --- /dev/null +++ b/samples/client/petstore/ocaml/petstore_client.opam @@ -0,0 +1,15 @@ +opam-version: "2.0" +name: "petstore_client" +version: "1.0.0" +synopsis: "" +description: """ +Longer description +""" +maintainer: "Name " +authors: "Name " +license: "" +homepage: "" +bug-reports: "" +dev-repo: "" +depends: [ "ocaml" "ocamlfind" ] +build: ["dune" "build" "-p" name] \ No newline at end of file diff --git a/samples/client/petstore/ocaml/src/apis/pet_api.ml b/samples/client/petstore/ocaml/src/apis/pet_api.ml new file mode 100644 index 00000000000..207503b9061 --- /dev/null +++ b/samples/client/petstore/ocaml/src/apis/pet_api.ml @@ -0,0 +1,80 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +let add_pet body = + let open Lwt in + let uri = Request.build_uri "/pet" in + let headers = Request.default_headers in + let body = Request.write_json_body Pet.to_yojson body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let delete_pet pet_id api_key = + let open Lwt in + let uri = Request.build_uri "/pet/{petId}" in + let headers = Request.default_headers in + let headers = Cohttp.Header.add headers "api_key" (api_key) in + let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in + Cohttp_lwt_unix.Client.call `DELETE uri ~headers >>= fun (resp, body) -> + Request.handle_unit_response resp + +let find_pets_by_status status = + let open Lwt in + let uri = Request.build_uri "/pet/findByStatus" in + let headers = Request.default_headers in + let uri = Uri.add_query_param uri ("status", List.map Enums.show_pet_status status) in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as_list_of (JsonSupport.unwrap Pet.of_yojson) resp body + +let find_pets_by_tags tags = + let open Lwt in + let uri = Request.build_uri "/pet/findByTags" in + let headers = Request.default_headers in + let uri = Uri.add_query_param uri ("tags", tags) in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as_list_of (JsonSupport.unwrap Pet.of_yojson) resp body + +let get_pet_by_id pet_id = + let open Lwt in + let uri = Request.build_uri "/pet/{petId}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Pet.of_yojson) resp body + +let update_pet body = + let open Lwt in + let uri = Request.build_uri "/pet" in + let headers = Request.default_headers in + let body = Request.write_json_body Pet.to_yojson body in + Cohttp_lwt_unix.Client.call `PUT uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let update_pet_with_form pet_id name status = + let open Lwt in + let uri = Request.build_uri "/pet/{petId}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in + let body = Request.init_form_encoded_body () in + let body = Request.add_form_encoded_body_param body ("name", name) in + let body = Request.add_form_encoded_body_param body ("status", status) in + let body = Request.finalize_form_encoded_body body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let upload_file pet_id additional_metadata file = + let open Lwt in + let uri = Request.build_uri "/pet/{petId}/uploadImage" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in + let body = Request.init_form_encoded_body () in + let body = Request.add_form_encoded_body_param body ("additional_metadata", additional_metadata) in + let body = Request.add_form_encoded_body_param body ("file", file) in + let body = Request.finalize_form_encoded_body body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Api_response.of_yojson) resp body + diff --git a/samples/client/petstore/ocaml/src/apis/pet_api.mli b/samples/client/petstore/ocaml/src/apis/pet_api.mli new file mode 100644 index 00000000000..0cc31e085cf --- /dev/null +++ b/samples/client/petstore/ocaml/src/apis/pet_api.mli @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +val add_pet : Pet.t -> unit Lwt.t +val delete_pet : int64 -> string -> unit Lwt.t +val find_pets_by_status : Enums.pet_status list -> Pet.t list Lwt.t +val find_pets_by_tags : string list -> Pet.t list Lwt.t +val get_pet_by_id : int64 -> Pet.t Lwt.t +val update_pet : Pet.t -> unit Lwt.t +val update_pet_with_form : int64 -> string -> string -> unit Lwt.t +val upload_file : int64 -> string -> string -> Api_response.t Lwt.t diff --git a/samples/client/petstore/ocaml/src/apis/store_api.ml b/samples/client/petstore/ocaml/src/apis/store_api.ml new file mode 100644 index 00000000000..cebccabdd85 --- /dev/null +++ b/samples/client/petstore/ocaml/src/apis/store_api.ml @@ -0,0 +1,38 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +let delete_order order_id = + let open Lwt in + let uri = Request.build_uri "/store/order/{orderId}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "orderId" (order_id) in + Cohttp_lwt_unix.Client.call `DELETE uri ~headers >>= fun (resp, body) -> + Request.handle_unit_response resp + +let get_inventory () = + let open Lwt in + let uri = Request.build_uri "/store/inventory" in + let headers = Request.default_headers in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as_map_of (JsonSupport.to_int32) resp body + +let get_order_by_id order_id = + let open Lwt in + let uri = Request.build_uri "/store/order/{orderId}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "orderId" (Int64.to_string order_id) in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Order.of_yojson) resp body + +let place_order body = + let open Lwt in + let uri = Request.build_uri "/store/order" in + let headers = Request.default_headers in + let body = Request.write_json_body Order.to_yojson body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Order.of_yojson) resp body + diff --git a/samples/client/petstore/ocaml/src/apis/store_api.mli b/samples/client/petstore/ocaml/src/apis/store_api.mli new file mode 100644 index 00000000000..bc3c93eb494 --- /dev/null +++ b/samples/client/petstore/ocaml/src/apis/store_api.mli @@ -0,0 +1,11 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +val delete_order : string -> unit Lwt.t +val get_inventory : unit -> (string * int32) list Lwt.t +val get_order_by_id : int64 -> Order.t Lwt.t +val place_order : Order.t -> Order.t Lwt.t diff --git a/samples/client/petstore/ocaml/src/apis/user_api.ml b/samples/client/petstore/ocaml/src/apis/user_api.ml new file mode 100644 index 00000000000..d05d71682a3 --- /dev/null +++ b/samples/client/petstore/ocaml/src/apis/user_api.ml @@ -0,0 +1,72 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +let create_user body = + let open Lwt in + let uri = Request.build_uri "/user" in + let headers = Request.default_headers in + let body = Request.write_json_body User.to_yojson body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let create_users_with_array_input body = + let open Lwt in + let uri = Request.build_uri "/user/createWithArray" in + let headers = Request.default_headers in + let body = Request.write_json_body (JsonSupport.of_list_of User.to_yojson) body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let create_users_with_list_input body = + let open Lwt in + let uri = Request.build_uri "/user/createWithList" in + let headers = Request.default_headers in + let body = Request.write_json_body (JsonSupport.of_list_of User.to_yojson) body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let delete_user username = + let open Lwt in + let uri = Request.build_uri "/user/{username}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "username" (username) in + Cohttp_lwt_unix.Client.call `DELETE uri ~headers >>= fun (resp, body) -> + Request.handle_unit_response resp + +let get_user_by_name username = + let open Lwt in + let uri = Request.build_uri "/user/{username}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "username" (username) in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap User.of_yojson) resp body + +let login_user username password = + let open Lwt in + let uri = Request.build_uri "/user/login" in + let headers = Request.default_headers in + let uri = Uri.add_query_param' uri ("username", username) in + let uri = Uri.add_query_param' uri ("password", password) in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.to_string) resp body + +let logout_user () = + let open Lwt in + let uri = Request.build_uri "/user/logout" in + let headers = Request.default_headers in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.handle_unit_response resp + +let update_user username body = + let open Lwt in + let uri = Request.build_uri "/user/{username}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "username" (username) in + let body = Request.write_json_body User.to_yojson body in + Cohttp_lwt_unix.Client.call `PUT uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + diff --git a/samples/client/petstore/ocaml/src/apis/user_api.mli b/samples/client/petstore/ocaml/src/apis/user_api.mli new file mode 100644 index 00000000000..5191a2ea41b --- /dev/null +++ b/samples/client/petstore/ocaml/src/apis/user_api.mli @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +val create_user : User.t -> unit Lwt.t +val create_users_with_array_input : User.t list -> unit Lwt.t +val create_users_with_list_input : User.t list -> unit Lwt.t +val delete_user : string -> unit Lwt.t +val get_user_by_name : string -> User.t Lwt.t +val login_user : string -> string -> string Lwt.t +val logout_user : unit -> unit Lwt.t +val update_user : string -> User.t -> unit Lwt.t diff --git a/samples/client/petstore/ocaml/src/models/api_response.ml b/samples/client/petstore/ocaml/src/models/api_response.ml new file mode 100644 index 00000000000..f1b960d1449 --- /dev/null +++ b/samples/client/petstore/ocaml/src/models/api_response.ml @@ -0,0 +1,21 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema Api_response.t : Describes the result of uploading an image resource + *) + +type t = { + code: int32 option [@default None]; + _type: string option [@default None]; + message: string option [@default None]; +} [@@deriving yojson, show ];; + +(** Describes the result of uploading an image resource *) +let create () : t = { + code = None; + _type = None; + message = None; +} + diff --git a/samples/client/petstore/ocaml/src/models/category.ml b/samples/client/petstore/ocaml/src/models/category.ml new file mode 100644 index 00000000000..31b9c3aab1d --- /dev/null +++ b/samples/client/petstore/ocaml/src/models/category.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema Category.t : A category for a pet + *) + +type t = { + id: int64 option [@default None]; + name: string option [@default None]; +} [@@deriving yojson, show ];; + +(** A category for a pet *) +let create () : t = { + id = None; + name = None; +} + diff --git a/samples/client/petstore/ocaml/src/models/order.ml b/samples/client/petstore/ocaml/src/models/order.ml new file mode 100644 index 00000000000..6130f88fd95 --- /dev/null +++ b/samples/client/petstore/ocaml/src/models/order.ml @@ -0,0 +1,28 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema Order.t : An order for a pets from the pet store + *) + +type t = { + id: int64 option [@default None]; + pet_id: int64 option [@default None]; + quantity: int32 option [@default None]; + ship_date: string option [@default None]; + (* Order Status *) + status: Enums.status option [@default None]; + complete: bool option [@default None]; +} [@@deriving yojson, show ];; + +(** An order for a pets from the pet store *) +let create () : t = { + id = None; + pet_id = None; + quantity = None; + ship_date = None; + status = None; + complete = None; +} + diff --git a/samples/client/petstore/ocaml/src/models/pet.ml b/samples/client/petstore/ocaml/src/models/pet.ml new file mode 100644 index 00000000000..5d267ef32db --- /dev/null +++ b/samples/client/petstore/ocaml/src/models/pet.ml @@ -0,0 +1,28 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema Pet.t : A pet for sale in the pet store + *) + +type t = { + id: int64 option [@default None]; + category: Category.t option [@default None]; + name: string; + photo_urls: string list; + tags: Tag.t list; + (* pet status in the store *) + status: Enums.pet_status option [@default None]; +} [@@deriving yojson, show ];; + +(** A pet for sale in the pet store *) +let create (name : string) (photo_urls : string list) : t = { + id = None; + category = None; + name = name; + photo_urls = photo_urls; + tags = []; + status = None; +} + diff --git a/samples/client/petstore/ocaml/src/models/tag.ml b/samples/client/petstore/ocaml/src/models/tag.ml new file mode 100644 index 00000000000..5570d9c8eaf --- /dev/null +++ b/samples/client/petstore/ocaml/src/models/tag.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema Tag.t : A tag for a pet + *) + +type t = { + id: int64 option [@default None]; + name: string option [@default None]; +} [@@deriving yojson, show ];; + +(** A tag for a pet *) +let create () : t = { + id = None; + name = None; +} + diff --git a/samples/client/petstore/ocaml/src/models/user.ml b/samples/client/petstore/ocaml/src/models/user.ml new file mode 100644 index 00000000000..a9483d72889 --- /dev/null +++ b/samples/client/petstore/ocaml/src/models/user.ml @@ -0,0 +1,32 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema User.t : A User who is purchasing from the pet store + *) + +type t = { + id: int64 option [@default None]; + username: string option [@default None]; + first_name: string option [@default None]; + last_name: string option [@default None]; + email: string option [@default None]; + password: string option [@default None]; + phone: string option [@default None]; + (* User Status *) + user_status: int32 option [@default None]; +} [@@deriving yojson, show ];; + +(** A User who is purchasing from the pet store *) +let create () : t = { + id = None; + username = None; + first_name = None; + last_name = None; + email = None; + password = None; + phone = None; + user_status = None; +} + diff --git a/samples/client/petstore/ocaml/src/support/enums.ml b/samples/client/petstore/ocaml/src/support/enums.ml new file mode 100644 index 00000000000..0c64f8c042f --- /dev/null +++ b/samples/client/petstore/ocaml/src/support/enums.ml @@ -0,0 +1,30 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type status = [ +| `Placed [@printer fun fmt _ -> Format.pp_print_string fmt "placed"] [@name "placed"] +| `Approved [@printer fun fmt _ -> Format.pp_print_string fmt "approved"] [@name "approved"] +| `Delivered [@printer fun fmt _ -> Format.pp_print_string fmt "delivered"] [@name "delivered"] +] [@@deriving yojson, show { with_path = false }];; + +let status_of_yojson json = status_of_yojson (`List [json]) +let status_to_yojson e = + match status_to_yojson e with + | `List [json] -> json + | json -> json + +type pet_status = [ +| `Available [@printer fun fmt _ -> Format.pp_print_string fmt "available"] [@name "available"] +| `Pending [@printer fun fmt _ -> Format.pp_print_string fmt "pending"] [@name "pending"] +| `Sold [@printer fun fmt _ -> Format.pp_print_string fmt "sold"] [@name "sold"] +] [@@deriving yojson, show { with_path = false }];; + +let pet_status_of_yojson json = pet_status_of_yojson (`List [json]) +let pet_status_to_yojson e = + match pet_status_to_yojson e with + | `List [json] -> json + | json -> json diff --git a/samples/client/petstore/ocaml/src/support/jsonSupport.ml b/samples/client/petstore/ocaml/src/support/jsonSupport.ml new file mode 100644 index 00000000000..4b0fac77545 --- /dev/null +++ b/samples/client/petstore/ocaml/src/support/jsonSupport.ml @@ -0,0 +1,55 @@ +open Ppx_deriving_yojson_runtime + +let unwrap to_json json = + match to_json json with + | Result.Ok json -> json + | Result.Error s -> failwith s + +let to_int json = + match json with + | `Int x -> x + | `Intlit s -> int_of_string s + | _ -> failwith "JsonSupport.to_int" + +let to_bool json = + match json with + | `Bool x -> x + | _ -> failwith "JsonSupport.to_bool" + +let to_float json = + match json with + | `Float x -> x + | _ -> failwith "JsonSupport.to_float" + +let to_string json = + match json with + | `String s -> s + | _ -> failwith "JsonSupport.to_string" + +let to_int32 json : int32 = + match json with + | `Int x -> Int32.of_int x + | `Intlit s -> Int32.of_string s + | _ -> failwith "JsonSupport.to_int32" + +let to_int64 json : int64 = + match json with + | `Int x -> Int64.of_int x + | `Intlit s -> Int64.of_string s + | _ -> failwith "JsonSupport.to_int64" + +let of_int x = `Int x + +let of_bool b = `Bool b + +let of_float x = `Float x + +let of_string s = `String s + +let of_int32 x = `Intlit (Int32.to_string x) + +let of_int64 x = `Intlit (Int64.to_string x) + +let of_list_of of_f l = `List (List.map of_f l) + +let of_map_of of_f l = `Assoc (List.map (fun (k, v) -> (k, of_f v)) l) \ No newline at end of file diff --git a/samples/client/petstore/ocaml/src/support/request.ml b/samples/client/petstore/ocaml/src/support/request.ml new file mode 100644 index 00000000000..21b6f870ed9 --- /dev/null +++ b/samples/client/petstore/ocaml/src/support/request.ml @@ -0,0 +1,48 @@ +let api_key = "" +let base_url = "http://petstore.swagger.io/v2" +let default_headers = Cohttp.Header.init_with "Content-Type" "application/json" + +let build_uri operation_path = Uri.of_string (base_url ^ operation_path) +let write_json_body to_json payload = + to_json payload |> Yojson.Safe.to_string ~std:true |> Cohttp_lwt.Body.of_string + +let handle_response resp on_success_handler = + match Cohttp_lwt.Response.status resp with + | #Cohttp.Code.success_status -> on_success_handler () + | s -> failwith ("Server responded with status " ^ Cohttp.Code.(reason_phrase_of_code (code_of_status s))) + +let handle_unit_response resp = handle_response resp (fun () -> Lwt.return ()) + +let read_json_body resp body = + handle_response resp (fun () -> + (Lwt.(Cohttp_lwt.Body.to_string body >|= Yojson.Safe.from_string))) + +let read_json_body_as of_json resp body = + Lwt.(read_json_body resp body >|= of_json) + +let read_json_body_as_list resp body = + Lwt.(read_json_body resp body >|= Yojson.Safe.Util.to_list) + +let read_json_body_as_list_of of_json resp body = + Lwt.(read_json_body_as_list resp body >|= List.map of_json) + +let read_json_body_as_map_of of_json resp body = + Lwt.(read_json_body resp body >|= Yojson.Safe.Util.to_assoc >|= List.map (fun (s, v) -> (s, of_json v))) + +let replace_path_param uri param_name param_value = + let regexp = Str.regexp (Str.quote ("{" ^ param_name ^ "}")) in + let path = Str.global_replace regexp param_value (Uri.path uri) in + Uri.with_path uri path + +let init_form_encoded_body () = "" + +let add_form_encoded_body_param params (paramName, paramValue) = + let new_param_enc = Printf.sprintf {|%s=%s|} (Uri.pct_encode paramName) (Uri.pct_encode paramValue) in + if params = "" + then new_param_enc + else Printf.sprintf {|%s&%s|} params new_param_enc + +let add_form_encoded_body_params params (paramName, new_params) = + add_form_encoded_body_param params (paramName, String.concat "," new_params) + +let finalize_form_encoded_body body = Cohttp_lwt.Body.of_string body From cbd78d7fca52edebfbc22656cb78606f2f93111b Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 29 Jul 2019 10:16:59 +0800 Subject: [PATCH 06/75] Test OCaml petstore client in drone.io (#3484) * test ocaml petstore * undo directory rename * run eval * install m4 * force yes * fix permission issue * specify build dir * fix dune * give full permission * fix steps * rename test * update ocaml petstore path --- CI/.drone.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/CI/.drone.yml b/CI/.drone.yml index d45a1a431ea..5480eb2a9a6 100644 --- a/CI/.drone.yml +++ b/CI/.drone.yml @@ -2,8 +2,19 @@ kind: pipeline name: default steps: -- name: test +# test Java 11 HTTP client +- name: java11-test image: hirokimatsumoto/alpine-openjdk-11 commands: - ./mvnw clean install - ./mvnw --quiet verify -Psamples.droneio +# test ocaml petstore client +- name: ocaml-test + image: ocaml/opam2:4.07 + commands: + - sudo apt-get -y install m4 + - cd samples/client/petstore/ocaml + - opam install ppx_deriving_yojson cohttp ppx_deriving cohttp-lwt-unix + - eval $(opam env) + - sudo chmod -R 777 . + - dune build --build-dir=./_build From 9cb3ae10485032e575cf05d4e99567e1861e2143 Mon Sep 17 00:00:00 2001 From: tjnet Date: Mon, 29 Jul 2019 11:34:57 +0900 Subject: [PATCH 07/75] remove unecessary null check as it cannot be reached due to the Null Pointer Exception (#3480) (#3481) --- .../resources/Java/libraries/resttemplate/ApiClient.mustache | 3 --- .../src/main/java/org/openapitools/client/ApiClient.java | 3 --- .../src/main/java/org/openapitools/client/ApiClient.java | 3 --- 3 files changed, 9 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache index 3f8f6a0f4de..4deaacb19ee 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache @@ -619,9 +619,6 @@ public class ApiClient { if (responseEntity.getStatusCode() == HttpStatus.NO_CONTENT) { return null; } else if (responseEntity.getStatusCode().is2xxSuccessful()) { - if (returnType == null) { - return null; - } return responseEntity.getBody(); } else { // The error handler built into the RestTemplate should handle 400 and 500 series errors. diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java index d3d3c8de2f8..6a61b3961c8 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java @@ -607,9 +607,6 @@ public class ApiClient { if (responseEntity.getStatusCode() == HttpStatus.NO_CONTENT) { return null; } else if (responseEntity.getStatusCode().is2xxSuccessful()) { - if (returnType == null) { - return null; - } return responseEntity.getBody(); } else { // The error handler built into the RestTemplate should handle 400 and 500 series errors. diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java index 54c75ef0858..ad850d363d7 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java @@ -602,9 +602,6 @@ public class ApiClient { if (responseEntity.getStatusCode() == HttpStatus.NO_CONTENT) { return null; } else if (responseEntity.getStatusCode().is2xxSuccessful()) { - if (returnType == null) { - return null; - } return responseEntity.getBody(); } else { // The error handler built into the RestTemplate should handle 400 and 500 series errors. From 981b3a53ef85c2c2ebd3e3fddb3a436b2d4ae903 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 29 Jul 2019 12:05:15 +0800 Subject: [PATCH 08/75] update ocaml openapi3 petstore script --- bin/openapi3/ocaml-client-petstore.sh | 2 +- samples/client/petstore/ocaml/README.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/openapi3/ocaml-client-petstore.sh b/bin/openapi3/ocaml-client-petstore.sh index 7c9aeb7c55a..ccd51527f17 100755 --- a/bin/openapi3/ocaml-client-petstore.sh +++ b/bin/openapi3/ocaml-client-petstore.sh @@ -28,7 +28,7 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DdebugOperations -DloggerPath=conf/log4j.properties" -args="generate -t modules/openapi-generator/src/main/resources/ocaml-client -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ocaml-client -o samples/openapi3/client/petstore/ocaml-client/ --additional-properties packageName=petstore_client $@" +args="generate -t modules/openapi-generator/src/main/resources/ocaml -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ocaml -o samples/openapi3/client/petstore/ocaml/ --additional-properties packageName=petstore_client $@" echo "java ${JAVA_OPTS} -jar ${executable} ${args}" java $JAVA_OPTS -jar $executable $args diff --git a/samples/client/petstore/ocaml/README.md b/samples/client/petstore/ocaml/README.md index 165b3533358..caa98287d45 100644 --- a/samples/client/petstore/ocaml/README.md +++ b/samples/client/petstore/ocaml/README.md @@ -17,6 +17,7 @@ Please run the following commands to build the package `petstore_client`: ```sh opam install ppx_deriving_yojson cohttp ppx_deriving cohttp-lwt-unix +eval $(opam env) dune build ``` From 74eeb07b2294becd33349d1868fe4c94f91d1fb7 Mon Sep 17 00:00:00 2001 From: scottydawg <923236+scottydawg@users.noreply.github.com> Date: Mon, 29 Jul 2019 01:48:20 -0400 Subject: [PATCH 09/75] Support importMapping definitions for TypeScriptNodeClientCodegen (#3469) * Support importMapping definitions for TypeScriptNodeClientCodegen * Use import mappings for all file references --- .../TypeScriptNodeClientCodegen.java | 21 ++- .../resources/typescript-node/model.mustache | 2 +- .../resources/typescript-node/models.mustache | 4 +- .../TypeScriptNodeClientCodegenTest.java | 153 ++++++++++++------ .../TypeScriptNodeModelTest.java | 26 +++ 5 files changed, 155 insertions(+), 51 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNodeClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNodeClientCodegen.java index bcad8aa989c..c1b0d618d0b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNodeClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptNodeClientCodegen.java @@ -18,7 +18,6 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.media.Schema; -import io.swagger.v3.parser.util.SchemaTypeUtil; import org.openapitools.codegen.*; import org.openapitools.codegen.utils.ModelUtils; import org.slf4j.Logger; @@ -33,6 +32,7 @@ public class TypeScriptNodeClientCodegen extends AbstractTypeScriptClientCodegen private static final Logger LOGGER = LoggerFactory.getLogger(TypeScriptNodeClientCodegen.class); public static final String NPM_REPOSITORY = "npmRepository"; + private static final String DEFAULT_IMPORT_PREFIX = "./"; protected String npmRepository = null; protected String apiSuffix = "Api"; @@ -96,22 +96,37 @@ public class TypeScriptNodeClientCodegen extends AbstractTypeScriptClientCodegen if (name.length() == 0) { return "default" + apiSuffix; } + if (importMapping.containsKey(name)) { + return importMapping.get(name); + } return camelize(name, true) + apiSuffix; } @Override public String toApiImport(String name) { + if (importMapping.containsKey(name)) { + return importMapping.get(name); + } + return apiPackage() + "/" + toApiFilename(name); } @Override public String toModelFilename(String name) { - return camelize(toModelName(name), true); + if (importMapping.containsKey(name)) { + return importMapping.get(name); + } + + return DEFAULT_IMPORT_PREFIX + camelize(toModelName(name), true); } @Override public String toModelImport(String name) { - return modelPackage() + "/" + toModelFilename(name); + if (importMapping.containsKey(name)) { + return importMapping.get(name); + } + + return modelPackage() + "/" + camelize(toModelName(name), true); } @Override diff --git a/modules/openapi-generator/src/main/resources/typescript-node/model.mustache b/modules/openapi-generator/src/main/resources/typescript-node/model.mustache index c9ef8ebbc06..3559593a50c 100644 --- a/modules/openapi-generator/src/main/resources/typescript-node/model.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-node/model.mustache @@ -2,7 +2,7 @@ {{#models}} {{#model}} {{#tsImports}} -import { {{classname}} } from './{{filename}}'; +import { {{classname}} } from '{{filename}}'; {{/tsImports}} {{#description}} diff --git a/modules/openapi-generator/src/main/resources/typescript-node/models.mustache b/modules/openapi-generator/src/main/resources/typescript-node/models.mustache index 0bd709c2dda..59e86fe445d 100644 --- a/modules/openapi-generator/src/main/resources/typescript-node/models.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-node/models.mustache @@ -1,6 +1,6 @@ {{#models}} {{#model}} -export * from './{{{ classFilename }}}'; +export * from '{{{ classFilename }}}'; {{/model}} {{/models}} @@ -8,7 +8,7 @@ import localVarRequest = require('request'); {{#models}} {{#model}} -import { {{classname}} } from './{{{ classFilename }}}'; +import { {{classname}} } from '{{{ classFilename }}}'; {{/model}} {{/models}} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeClientCodegenTest.java index 93fb08719d7..b4372c0e73e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeClientCodegenTest.java @@ -4,68 +4,131 @@ import io.swagger.v3.oas.models.OpenAPI; import org.openapitools.codegen.TestUtils; import org.openapitools.codegen.languages.TypeScriptNodeClientCodegen; import org.testng.Assert; +import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class TypeScriptNodeClientCodegenTest { + private TypeScriptNodeClientCodegen codegen; + + @BeforeMethod + public void setUp() { + codegen = new TypeScriptNodeClientCodegen(); + } + @Test public void convertVarName() throws Exception { - TypeScriptNodeClientCodegen codegen = new TypeScriptNodeClientCodegen(); - Assert.assertEquals(codegen.toVarName("name"), "name"); - Assert.assertEquals(codegen.toVarName("$name"), "$name"); - Assert.assertEquals(codegen.toVarName("nam$$e"), "nam$$e"); - Assert.assertEquals(codegen.toVarName("user-name"), "userName"); - Assert.assertEquals(codegen.toVarName("user_name"), "userName"); - Assert.assertEquals(codegen.toVarName("user|name"), "userName"); - Assert.assertEquals(codegen.toVarName("user !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~name"), "user$Name"); - } + Assert.assertEquals(codegen.toVarName("name"), "name"); + Assert.assertEquals(codegen.toVarName("$name"), "$name"); + Assert.assertEquals(codegen.toVarName("nam$$e"), "nam$$e"); + Assert.assertEquals(codegen.toVarName("user-name"), "userName"); + Assert.assertEquals(codegen.toVarName("user_name"), "userName"); + Assert.assertEquals(codegen.toVarName("user|name"), "userName"); + Assert.assertEquals(codegen.toVarName("user !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~name"), "user$Name"); + } - @Test - public void testSnapshotVersion() { - OpenAPI api = TestUtils.createOpenAPI(); - TypeScriptNodeClientCodegen codegen = new TypeScriptNodeClientCodegen(); + @Test + public void testSnapshotVersion() { + OpenAPI api = TestUtils.createOpenAPI(); - codegen.additionalProperties().put("npmName", "@openapi/typescript-angular-petstore"); - codegen.additionalProperties().put("snapshot", true); - codegen.additionalProperties().put("npmVersion", "1.0.0-SNAPSHOT"); - codegen.processOpts(); - codegen.preprocessOpenAPI(api); + codegen.additionalProperties().put("npmName", "@openapi/typescript-angular-petstore"); + codegen.additionalProperties().put("snapshot", true); + codegen.additionalProperties().put("npmVersion", "1.0.0-SNAPSHOT"); + codegen.processOpts(); + codegen.preprocessOpenAPI(api); - Assert.assertTrue(codegen.getNpmVersion().matches("^1.0.0-SNAPSHOT.[0-9]{12}$")); + Assert.assertTrue(codegen.getNpmVersion().matches("^1.0.0-SNAPSHOT.[0-9]{12}$")); - codegen = new TypeScriptNodeClientCodegen(); - codegen.additionalProperties().put("npmName", "@openapi/typescript-angular-petstore"); - codegen.additionalProperties().put("snapshot", true); - codegen.additionalProperties().put("npmVersion", "3.0.0-M1"); - codegen.processOpts(); - codegen.preprocessOpenAPI(api); + codegen = new TypeScriptNodeClientCodegen(); + codegen.additionalProperties().put("npmName", "@openapi/typescript-angular-petstore"); + codegen.additionalProperties().put("snapshot", true); + codegen.additionalProperties().put("npmVersion", "3.0.0-M1"); + codegen.processOpts(); + codegen.preprocessOpenAPI(api); - Assert.assertTrue(codegen.getNpmVersion().matches("^3.0.0-M1-SNAPSHOT.[0-9]{12}$")); + Assert.assertTrue(codegen.getNpmVersion().matches("^3.0.0-M1-SNAPSHOT.[0-9]{12}$")); + } - } + @Test + public void testWithoutSnapshotVersion() { + OpenAPI api = TestUtils.createOpenAPI(); - @Test - public void testWithoutSnapshotVersion() { - OpenAPI api = TestUtils.createOpenAPI(); - TypeScriptNodeClientCodegen codegen = new TypeScriptNodeClientCodegen(); + codegen.additionalProperties().put("npmName", "@openapi/typescript-angular-petstore"); + codegen.additionalProperties().put("snapshot", false); + codegen.additionalProperties().put("npmVersion", "1.0.0-SNAPSHOT"); + codegen.processOpts(); + codegen.preprocessOpenAPI(api); - codegen.additionalProperties().put("npmName", "@openapi/typescript-angular-petstore"); - codegen.additionalProperties().put("snapshot", false); - codegen.additionalProperties().put("npmVersion", "1.0.0-SNAPSHOT"); - codegen.processOpts(); - codegen.preprocessOpenAPI(api); + Assert.assertTrue(codegen.getNpmVersion().matches("^1.0.0-SNAPSHOT$")); - Assert.assertTrue(codegen.getNpmVersion().matches("^1.0.0-SNAPSHOT$")); + codegen = new TypeScriptNodeClientCodegen(); + codegen.additionalProperties().put("npmName", "@openapi/typescript-angular-petstore"); + codegen.additionalProperties().put("snapshot", false); + codegen.additionalProperties().put("npmVersion", "3.0.0-M1"); + codegen.processOpts(); + codegen.preprocessOpenAPI(api); - codegen = new TypeScriptNodeClientCodegen(); - codegen.additionalProperties().put("npmName", "@openapi/typescript-angular-petstore"); - codegen.additionalProperties().put("snapshot", false); - codegen.additionalProperties().put("npmVersion", "3.0.0-M1"); - codegen.processOpts(); - codegen.preprocessOpenAPI(api); + Assert.assertTrue(codegen.getNpmVersion().matches("^3.0.0-M1$")); + } - Assert.assertTrue(codegen.getNpmVersion().matches("^3.0.0-M1$")); + @Test(description = "prepend model filename with ./ by default") + public void defaultModelFilenameTest() { + Assert.assertEquals(codegen.toModelFilename("ApiResponse"), "./apiResponse"); + } - } + @Test(description = "use mapped name for model filename when provided") + public void modelFilenameWithMappingTest() { + final String mappedName = "@namespace/dir/response"; + codegen.importMapping().put("ApiResponse", mappedName); + + Assert.assertEquals(codegen.toModelFilename("ApiResponse"), mappedName); + } + + @Test(description = "prepend model import with ./ by default") + public void defaultModelImportTest() { + Assert.assertEquals(codegen.toModelImport("ApiResponse"), "model/apiResponse"); + } + + @Test(description = "use mapped name for model import when provided") + public void modelImportWithMappingTest() { + final String mappedName = "@namespace/dir/response"; + codegen.importMapping().put("ApiResponse", mappedName); + + Assert.assertEquals(codegen.toModelImport("ApiResponse"), mappedName); + } + + @Test(description = "append api suffix to default api filename") + public void emptyApiFilenameTest() { + Assert.assertEquals(codegen.toApiFilename(""), "defaultApi"); + } + + @Test(description = "appends api suffix to api filename") + public void defaultApiFilenameTest() { + Assert.assertEquals(codegen.toApiFilename("Category"), "categoryApi"); + } + + @Test(description = "appends api suffix to mapped api filename") + public void mappedApiFilenameTest() { + final String mappedName = "@namespace/dir/category"; + codegen.importMapping().put("Category", mappedName); + Assert.assertEquals(codegen.toApiFilename("Category"), mappedName); + } + + @Test(description = "append api suffix to default api import") + public void emptyApiImportTest() { + Assert.assertEquals(codegen.toApiImport(""), "api/defaultApi"); + } + + @Test(description = "appends api suffix to api import") + public void defaultApiImportTest() { + Assert.assertEquals(codegen.toApiImport("Category"), "api/categoryApi"); + } + + @Test(description = "appends api suffix to mapped api filename") + public void mappedApiImportTest() { + final String mappedName = "@namespace/dir/category"; + codegen.importMapping().put("Category", mappedName); + Assert.assertEquals(codegen.toApiImport("Category"), mappedName); + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeModelTest.java index 0f6a8a9647a..d3a11b970c0 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeModelTest.java @@ -205,4 +205,30 @@ public class TypeScriptNodeModelTest { Assert.assertEquals(cm.imports.size(), 1); Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("Children")).size(), 1); } + + @Test(description = "prepend imports with ./ by default") + public void defaultFromModelTest() { + final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/petstore.yaml"); + final DefaultCodegen codegen = new TypeScriptNodeClientCodegen(); + codegen.setOpenAPI(openAPI); + final Schema categorySchema = openAPI.getComponents().getSchemas().get("ApiResponse"); + final CodegenModel cm = codegen.fromModel("ApiResponse", categorySchema); + + Assert.assertEquals(cm.name, "ApiResponse"); + Assert.assertEquals(cm.classFilename, "./apiResponse"); + } + + @Test(description = "use mapped imports for type") + public void mappedFromModelTest() { + final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/petstore.yaml"); + final DefaultCodegen codegen = new TypeScriptNodeClientCodegen(); + final String mappedName = "@namespace/dir/response"; + codegen.importMapping().put("ApiResponse", mappedName); + codegen.setOpenAPI(openAPI); + final Schema categorySchema = openAPI.getComponents().getSchemas().get("ApiResponse"); + final CodegenModel cm = codegen.fromModel("ApiResponse", categorySchema); + + Assert.assertEquals(cm.name, "ApiResponse"); + Assert.assertEquals(cm.classFilename, mappedName); + } } From cf01bf4ae72a47c2ab99d34d961a5e5c8d1b7e26 Mon Sep 17 00:00:00 2001 From: Doxoh Date: Mon, 29 Jul 2019 11:30:07 +0200 Subject: [PATCH 10/75] Fix typo useDefaultRoutng to useDefaultRouting (#3488) --- .../src/main/resources/aspnetcore/2.1/Startup.mustache | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Startup.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Startup.mustache index 98fb1fe23e6..744a282fee1 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Startup.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Startup.mustache @@ -60,7 +60,7 @@ namespace {{packageName}} // Add framework services. services - .AddMvc({{^useDefaultRoutng}}opts => opts.EnableEndpointRouting = false{{/useDefaultRoutng}}) + .AddMvc({{^useDefaultRouting}}opts => opts.EnableEndpointRouting = false{{/useDefaultRouting}}) {{#compatibilityVersion}} .SetCompatibilityVersion(CompatibilityVersion.{{compatibilityVersion}}) {{/compatibilityVersion}} @@ -127,12 +127,12 @@ namespace {{packageName}} //TODO: Or alternatively use the original Swagger contract that's included in the static files // c.SwaggerEndpoint("/openapi-original.json", "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}} Original"); - }){{/useSwashbuckle}};{{^useDefaultRoutng}} + }){{/useSwashbuckle}};{{^useDefaultRouting}} app.UseRouting(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); - });{{/useDefaultRoutng}} + });{{/useDefaultRouting}} if (env.IsDevelopment()) { From b4f15819411936f0c0dc3f3be12f67036d16b9c9 Mon Sep 17 00:00:00 2001 From: Steven Masala Date: Mon, 29 Jul 2019 11:30:34 +0200 Subject: [PATCH 11/75] Fix: Remove spec 3 references keys in imports for TypeScript (#1932) * fix name sanitation when using kebab case filenaming * remove whitespaces * sanitize names by removing spec 3 ref keys * Revert "sanitize names by removing spec 3 ref keys" This reverts commit 7e58719317bb936884f5ed0049177ef961871464. * add pipes to datatype names * split imports * remove comment * fix when using a mixture of (any|one) and standard imports * sanitize names by removing spec 3 ref keys * Revert "sanitize names by removing spec 3 ref keys" This reverts commit 7e58719317bb936884f5ed0049177ef961871464. * Merge conflict DefMerge branch 'master' into name-ref-fix # Conflicts: # modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java * split imports * remove comment * fix when using a mixture of (any|one) and standard imports * Fix merge error import missing package, merge error. * format * fix tests * create test, fi regex --- .../openapitools/codegen/DefaultCodegen.java | 38 ++++++++++++++----- .../AbstractTypeScriptClientCodegen.java | 14 ++++++- .../TypeScriptAngularClientCodegen.java | 24 +++++++++++- .../TypeScriptAngularClientCodegenTest.java | 23 +++++++++++ .../TypeScriptNodeClientCodegenTest.java | 3 ++ 5 files changed, 91 insertions(+), 11 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 39415e2698d..661a7ab7f09 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -4017,6 +4017,19 @@ public class DefaultCodegen implements CodegenConfig { * @return sanitized string */ public String sanitizeName(String name, String removeCharRegEx) { + return sanitizeName(name, removeCharRegEx, new ArrayList()); + } + + /** + * Sanitize name (parameter, property, method, etc) + * + * @param name string to be sanitize + * @param removeCharRegEx a regex containing all char that will be removed + * @param exceptionList a list of matches which should not be sanitized (i.e expections) + * @return sanitized string + */ + @SuppressWarnings("static-method") + public String sanitizeName(String name, String removeCharRegEx, ArrayList exceptionList) { // NOTE: performance wise, we should have written with 2 replaceAll to replace desired // character with _ or empty character. Below aims to spell out different cases we've // encountered so far and hopefully make it easier for others to add more special @@ -4034,27 +4047,27 @@ public class DefaultCodegen implements CodegenConfig { } // input[] => input - name = name.replaceAll("\\[\\]", ""); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. + name = this.sanitizeValue(name, "\\[\\]", "", exceptionList); // input[a][b] => input_a_b - name = name.replaceAll("\\[", "_"); - name = name.replaceAll("\\]", ""); + name = this.sanitizeValue(name, "\\[", "_", exceptionList); + name = this.sanitizeValue(name, "\\]", "", exceptionList); // input(a)(b) => input_a_b - name = name.replaceAll("\\(", "_"); - name = name.replaceAll("\\)", ""); + name = this.sanitizeValue(name, "\\(", "_", exceptionList); + name = this.sanitizeValue(name, "\\)", "", exceptionList); // input.name => input_name - name = name.replaceAll("\\.", "_"); + name = this.sanitizeValue(name, "\\.", "_", exceptionList); // input-name => input_name - name = name.replaceAll("-", "_"); + name = this.sanitizeValue(name, "-", "_", exceptionList); // a|b => a_b - name = name.replace("|", "_"); + name = this.sanitizeValue(name, "\\|", "_", exceptionList); // input name and age => input_name_and_age - name = name.replaceAll(" ", "_"); + name = this.sanitizeValue(name, " ", "_", exceptionList); // /api/films/get => _api_films_get // \api\films\get => _api_films_get @@ -4072,6 +4085,13 @@ public class DefaultCodegen implements CodegenConfig { return name; } + private String sanitizeValue(String value, String replaceMatch, String replaceValue, ArrayList exceptionList) { + if (exceptionList.size() == 0 || !exceptionList.contains(replaceMatch)) { + return value.replaceAll(replaceMatch, replaceValue); + } + return value; + } + /** * Sanitize tag * diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java index 9e5e01123df..3646427b27d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java @@ -19,6 +19,7 @@ package org.openapitools.codegen.languages; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.ComposedSchema; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.parameters.Parameter; import org.apache.commons.io.FilenameUtils; @@ -266,7 +267,8 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp @Override public String toModelName(String name) { - name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. + ArrayList exceptions = new ArrayList(Arrays.asList("\\|", " ")); + name = sanitizeName(name, "(?![| ])\\W", exceptions); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. if (!StringUtils.isEmpty(modelNamePrefix)) { name = modelNamePrefix + "_" + name; @@ -696,4 +698,14 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp } } } + + @Override + public String toAnyOfName(List names, ComposedSchema composedSchema) { + return String.join(" | ", names); + } + + @Override + public String toOneOfName(List names, ComposedSchema composedSchema) { + return String.join(" | ", names); + } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java index 745e9747b2c..922628e2438 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java @@ -28,6 +28,7 @@ import org.slf4j.LoggerFactory; import java.io.File; import java.util.*; +import java.util.regex.Pattern; import static org.apache.commons.lang3.StringUtils.capitalize; import static org.openapitools.codegen.utils.StringUtils.*; @@ -458,12 +459,33 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode } } // Add additional filename information for imports - mo.put("tsImports", toTsImports(cm, cm.imports)); + Set parsedImports = parseImports(cm); + mo.put("tsImports", toTsImports(cm, parsedImports)); } } return result; } + /** + * Parse imports + */ + private Set parseImports(CodegenModel cm) { + Set newImports = new HashSet(); + if (cm.imports.size() > 0) { + for (String name : cm.imports) { + if (name.indexOf(" | ") >= 0) { + String[] parts = name.split(" \\| "); + for (String s : parts) { + newImports.add(s); + } + } else { + newImports.add(name); + } + } + } + return newImports; + } + private List> toTsImports(CodegenModel cm, Set imports) { List> tsImports = new ArrayList<>(); for (String im : imports) { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java index 21cb66f7767..8adc9328ec5 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java @@ -3,6 +3,8 @@ package org.openapitools.codegen.typescript.typescriptangular; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.PathItem; +import io.swagger.v3.oas.models.media.ComposedSchema; +import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.oas.models.responses.ApiResponses; import org.openapitools.codegen.CodegenOperation; @@ -109,4 +111,25 @@ public class TypeScriptAngularClientCodegenTest { Assert.assertEquals("TestName", codegen.removeModelPrefixSuffix("TestNameDefGhi")); } + @Test + public void testSchema() { + TypeScriptAngularClientCodegen codegen = new TypeScriptAngularClientCodegen(); + + ComposedSchema composedSchema = new ComposedSchema(); + + Schema schema1 = new Schema<>(); + schema1.set$ref("SchemaOne"); + Schema schema2 = new Schema<>(); + schema2.set$ref("SchemaTwo"); + Schema schema3 = new Schema<>(); + schema3.set$ref("SchemaThree"); + + composedSchema.addAnyOfItem(schema1); + composedSchema.addAnyOfItem(schema2); + composedSchema.addAnyOfItem(schema3); + + String schemaType = codegen.getSchemaType(composedSchema); + Assert.assertEquals(schemaType, "SchemaOne | SchemaTwo | SchemaThree"); + } + } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeClientCodegenTest.java index b4372c0e73e..5cce4a425ea 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeClientCodegenTest.java @@ -18,6 +18,7 @@ public class TypeScriptNodeClientCodegenTest { @Test public void convertVarName() throws Exception { + TypeScriptNodeClientCodegen codegen = new TypeScriptNodeClientCodegen(); Assert.assertEquals(codegen.toVarName("name"), "name"); Assert.assertEquals(codegen.toVarName("$name"), "$name"); Assert.assertEquals(codegen.toVarName("nam$$e"), "nam$$e"); @@ -30,6 +31,7 @@ public class TypeScriptNodeClientCodegenTest { @Test public void testSnapshotVersion() { OpenAPI api = TestUtils.createOpenAPI(); + TypeScriptNodeClientCodegen codegen = new TypeScriptNodeClientCodegen(); codegen.additionalProperties().put("npmName", "@openapi/typescript-angular-petstore"); codegen.additionalProperties().put("snapshot", true); @@ -52,6 +54,7 @@ public class TypeScriptNodeClientCodegenTest { @Test public void testWithoutSnapshotVersion() { OpenAPI api = TestUtils.createOpenAPI(); + TypeScriptNodeClientCodegen codegen = new TypeScriptNodeClientCodegen(); codegen.additionalProperties().put("npmName", "@openapi/typescript-angular-petstore"); codegen.additionalProperties().put("snapshot", false); From 1bf8c15206c290e68051f65cc6fe1e1ed76ecb6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20R=C3=BChl?= Date: Mon, 29 Jul 2019 11:31:42 +0200 Subject: [PATCH 12/75] [BUG-1865] Added serialization support for typescript on complex object headers. (#1874) * [BUG-1865] Added serialization support for typescript on complex object headers. * Update api.mustache integrate feedback from https://github.com/OpenAPITools/openapi-generator/pull/1874#discussion_r268981304 * [BUG-1865] post merge fixes * [BUG-1865] addded windows scripts * Apply suggestions from code review Co-Authored-By: Esteban Gehring * [BUG-1865] regenerated samples --- bin/typescript-axios-petstore-all.sh | 1 + ...ipt-axios-petstore-with-complex-headers.sh | 32 + bin/windows/typescript-axios-petstore-all.bat | 1 + ...pt-axios-petstore-with-complex-headers.bat | 12 + .../typescript-axios/apiInner.mustache | 8 +- .../3_0/petstore-with-complex-headers.yaml | 710 ++++++ .../builds/with-complex-headers/.gitignore | 4 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/VERSION | 1 + .../builds/with-complex-headers/api.ts | 1971 +++++++++++++++++ .../builds/with-complex-headers/base.ts | 69 + .../with-complex-headers/configuration.ts | 74 + .../builds/with-complex-headers/custom.d.ts | 1 + .../builds/with-complex-headers/git_push.sh | 51 + .../builds/with-complex-headers/index.ts | 16 + 15 files changed, 2973 insertions(+), 1 deletion(-) create mode 100755 bin/typescript-axios-petstore-with-complex-headers.sh create mode 100755 bin/windows/typescript-axios-petstore-with-complex-headers.bat create mode 100644 modules/openapi-generator/src/test/resources/3_0/petstore-with-complex-headers.yaml create mode 100644 samples/client/petstore/typescript-axios/builds/with-complex-headers/.gitignore create mode 100644 samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator-ignore create mode 100644 samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION create mode 100644 samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts create mode 100644 samples/client/petstore/typescript-axios/builds/with-complex-headers/base.ts create mode 100644 samples/client/petstore/typescript-axios/builds/with-complex-headers/configuration.ts create mode 100644 samples/client/petstore/typescript-axios/builds/with-complex-headers/custom.d.ts create mode 100644 samples/client/petstore/typescript-axios/builds/with-complex-headers/git_push.sh create mode 100644 samples/client/petstore/typescript-axios/builds/with-complex-headers/index.ts diff --git a/bin/typescript-axios-petstore-all.sh b/bin/typescript-axios-petstore-all.sh index de66b03904f..58d13d10f62 100755 --- a/bin/typescript-axios-petstore-all.sh +++ b/bin/typescript-axios-petstore-all.sh @@ -3,5 +3,6 @@ ./bin/typescript-axios-petstore-target-es6.sh ./bin/typescript-axios-petstore-with-npm-version.sh ./bin/typescript-axios-petstore-with-npm-version-and-separate-models-and-api.sh +./bin/typescript-axios-petstore-with-complex-headers.sh ./bin/typescript-axios-petstore-interfaces.sh ./bin/typescript-axios-petstore.sh diff --git a/bin/typescript-axios-petstore-with-complex-headers.sh b/bin/typescript-axios-petstore-with-complex-headers.sh new file mode 100755 index 00000000000..385f9684c1a --- /dev/null +++ b/bin/typescript-axios-petstore-with-complex-headers.sh @@ -0,0 +1,32 @@ +#!/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 -B clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-complex-headers.yaml -g typescript-axios -o samples/client/petstore/typescript-axios/builds/with-complex-headers $@" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/typescript-axios-petstore-all.bat b/bin/windows/typescript-axios-petstore-all.bat index 8f243f3def6..a5e4e732a1d 100644 --- a/bin/windows/typescript-axios-petstore-all.bat +++ b/bin/windows/typescript-axios-petstore-all.bat @@ -2,6 +2,7 @@ call bin\windows\typescript-axios-petstore.bat call bin\windows\typescript-axios-petstore-target-es6.bat +call bin\windows\typescript-axios-petstore-with-complex-headers.bat call bin\windows\typescript-axios-petstore-with-npm-version.bat call bin\windows\typescript-axios-petstore-interfaces.bat call bin\windows\typescript-axios-petstore-with-npm-version-and-separate-models-and-api.bat \ No newline at end of file diff --git a/bin/windows/typescript-axios-petstore-with-complex-headers.bat b/bin/windows/typescript-axios-petstore-with-complex-headers.bat new file mode 100755 index 00000000000..9cf113587ea --- /dev/null +++ b/bin/windows/typescript-axios-petstore-with-complex-headers.bat @@ -0,0 +1,12 @@ +@ECHO OFF + +set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore-with-complex-headers.yaml -g typescript-axios -o samples\client\petstore\typescript-axios\builds\with-complex-headers + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache index 52c5354446c..ad390575a88 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache @@ -133,12 +133,18 @@ export const {{classname}}AxiosParamCreator = function (configuration?: Configur {{#headerParams}} {{#isListContainer}} if ({{paramName}}) { - localVarHeaderParameter['{{baseName}}'] = {{paramName}}.join(COLLECTION_FORMATS.{{collectionFormat}}); + let mapped = {{paramName}}.map(value => ("{{{dataType}}}" !== "Array") ? JSON.stringify(value) : (value || "")); + localVarHeaderParameter['{{baseName}}'] = mapped.join(COLLECTION_FORMATS["{{collectionFormat}}"]); } {{/isListContainer}} {{^isListContainer}} if ({{paramName}} !== undefined && {{paramName}} !== null) { + {{#isString}} localVarHeaderParameter['{{baseName}}'] = String({{paramName}}); + {{/isString}} + {{^isString}} + localVarHeaderParameter['{{baseName}}'] = String(JSON.stringify({{paramName}})); + {{/isString}} } {{/isListContainer}} diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-complex-headers.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-complex-headers.yaml new file mode 100644 index 00000000000..adee68bcd0b --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-complex-headers.yaml @@ -0,0 +1,710 @@ +openapi: 3.0.0 +servers: + - url: 'http://petstore.swagger.io/v2' +info: + description: >- + This is a sample server Petstore server. For this sample, you can use the api key + `special-key` to test the authorization filters. + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: 'http://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user +paths: + /pet: + post: + tags: + - pet + summary: Add a new pet to the store + description: '' + operationId: addPet + responses: + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + parameters: + - name: header1 + in: header + schema: + $ref: '#/components/requestBodies/Pet' + - name: header2 + in: header + schema: + type: array + items: + $ref: '#/components/requestBodies/Pet' + requestBody: + $ref: '#/components/requestBodies/Pet' + put: + tags: + - pet + summary: Update an existing pet + description: '' + operationId: updatePet + responses: + '400': + description: Invalid ID supplied + '404': + description: Pet not found + '405': + description: Validation exception + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + /pet/findByStatus: + get: + tags: + - pet + summary: Finds Pets by status + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - name: status + in: query + description: Status values that need to be considered for filter + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - available + - pending + - sold + default: available + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid status value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + /pet/findByTags: + get: + tags: + - pet + summary: Finds Pets by tags + description: >- + Multiple tags can be provided with comma separated strings. Use tag1, + tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - name: tags + in: query + description: Tags to filter by + required: true + style: form + explode: false + schema: + type: array + items: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid tag value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + deprecated: true + '/pet/{petId}': + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + security: + - api_key: [] + post: + tags: + - pet + summary: Updates a pet in the store with form data + description: '' + operationId: updatePetWithForm + parameters: + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 + responses: + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + delete: + tags: + - pet + summary: Deletes a pet + description: '' + operationId: deletePet + parameters: + - name: api_key + in: header + required: false + schema: + type: string + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 + responses: + '400': + description: Invalid pet value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + '/pet/{petId}/uploadImage': + post: + tags: + - pet + summary: uploads an image + description: '' + operationId: uploadFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary + /store/inventory: + get: + tags: + - store + summary: Returns pet inventories by status + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + additionalProperties: + type: integer + format: int32 + security: + - api_key: [] + /store/order: + post: + tags: + - store + summary: Place an order for a pet + description: '' + operationId: placeOrder + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid Order + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + '/store/order/{orderId}': + get: + tags: + - store + summary: Find purchase order by ID + description: >- + For valid response try integer IDs with value <= 5 or > 10. Other values + will generated exceptions + operationId: getOrderById + parameters: + - name: orderId + in: path + description: ID of pet that needs to be fetched + required: true + schema: + type: integer + format: int64 + minimum: 1 + maximum: 5 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid ID supplied + '404': + description: Order not found + delete: + tags: + - store + summary: Delete purchase order by ID + description: >- + For valid response try integer IDs with value < 1000. Anything above + 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - name: orderId + in: path + description: ID of the order that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid ID supplied + '404': + description: Order not found + /user: + post: + tags: + - user + summary: Create user + description: This can only be done by the logged in user. + operationId: createUser + responses: + default: + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + /user/createWithArray: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithArrayInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/createWithList: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithListInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/login: + get: + tags: + - user + summary: Logs user into the system + description: '' + operationId: loginUser + parameters: + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string + responses: + '200': + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + description: date in UTC when toekn expires + schema: + type: string + format: date-time + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + '400': + description: Invalid username/password supplied + /user/logout: + get: + tags: + - user + summary: Logs out current logged in user session + description: '' + operationId: logoutUser + responses: + default: + description: successful operation + '/user/{username}': + get: + tags: + - user + summary: Get user by user name + description: '' + operationId: getUserByName + parameters: + - name: username + in: path + description: The name that needs to be fetched. Use user1 for testing. + required: true + schema: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + '400': + description: Invalid username supplied + '404': + description: User not found + put: + tags: + - user + summary: Updated user + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - name: username + in: path + description: name that need to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid user supplied + '404': + description: User not found + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + delete: + tags: + - user + summary: Delete user + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - name: username + in: path + description: The name that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid username supplied + '404': + description: User not found +externalDocs: + description: Find out more about Swagger + url: 'http://swagger.io' +components: + requestBodies: + UserArray: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + description: List of user object + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' + scopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + api_key: + type: apiKey + name: api_key + in: header + schemas: + Order: + title: Pet Order + description: An order for a pets from the pet store + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + Category: + title: Pet category + description: A category for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Category + User: + title: a User + description: A User who is purchasing from the pet store + type: object + properties: + id: + type: integer + format: int64 + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + xml: + name: User + Tag: + title: Pet Tag + description: A tag for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + Pet: + title: a Pet + description: A pet for sale in the pet store + type: object + required: + - name + - photoUrls + properties: + id: + type: integer + format: int64 + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + xml: + name: Pet + ApiResponse: + title: An uploaded response + description: Describes the result of uploading an image resource + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/.gitignore b/samples/client/petstore/typescript-axios/builds/with-complex-headers/.gitignore new file mode 100644 index 00000000000..149b5765472 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator-ignore b/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION new file mode 100644 index 00000000000..83a328a9227 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts b/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts new file mode 100644 index 00000000000..0d55f954c5a --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts @@ -0,0 +1,1971 @@ +// tslint:disable +/// +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as globalImportUrl from 'url'; +import { Configuration } from './configuration'; +import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; + +/** + * Describes the result of uploading an image resource + * @export + * @interface ApiResponse + */ +export interface ApiResponse { + /** + * + * @type {number} + * @memberof ApiResponse + */ + code?: number; + /** + * + * @type {string} + * @memberof ApiResponse + */ + type?: string; + /** + * + * @type {string} + * @memberof ApiResponse + */ + message?: string; +} +/** + * A category for a pet + * @export + * @interface Category + */ +export interface Category { + /** + * + * @type {number} + * @memberof Category + */ + id?: number; + /** + * + * @type {string} + * @memberof Category + */ + name?: string; +} +/** + * + * @export + * @interface InlineObject + */ +export interface InlineObject { + /** + * Updated name of the pet + * @type {string} + * @memberof InlineObject + */ + name?: string; + /** + * Updated status of the pet + * @type {string} + * @memberof InlineObject + */ + status?: string; +} +/** + * + * @export + * @interface InlineObject1 + */ +export interface InlineObject1 { + /** + * Additional data to pass to server + * @type {string} + * @memberof InlineObject1 + */ + additionalMetadata?: string; + /** + * file to upload + * @type {any} + * @memberof InlineObject1 + */ + file?: any; +} +/** + * An order for a pets from the pet store + * @export + * @interface Order + */ +export interface Order { + /** + * + * @type {number} + * @memberof Order + */ + id?: number; + /** + * + * @type {number} + * @memberof Order + */ + petId?: number; + /** + * + * @type {number} + * @memberof Order + */ + quantity?: number; + /** + * + * @type {Date} + * @memberof Order + */ + shipDate?: Date; + /** + * Order Status + * @type {string} + * @memberof Order + */ + status?: OrderStatusEnum; + /** + * + * @type {boolean} + * @memberof Order + */ + complete?: boolean; +} + +/** + * @export + * @enum {string} + */ +export enum OrderStatusEnum { + Placed = 'placed', + Approved = 'approved', + Delivered = 'delivered' +} + +/** + * A pet for sale in the pet store + * @export + * @interface Pet + */ +export interface Pet { + /** + * + * @type {number} + * @memberof Pet + */ + id?: number; + /** + * + * @type {Category} + * @memberof Pet + */ + category?: Category; + /** + * + * @type {string} + * @memberof Pet + */ + name: string; + /** + * + * @type {Array} + * @memberof Pet + */ + photoUrls: Array; + /** + * + * @type {Array} + * @memberof Pet + */ + tags?: Array; + /** + * pet status in the store + * @type {string} + * @memberof Pet + */ + status?: PetStatusEnum; +} + +/** + * @export + * @enum {string} + */ +export enum PetStatusEnum { + Available = 'available', + Pending = 'pending', + Sold = 'sold' +} + +/** + * A tag for a pet + * @export + * @interface Tag + */ +export interface Tag { + /** + * + * @type {number} + * @memberof Tag + */ + id?: number; + /** + * + * @type {string} + * @memberof Tag + */ + name?: string; +} +/** + * A User who is purchasing from the pet store + * @export + * @interface User + */ +export interface User { + /** + * + * @type {number} + * @memberof User + */ + id?: number; + /** + * + * @type {string} + * @memberof User + */ + username?: string; + /** + * + * @type {string} + * @memberof User + */ + firstName?: string; + /** + * + * @type {string} + * @memberof User + */ + lastName?: string; + /** + * + * @type {string} + * @memberof User + */ + email?: string; + /** + * + * @type {string} + * @memberof User + */ + password?: string; + /** + * + * @type {string} + * @memberof User + */ + phone?: string; + /** + * User Status + * @type {number} + * @memberof User + */ + userStatus?: number; +} + +/** + * PetApi - axios parameter creator + * @export + */ +export const PetApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Add a new pet to the store + * @param {Pet} pet Pet object that needs to be added to the store + * @param {Pet} [header1] + * @param {Array} [header2] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addPet(pet: Pet, header1?: Pet, header2?: Array, options: any = {}): RequestArgs { + // verify required parameter 'pet' is not null or undefined + if (pet === null || pet === undefined) { + throw new RequiredError('pet','Required parameter pet was null or undefined when calling addPet.'); + } + const localVarPath = `/pet`; + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + if (header1 !== undefined && header1 !== null) { + localVarHeaderParameter['header1'] = String(JSON.stringify(header1)); + } + + if (header2) { + let mapped = header2.map(value => ("Array" !== "Array") ? JSON.stringify(value) : (value || "")); + localVarHeaderParameter['header2'] = mapped.join(COLLECTION_FORMATS["csv"]); + } + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; + const needsSerialization = ("Pet" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.data = needsSerialization ? JSON.stringify(pet !== undefined ? pet : {}) : (pet || ""); + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Deletes a pet + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePet(petId: number, apiKey?: string, options: any = {}): RequestArgs { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling deletePet.'); + } + const localVarPath = `/pet/{petId}` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + if (apiKey !== undefined && apiKey !== null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {Array<'available' | 'pending' | 'sold'>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options: any = {}): RequestArgs { + // verify required parameter 'status' is not null or undefined + if (status === null || status === undefined) { + throw new RequiredError('status','Required parameter status was null or undefined when calling findPetsByStatus.'); + } + const localVarPath = `/pet/findByStatus`; + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + if (status) { + localVarQueryParameter['status'] = status.join(COLLECTION_FORMATS.csv); + } + + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {Array} tags Tags to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByTags(tags: Array, options: any = {}): RequestArgs { + // verify required parameter 'tags' is not null or undefined + if (tags === null || tags === undefined) { + throw new RequiredError('tags','Required parameter tags was null or undefined when calling findPetsByTags.'); + } + const localVarPath = `/pet/findByTags`; + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + if (tags) { + localVarQueryParameter['tags'] = tags.join(COLLECTION_FORMATS.csv); + } + + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns a single pet + * @summary Find pet by ID + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPetById(petId: number, options: any = {}): RequestArgs { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling getPetById.'); + } + const localVarPath = `/pet/{petId}` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication api_key required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("api_key") + : configuration.apiKey; + localVarHeaderParameter["api_key"] = localVarApiKeyValue; + } + + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Update an existing pet + * @param {Pet} pet Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePet(pet: Pet, options: any = {}): RequestArgs { + // verify required parameter 'pet' is not null or undefined + if (pet === null || pet === undefined) { + throw new RequiredError('pet','Required parameter pet was null or undefined when calling updatePet.'); + } + const localVarPath = `/pet`; + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; + const needsSerialization = ("Pet" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.data = needsSerialization ? JSON.stringify(pet !== undefined ? pet : {}) : (pet || ""); + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Updates a pet in the store with form data + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePetWithForm(petId: number, name?: string, status?: string, options: any = {}): RequestArgs { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling updatePetWithForm.'); + } + const localVarPath = `/pet/{petId}` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + const localVarFormParams = new URLSearchParams(); + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + + if (name !== undefined) { + localVarFormParams.set('name', name as any); + } + + if (status !== undefined) { + localVarFormParams.set('status', status as any); + } + + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; + localVarRequestOptions.data = localVarFormParams.toString(); + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary uploads an image + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + uploadFile(petId: number, additionalMetadata?: string, file?: any, options: any = {}): RequestArgs { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling uploadFile.'); + } + const localVarPath = `/pet/{petId}/uploadImage` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + const localVarFormParams = new FormData(); + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + + if (additionalMetadata !== undefined) { + localVarFormParams.append('additionalMetadata', additionalMetadata as any); + } + + if (file !== undefined) { + localVarFormParams.append('file', file as any); + } + + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; + localVarRequestOptions.data = localVarFormParams; + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * PetApi - functional programming interface + * @export + */ +export const PetApiFp = function(configuration?: Configuration) { + return { + /** + * + * @summary Add a new pet to the store + * @param {Pet} pet Pet object that needs to be added to the store + * @param {Pet} [header1] + * @param {Array} [header2] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addPet(pet: Pet, header1?: Pet, header2?: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).addPet(pet, header1, header2, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary Deletes a pet + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePet(petId: number, apiKey?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).deletePet(petId, apiKey, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {Array<'available' | 'pending' | 'sold'>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).findPetsByStatus(status, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {Array} tags Tags to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByTags(tags: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).findPetsByTags(tags, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * Returns a single pet + * @summary Find pet by ID + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPetById(petId: number, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).getPetById(petId, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary Update an existing pet + * @param {Pet} pet Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePet(pet: Pet, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).updatePet(pet, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary Updates a pet in the store with form data + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).updatePetWithForm(petId, name, status, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary uploads an image + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + const localVarAxiosArgs = PetApiAxiosParamCreator(configuration).uploadFile(petId, additionalMetadata, file, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + } +}; + +/** + * PetApi - factory interface + * @export + */ +export const PetApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + return { + /** + * + * @summary Add a new pet to the store + * @param {Pet} pet Pet object that needs to be added to the store + * @param {Pet} [header1] + * @param {Array} [header2] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addPet(pet: Pet, header1?: Pet, header2?: Array, options?: any) { + return PetApiFp(configuration).addPet(pet, header1, header2, options)(axios, basePath); + }, + /** + * + * @summary Deletes a pet + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePet(petId: number, apiKey?: string, options?: any) { + return PetApiFp(configuration).deletePet(petId, apiKey, options)(axios, basePath); + }, + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {Array<'available' | 'pending' | 'sold'>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any) { + return PetApiFp(configuration).findPetsByStatus(status, options)(axios, basePath); + }, + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {Array} tags Tags to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByTags(tags: Array, options?: any) { + return PetApiFp(configuration).findPetsByTags(tags, options)(axios, basePath); + }, + /** + * Returns a single pet + * @summary Find pet by ID + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPetById(petId: number, options?: any) { + return PetApiFp(configuration).getPetById(petId, options)(axios, basePath); + }, + /** + * + * @summary Update an existing pet + * @param {Pet} pet Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePet(pet: Pet, options?: any) { + return PetApiFp(configuration).updatePet(pet, options)(axios, basePath); + }, + /** + * + * @summary Updates a pet in the store with form data + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePetWithForm(petId: number, name?: string, status?: string, options?: any) { + return PetApiFp(configuration).updatePetWithForm(petId, name, status, options)(axios, basePath); + }, + /** + * + * @summary uploads an image + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any) { + return PetApiFp(configuration).uploadFile(petId, additionalMetadata, file, options)(axios, basePath); + }, + }; +}; + +/** + * PetApi - object-oriented interface + * @export + * @class PetApi + * @extends {BaseAPI} + */ +export class PetApi extends BaseAPI { + /** + * + * @summary Add a new pet to the store + * @param {Pet} pet Pet object that needs to be added to the store + * @param {Pet} [header1] + * @param {Array} [header2] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public addPet(pet: Pet, header1?: Pet, header2?: Array, options?: any) { + return PetApiFp(this.configuration).addPet(pet, header1, header2, options)(this.axios, this.basePath); + } + + /** + * + * @summary Deletes a pet + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public deletePet(petId: number, apiKey?: string, options?: any) { + return PetApiFp(this.configuration).deletePet(petId, apiKey, options)(this.axios, this.basePath); + } + + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {Array<'available' | 'pending' | 'sold'>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any) { + return PetApiFp(this.configuration).findPetsByStatus(status, options)(this.axios, this.basePath); + } + + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {Array} tags Tags to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public findPetsByTags(tags: Array, options?: any) { + return PetApiFp(this.configuration).findPetsByTags(tags, options)(this.axios, this.basePath); + } + + /** + * Returns a single pet + * @summary Find pet by ID + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public getPetById(petId: number, options?: any) { + return PetApiFp(this.configuration).getPetById(petId, options)(this.axios, this.basePath); + } + + /** + * + * @summary Update an existing pet + * @param {Pet} pet Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public updatePet(pet: Pet, options?: any) { + return PetApiFp(this.configuration).updatePet(pet, options)(this.axios, this.basePath); + } + + /** + * + * @summary Updates a pet in the store with form data + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public updatePetWithForm(petId: number, name?: string, status?: string, options?: any) { + return PetApiFp(this.configuration).updatePetWithForm(petId, name, status, options)(this.axios, this.basePath); + } + + /** + * + * @summary uploads an image + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any) { + return PetApiFp(this.configuration).uploadFile(petId, additionalMetadata, file, options)(this.axios, this.basePath); + } + +} + + +/** + * StoreApi - axios parameter creator + * @export + */ +export const StoreApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteOrder(orderId: string, options: any = {}): RequestArgs { + // verify required parameter 'orderId' is not null or undefined + if (orderId === null || orderId === undefined) { + throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling deleteOrder.'); + } + const localVarPath = `/store/order/{orderId}` + .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInventory(options: any = {}): RequestArgs { + const localVarPath = `/store/inventory`; + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication api_key required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? configuration.apiKey("api_key") + : configuration.apiKey; + localVarHeaderParameter["api_key"] = localVarApiKeyValue; + } + + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getOrderById(orderId: number, options: any = {}): RequestArgs { + // verify required parameter 'orderId' is not null or undefined + if (orderId === null || orderId === undefined) { + throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling getOrderById.'); + } + const localVarPath = `/store/order/{orderId}` + .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Place an order for a pet + * @param {Order} order order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + placeOrder(order: Order, options: any = {}): RequestArgs { + // verify required parameter 'order' is not null or undefined + if (order === null || order === undefined) { + throw new RequiredError('order','Required parameter order was null or undefined when calling placeOrder.'); + } + const localVarPath = `/store/order`; + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; + const needsSerialization = ("Order" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.data = needsSerialization ? JSON.stringify(order !== undefined ? order : {}) : (order || ""); + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * StoreApi - functional programming interface + * @export + */ +export const StoreApiFp = function(configuration?: Configuration) { + return { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteOrder(orderId: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + const localVarAxiosArgs = StoreApiAxiosParamCreator(configuration).deleteOrder(orderId, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInventory(options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: number; }> { + const localVarAxiosArgs = StoreApiAxiosParamCreator(configuration).getInventory(options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getOrderById(orderId: number, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + const localVarAxiosArgs = StoreApiAxiosParamCreator(configuration).getOrderById(orderId, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary Place an order for a pet + * @param {Order} order order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + placeOrder(order: Order, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + const localVarAxiosArgs = StoreApiAxiosParamCreator(configuration).placeOrder(order, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + } +}; + +/** + * StoreApi - factory interface + * @export + */ +export const StoreApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + return { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteOrder(orderId: string, options?: any) { + return StoreApiFp(configuration).deleteOrder(orderId, options)(axios, basePath); + }, + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInventory(options?: any) { + return StoreApiFp(configuration).getInventory(options)(axios, basePath); + }, + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getOrderById(orderId: number, options?: any) { + return StoreApiFp(configuration).getOrderById(orderId, options)(axios, basePath); + }, + /** + * + * @summary Place an order for a pet + * @param {Order} order order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + placeOrder(order: Order, options?: any) { + return StoreApiFp(configuration).placeOrder(order, options)(axios, basePath); + }, + }; +}; + +/** + * StoreApi - object-oriented interface + * @export + * @class StoreApi + * @extends {BaseAPI} + */ +export class StoreApi extends BaseAPI { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public deleteOrder(orderId: string, options?: any) { + return StoreApiFp(this.configuration).deleteOrder(orderId, options)(this.axios, this.basePath); + } + + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public getInventory(options?: any) { + return StoreApiFp(this.configuration).getInventory(options)(this.axios, this.basePath); + } + + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public getOrderById(orderId: number, options?: any) { + return StoreApiFp(this.configuration).getOrderById(orderId, options)(this.axios, this.basePath); + } + + /** + * + * @summary Place an order for a pet + * @param {Order} order order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public placeOrder(order: Order, options?: any) { + return StoreApiFp(this.configuration).placeOrder(order, options)(this.axios, this.basePath); + } + +} + + +/** + * UserApi - axios parameter creator + * @export + */ +export const UserApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {User} user Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUser(user: User, options: any = {}): RequestArgs { + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new RequiredError('user','Required parameter user was null or undefined when calling createUser.'); + } + const localVarPath = `/user`; + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; + const needsSerialization = ("User" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.data = needsSerialization ? JSON.stringify(user !== undefined ? user : {}) : (user || ""); + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} user List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithArrayInput(user: Array, options: any = {}): RequestArgs { + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new RequiredError('user','Required parameter user was null or undefined when calling createUsersWithArrayInput.'); + } + const localVarPath = `/user/createWithArray`; + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; + const needsSerialization = ("Array<User>" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.data = needsSerialization ? JSON.stringify(user !== undefined ? user : {}) : (user || ""); + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} user List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithListInput(user: Array, options: any = {}): RequestArgs { + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new RequiredError('user','Required parameter user was null or undefined when calling createUsersWithListInput.'); + } + const localVarPath = `/user/createWithList`; + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; + const needsSerialization = ("Array<User>" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.data = needsSerialization ? JSON.stringify(user !== undefined ? user : {}) : (user || ""); + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteUser(username: string, options: any = {}): RequestArgs { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling deleteUser.'); + } + const localVarPath = `/user/{username}` + .replace(`{${"username"}}`, encodeURIComponent(String(username))); + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get user by user name + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getUserByName(username: string, options: any = {}): RequestArgs { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling getUserByName.'); + } + const localVarPath = `/user/{username}` + .replace(`{${"username"}}`, encodeURIComponent(String(username))); + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Logs user into the system + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + loginUser(username: string, password: string, options: any = {}): RequestArgs { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling loginUser.'); + } + // verify required parameter 'password' is not null or undefined + if (password === null || password === undefined) { + throw new RequiredError('password','Required parameter password was null or undefined when calling loginUser.'); + } + const localVarPath = `/user/login`; + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (username !== undefined) { + localVarQueryParameter['username'] = username; + } + + if (password !== undefined) { + localVarQueryParameter['password'] = password; + } + + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + logoutUser(options: any = {}): RequestArgs { + const localVarPath = `/user/logout`; + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {string} username name that need to be deleted + * @param {User} user Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateUser(username: string, user: User, options: any = {}): RequestArgs { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling updateUser.'); + } + // verify required parameter 'user' is not null or undefined + if (user === null || user === undefined) { + throw new RequiredError('user','Required parameter user was null or undefined when calling updateUser.'); + } + const localVarPath = `/user/{username}` + .replace(`{${"username"}}`, encodeURIComponent(String(username))); + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; + const needsSerialization = ("User" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.data = needsSerialization ? JSON.stringify(user !== undefined ? user : {}) : (user || ""); + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * UserApi - functional programming interface + * @export + */ +export const UserApiFp = function(configuration?: Configuration) { + return { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {User} user Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUser(user: User, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).createUser(user, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} user List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithArrayInput(user: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).createUsersWithArrayInput(user, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} user List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithListInput(user: Array, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).createUsersWithListInput(user, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteUser(username: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).deleteUser(username, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary Get user by user name + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getUserByName(username: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).getUserByName(username, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary Logs user into the system + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + loginUser(username: string, password: string, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).loginUser(username, password, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + logoutUser(options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).logoutUser(options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {string} username name that need to be deleted + * @param {User} user Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateUser(username: string, user: User, options?: any): (axios?: AxiosInstance, basePath?: string) => AxiosPromise { + const localVarAxiosArgs = UserApiAxiosParamCreator(configuration).updateUser(username, user, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + } +}; + +/** + * UserApi - factory interface + * @export + */ +export const UserApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + return { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {User} user Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUser(user: User, options?: any) { + return UserApiFp(configuration).createUser(user, options)(axios, basePath); + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} user List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithArrayInput(user: Array, options?: any) { + return UserApiFp(configuration).createUsersWithArrayInput(user, options)(axios, basePath); + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} user List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithListInput(user: Array, options?: any) { + return UserApiFp(configuration).createUsersWithListInput(user, options)(axios, basePath); + }, + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteUser(username: string, options?: any) { + return UserApiFp(configuration).deleteUser(username, options)(axios, basePath); + }, + /** + * + * @summary Get user by user name + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getUserByName(username: string, options?: any) { + return UserApiFp(configuration).getUserByName(username, options)(axios, basePath); + }, + /** + * + * @summary Logs user into the system + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + loginUser(username: string, password: string, options?: any) { + return UserApiFp(configuration).loginUser(username, password, options)(axios, basePath); + }, + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + logoutUser(options?: any) { + return UserApiFp(configuration).logoutUser(options)(axios, basePath); + }, + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {string} username name that need to be deleted + * @param {User} user Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateUser(username: string, user: User, options?: any) { + return UserApiFp(configuration).updateUser(username, user, options)(axios, basePath); + }, + }; +}; + +/** + * UserApi - object-oriented interface + * @export + * @class UserApi + * @extends {BaseAPI} + */ +export class UserApi extends BaseAPI { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {User} user Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public createUser(user: User, options?: any) { + return UserApiFp(this.configuration).createUser(user, options)(this.axios, this.basePath); + } + + /** + * + * @summary Creates list of users with given input array + * @param {Array} user List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public createUsersWithArrayInput(user: Array, options?: any) { + return UserApiFp(this.configuration).createUsersWithArrayInput(user, options)(this.axios, this.basePath); + } + + /** + * + * @summary Creates list of users with given input array + * @param {Array} user List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public createUsersWithListInput(user: Array, options?: any) { + return UserApiFp(this.configuration).createUsersWithListInput(user, options)(this.axios, this.basePath); + } + + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public deleteUser(username: string, options?: any) { + return UserApiFp(this.configuration).deleteUser(username, options)(this.axios, this.basePath); + } + + /** + * + * @summary Get user by user name + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public getUserByName(username: string, options?: any) { + return UserApiFp(this.configuration).getUserByName(username, options)(this.axios, this.basePath); + } + + /** + * + * @summary Logs user into the system + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public loginUser(username: string, password: string, options?: any) { + return UserApiFp(this.configuration).loginUser(username, password, options)(this.axios, this.basePath); + } + + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public logoutUser(options?: any) { + return UserApiFp(this.configuration).logoutUser(options)(this.axios, this.basePath); + } + + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {string} username name that need to be deleted + * @param {User} user Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public updateUser(username: string, user: User, options?: any) { + return UserApiFp(this.configuration).updateUser(username, user, options)(this.axios, this.basePath); + } + +} + + diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/base.ts b/samples/client/petstore/typescript-axios/builds/with-complex-headers/base.ts new file mode 100644 index 00000000000..05fbaa6ea4e --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/base.ts @@ -0,0 +1,69 @@ +// tslint:disable +/// +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { Configuration } from "./configuration"; +import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; + +export const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ""); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +/** + * + * @export + * @interface RequestArgs + */ +export interface RequestArgs { + url: string; + options: any; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration | undefined; + + constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath || this.basePath; + } + } +}; + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/configuration.ts b/samples/client/petstore/typescript-axios/builds/with-complex-headers/configuration.ts new file mode 100644 index 00000000000..65f9da218d6 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/configuration.ts @@ -0,0 +1,74 @@ +// tslint:disable +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface ConfigurationParameters { + apiKey?: string | ((name: string) => string); + username?: string; + password?: string; + accessToken?: string | ((name: string, scopes?: string[]) => string); + basePath?: string; + baseOptions?: any; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: string | ((name: string) => string); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: string | ((name: string, scopes?: string[]) => string); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + /** + * base options for axios calls + * + * @type {any} + * @memberof Configuration + */ + baseOptions?: any; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + } +} diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/custom.d.ts b/samples/client/petstore/typescript-axios/builds/with-complex-headers/custom.d.ts new file mode 100644 index 00000000000..32534cb1663 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/custom.d.ts @@ -0,0 +1 @@ +declare module 'url'; \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/git_push.sh b/samples/client/petstore/typescript-axios/builds/with-complex-headers/git_push.sh new file mode 100644 index 00000000000..188eeaea7bc --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/git_push.sh @@ -0,0 +1,51 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/index.ts b/samples/client/petstore/typescript-axios/builds/with-complex-headers/index.ts new file mode 100644 index 00000000000..0cb247adefa --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/index.ts @@ -0,0 +1,16 @@ +// tslint:disable +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export * from "./api"; +export * from "./configuration"; From c684505cba2a821e4754c19c383dd8dbaacdd09e Mon Sep 17 00:00:00 2001 From: Benjamin Gill Date: Mon, 29 Jul 2019 14:01:01 +0100 Subject: [PATCH 13/75] Stop deriving Eq for models (#3463) It fails if the model contains a float, which don't implement Eq. Fix for bug introduced in #3309. We really need to improve the testing of the rust generator to catch this sort of mistake in future. I don't have time to do this now, though. --- .../openapi-generator/src/main/resources/rust/model.mustache | 4 ++-- .../client/petstore/rust-reqwest/src/models/api_response.rs | 2 +- samples/client/petstore/rust-reqwest/src/models/category.rs | 2 +- samples/client/petstore/rust-reqwest/src/models/order.rs | 4 ++-- samples/client/petstore/rust-reqwest/src/models/pet.rs | 4 ++-- samples/client/petstore/rust-reqwest/src/models/tag.rs | 2 +- samples/client/petstore/rust-reqwest/src/models/user.rs | 2 +- samples/client/petstore/rust/src/models/api_response.rs | 2 +- samples/client/petstore/rust/src/models/category.rs | 2 +- samples/client/petstore/rust/src/models/order.rs | 4 ++-- samples/client/petstore/rust/src/models/pet.rs | 4 ++-- samples/client/petstore/rust/src/models/tag.rs | 2 +- samples/client/petstore/rust/src/models/user.rs | 2 +- 13 files changed, 18 insertions(+), 18 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/rust/model.mustache b/modules/openapi-generator/src/main/resources/rust/model.mustache index f371e0e703c..1572a1a8718 100644 --- a/modules/openapi-generator/src/main/resources/rust/model.mustache +++ b/modules/openapi-generator/src/main/resources/rust/model.mustache @@ -20,7 +20,7 @@ pub enum {{classname}} { {{!-- for non-enum schemas --}} {{^isEnum}} -#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub struct {{{classname}}} { {{#vars}} {{#description}} @@ -49,7 +49,7 @@ impl {{{classname}}} { {{#vars}} {{#isEnum}} /// {{{description}}} -#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub enum {{enumName}} { {{#allowableValues}} {{#enumVars}} diff --git a/samples/client/petstore/rust-reqwest/src/models/api_response.rs b/samples/client/petstore/rust-reqwest/src/models/api_response.rs index d83716a9a1b..45395215a3f 100644 --- a/samples/client/petstore/rust-reqwest/src/models/api_response.rs +++ b/samples/client/petstore/rust-reqwest/src/models/api_response.rs @@ -11,7 +11,7 @@ /// ApiResponse : Describes the result of uploading an image resource -#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub struct ApiResponse { #[serde(rename = "code", skip_serializing_if = "Option::is_none")] pub code: Option, diff --git a/samples/client/petstore/rust-reqwest/src/models/category.rs b/samples/client/petstore/rust-reqwest/src/models/category.rs index 4b2c812339b..1c8763902ba 100644 --- a/samples/client/petstore/rust-reqwest/src/models/category.rs +++ b/samples/client/petstore/rust-reqwest/src/models/category.rs @@ -11,7 +11,7 @@ /// Category : A category for a pet -#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub struct Category { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, diff --git a/samples/client/petstore/rust-reqwest/src/models/order.rs b/samples/client/petstore/rust-reqwest/src/models/order.rs index 637dd71cde5..685e080e312 100644 --- a/samples/client/petstore/rust-reqwest/src/models/order.rs +++ b/samples/client/petstore/rust-reqwest/src/models/order.rs @@ -11,7 +11,7 @@ /// Order : An order for a pets from the pet store -#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub struct Order { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, @@ -43,7 +43,7 @@ impl Order { } /// Order Status -#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub enum Status { #[serde(rename = "placed")] Placed, diff --git a/samples/client/petstore/rust-reqwest/src/models/pet.rs b/samples/client/petstore/rust-reqwest/src/models/pet.rs index efc6f370ff5..2da297169eb 100644 --- a/samples/client/petstore/rust-reqwest/src/models/pet.rs +++ b/samples/client/petstore/rust-reqwest/src/models/pet.rs @@ -11,7 +11,7 @@ /// Pet : A pet for sale in the pet store -#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub struct Pet { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, @@ -43,7 +43,7 @@ impl Pet { } /// pet status in the store -#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub enum Status { #[serde(rename = "available")] Available, diff --git a/samples/client/petstore/rust-reqwest/src/models/tag.rs b/samples/client/petstore/rust-reqwest/src/models/tag.rs index 69e361463e3..364143932c0 100644 --- a/samples/client/petstore/rust-reqwest/src/models/tag.rs +++ b/samples/client/petstore/rust-reqwest/src/models/tag.rs @@ -11,7 +11,7 @@ /// Tag : A tag for a pet -#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub struct Tag { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, diff --git a/samples/client/petstore/rust-reqwest/src/models/user.rs b/samples/client/petstore/rust-reqwest/src/models/user.rs index e204a5e325c..b6b9fc78fb9 100644 --- a/samples/client/petstore/rust-reqwest/src/models/user.rs +++ b/samples/client/petstore/rust-reqwest/src/models/user.rs @@ -11,7 +11,7 @@ /// User : A User who is purchasing from the pet store -#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub struct User { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, diff --git a/samples/client/petstore/rust/src/models/api_response.rs b/samples/client/petstore/rust/src/models/api_response.rs index d83716a9a1b..45395215a3f 100644 --- a/samples/client/petstore/rust/src/models/api_response.rs +++ b/samples/client/petstore/rust/src/models/api_response.rs @@ -11,7 +11,7 @@ /// ApiResponse : Describes the result of uploading an image resource -#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub struct ApiResponse { #[serde(rename = "code", skip_serializing_if = "Option::is_none")] pub code: Option, diff --git a/samples/client/petstore/rust/src/models/category.rs b/samples/client/petstore/rust/src/models/category.rs index 4b2c812339b..1c8763902ba 100644 --- a/samples/client/petstore/rust/src/models/category.rs +++ b/samples/client/petstore/rust/src/models/category.rs @@ -11,7 +11,7 @@ /// Category : A category for a pet -#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub struct Category { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, diff --git a/samples/client/petstore/rust/src/models/order.rs b/samples/client/petstore/rust/src/models/order.rs index 637dd71cde5..685e080e312 100644 --- a/samples/client/petstore/rust/src/models/order.rs +++ b/samples/client/petstore/rust/src/models/order.rs @@ -11,7 +11,7 @@ /// Order : An order for a pets from the pet store -#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub struct Order { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, @@ -43,7 +43,7 @@ impl Order { } /// Order Status -#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub enum Status { #[serde(rename = "placed")] Placed, diff --git a/samples/client/petstore/rust/src/models/pet.rs b/samples/client/petstore/rust/src/models/pet.rs index efc6f370ff5..2da297169eb 100644 --- a/samples/client/petstore/rust/src/models/pet.rs +++ b/samples/client/petstore/rust/src/models/pet.rs @@ -11,7 +11,7 @@ /// Pet : A pet for sale in the pet store -#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub struct Pet { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, @@ -43,7 +43,7 @@ impl Pet { } /// pet status in the store -#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub enum Status { #[serde(rename = "available")] Available, diff --git a/samples/client/petstore/rust/src/models/tag.rs b/samples/client/petstore/rust/src/models/tag.rs index 69e361463e3..364143932c0 100644 --- a/samples/client/petstore/rust/src/models/tag.rs +++ b/samples/client/petstore/rust/src/models/tag.rs @@ -11,7 +11,7 @@ /// Tag : A tag for a pet -#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub struct Tag { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, diff --git a/samples/client/petstore/rust/src/models/user.rs b/samples/client/petstore/rust/src/models/user.rs index e204a5e325c..b6b9fc78fb9 100644 --- a/samples/client/petstore/rust/src/models/user.rs +++ b/samples/client/petstore/rust/src/models/user.rs @@ -11,7 +11,7 @@ /// User : A User who is purchasing from the pet store -#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub struct User { #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option, From 37cdc8e4939cf3044397d37ee63ecf6e820a2946 Mon Sep 17 00:00:00 2001 From: Michal Foksa Date: Mon, 29 Jul 2019 15:34:50 +0200 Subject: [PATCH 14/75] Feature/mustache lambda documentation (#3476) * Default outputFile value is `openapi/openapi.yaml`. * Mustache Lambdas documentation. * Default OpenAPIYamlGenerator outputFile value is `openapi/openapi.yaml`. --- docs/generators/openapi-yaml.md | 2 +- docs/templating.md | 97 +++++++++++-------- .../languages/OpenAPIYamlGenerator.java | 2 +- 3 files changed, 58 insertions(+), 43 deletions(-) diff --git a/docs/generators/openapi-yaml.md b/docs/generators/openapi-yaml.md index 1dfe1b9f481..5bc5c746885 100644 --- a/docs/generators/openapi-yaml.md +++ b/docs/generators/openapi-yaml.md @@ -11,4 +11,4 @@ sidebar_label: openapi-yaml |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|outputFile|output filename| |null| +|outputFile|Output filename| |openapi/openapi.yaml| diff --git a/docs/templating.md b/docs/templating.md index 6452a58c6db..287f8060c99 100644 --- a/docs/templating.md +++ b/docs/templating.md @@ -16,7 +16,7 @@ The transform logic needs to implement [CodegenConfig.java](https://github.com/o > OpenAPI Generator applies user-defined templates via options: > * CLI: `-t/--template` CLI options > * Maven Plugin: `templateDirectory` -> * Gradle Plugin: `templateDir` +> * Gradle Plugin: `templateDir` Built-in templates are written in Mustache and processed by [jmustache](https://github.com/samskivert/jmustache). Beginning with version 4.0.0, we support experimental Handlebars and user-defined template engines via plugins. @@ -26,7 +26,7 @@ OpenAPI Generator supports user-defined templates. This approach is often the ea ### Custom Logic -For this example, let's modify a Java client to use AOP via [jcabi/jcabi-aspects](https://github.com/jcabi/jcabi-aspects). We'll log API method execution at the `INFO` level. The jcabi-aspects project could also be used to implement method retries on failures; this would be a great exercise to further play around with templating. +For this example, let's modify a Java client to use AOP via [jcabi/jcabi-aspects](https://github.com/jcabi/jcabi-aspects). We'll log API method execution at the `INFO` level. The jcabi-aspects project could also be used to implement method retries on failures; this would be a great exercise to further play around with templating. The Java generator supports a `library` option. This option works by defining base templates, then applying library-specific template overrides. This allows for template reuse for libraries sharing the same programming language. Templates defined as a library need only modify or extend the templates concerning the library, and generation falls back to the root templates (the "defaults") when not extended by the library. Generators which support the `library` option will only support the libraries known by the generator at compile time, and will throw a runtime error if you try to provide a custom library name. @@ -77,7 +77,7 @@ index 3b40702..a6d12e0 100644 +++ b/libraries/resteasy/build.gradle.mustache @@ -134,6 +134,7 @@ ext { } - + dependencies { + compile "com.jcabi:jcabi-aspects:0.22.6" compile "io.swagger:swagger-annotations:$swagger_annotations_version" @@ -95,7 +95,7 @@ index a4d0f9f..49b17c7 100644 +++ b/libraries/resteasy/api.mustache @@ -1,5 +1,6 @@ package {{package}}; - + +import com.jcabi.aspects.Loggable; import {{invokerPackage}}.ApiException; import {{invokerPackage}}.ApiClient; @@ -134,7 +134,7 @@ index 04a9d55..7a93c50 100644 apply plugin: 'idea' apply plugin: 'eclipse' +apply plugin: 'aspectj' - + group = '{{groupId}}' version = '{{artifactVersion}}' @@ -12,6 +13,7 @@ buildscript { @@ -144,14 +144,14 @@ index 04a9d55..7a93c50 100644 + classpath "net.uberfoo.gradle:gradle-aspectj:2.2" } } - + @@ -140,9 +142,18 @@ ext { jersey_version = "1.19.4" jodatime_version = "2.9.9" junit_version = "4.12" + aspectjVersion = '1.9.0' } - + +sourceCompatibility = '1.8' +targetCompatibility = '1.8' + @@ -199,7 +199,7 @@ Make sure your custom template compiles: ```bash cd ~/.openapi-generator/example gradle assemble -# or, regenerate the wrapper +# or, regenerate the wrapper gradle wrapper --gradle-version 4.8 --distribution-type all ./gradlew assemble ``` @@ -291,7 +291,7 @@ Modifications to the new project's `build.gradle` should be made in the `plugins id 'org.jetbrains.kotlin.jvm' version '1.3.11' id "com.github.johnrengelman.shadow" version "5.0.0" } - + dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8" compile "org.openapitools:openapi-generator-core:4.0.0-SNAPSHOT" @@ -301,7 +301,7 @@ Modifications to the new project's `build.gradle` should be made in the `plugins The above configuration for the `shadow` plugin is strictly optional. It is not needed, for instance, if you plan to publish your adapter and consume it via the Maven or Gradle plugins. -Next, create a new class file called `PebbleTemplateEngineAdapter` under `src/kotlin`. We'll define the template adapter's name as `pebble` and we'll also list this as the only supported file extension. We'll implement the adapter by extending `AbstractTemplatingEngineAdapter`, which includes reusable logic, such as retrieving a list of all possible template names for our provided template extensions(s). +Next, create a new class file called `PebbleTemplateEngineAdapter` under `src/kotlin`. We'll define the template adapter's name as `pebble` and we'll also list this as the only supported file extension. We'll implement the adapter by extending `AbstractTemplatingEngineAdapter`, which includes reusable logic, such as retrieving a list of all possible template names for our provided template extensions(s). The class in its simplest form looks like this (with inline comments): @@ -374,7 +374,7 @@ import ( {% endfor %} ) -type Generated{{classname}}Servicer +type Generated{{classname}}Servicer // etc ``` @@ -402,7 +402,7 @@ type {{item.classname}} struct { > Find object structures passed to templates later in this document's **Structures** section. -Finally, we can compile some code by explicitly defining our classpath and jar entrypoint for CLI (be sure to modify `/your/path` below) +Finally, we can compile some code by explicitly defining our classpath and jar entrypoint for CLI (be sure to modify `/your/path` below) ```bash java $JAVA_OPTS -cp /your/path/build/libs/pebble-template-adapter-1.0-SNAPSHOT-all.jar:modules/openapi-generator-cli/target/openapi-generator-cli.jar \ @@ -428,49 +428,49 @@ Examples for the following structures will be presented using the following spec ```yaml swagger: "2.0" - info: + info: version: "1.0.0" title: "Swagger Petstore" description: "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification" termsOfService: "http://swagger.io/terms/" - contact: + contact: name: "Swagger API Team" - license: + license: name: "MIT" host: "petstore.swagger.io" basePath: "/api" - schemes: + schemes: - "http" - consumes: + consumes: - "application/json" - produces: + produces: - "application/json" - paths: - /pets: - get: + paths: + /pets: + get: description: "Returns all pets from the system that the user has access to" - produces: + produces: - "application/json" - responses: + responses: "200": description: "A list of pets." - schema: + schema: type: "array" - items: + items: $ref: "#/definitions/Pet" - definitions: - Pet: + definitions: + Pet: type: "object" - required: + required: - "id" - "name" - properties: - id: + properties: + id: type: "integer" format: "int64" - name: + name: type: "string" - tag: + tag: type: "string" ``` @@ -478,9 +478,9 @@ Examples for the following structures will be presented using the following spec ### Operations > Inspect operation structures passed to templates with system property `-DdebugOpenAPI` -> +> > Example: -> +> > ```bash > openapi-generator generate -g go \ > -o out \ @@ -510,9 +510,9 @@ Here, an Operation with tag `Pet` will generate two files: `SWGPetApi.h` and `SW ### Models > Inspect models passed to templates with system property `-DdebugModels` -> +> > Execute: -> +> > ```bash > openapi-generator generate -g go \ > -o out \ @@ -730,14 +730,14 @@ Templates are passed redundant properties, depending on the semantics of the arr * `readOnlyVars` lists all model properties marked with `readonly` in the spec document * `allVars` lists all model properties. This may include the same set as `vars`, but may also include generator-defined properties -We expose the same properties in multiple sets because this allows us to conditionally iterate over properties based on some condition ("is it required" or "is it readonly"). This is driven by the use of the logic-less Mustache templates. It is possible that models passed to the templating engine may be cleaned up as we support more template engines, but such an effort will go through a deprecation phase and would be communicated at runtime through log messages. +We expose the same properties in multiple sets because this allows us to conditionally iterate over properties based on some condition ("is it required" or "is it readonly"). This is driven by the use of the logic-less Mustache templates. It is possible that models passed to the templating engine may be cleaned up as we support more template engines, but such an effort will go through a deprecation phase and would be communicated at runtime through log messages. ### supportingFiles > Inspect supportingFiles passed to templates with system property `-DdebugSupportingFiles` -> +> > Execute: -> +> > ```bash > openapi-generator generate -g go \ > -o out \ @@ -755,10 +755,25 @@ Supporting files can either be processed through the templating engine or copied > This is a very limited list of variable name explanations. Feel free to [open a pull request](https://github.com/OpenAPITools/openapi-generator/pull/new/master) to add to this documentation! -- **complexType**: stores the name of the model (e.g. Pet) +- **complexType**: stores the name of the model (e.g. Pet) - **isContainer**: true if the parameter or property is an array or a map. - **isPrimitiveType**: true if the parameter or property type is a primitive type (e.g. string, integer, etc) as defined in the spec. +## Mustache Lambdas + +Many generators (*those extending DefaultCodegen*) come with a small set of lambda functions available under the key `lambda`: + +- `lowercase` - Converts all of the characters in this fragment to lower case using the rules of the `ROOT` locale. +- `uppercase` - Converts all of the characters in this fragment to upper case using the rules of the `ROOT` locale. +- `titlecase` - Converts text in a fragment to title case. For example `once upon a time` to `Once Upon A Time`. +- `camelcase` - Converts text in a fragment to camelCase. For example `Input-text` to `inputText`. +- `indented` - Prepends 4 spaces indention from second line of a fragment on. First line will be indented by Mustache. +- `indented_8` - Prepends 8 spaces indention from second line of a fragment on. First line will be indented by Mustache. +- `indented_12` - Prepends 12 spaces indention from second line of a fragment on. First line will be indented by Mustache. +- `indented_16` -Prepends 16 spaces indention from second line of a fragment on. First line will be indented by Mustache. + +Lambda is invoked by `lambda.[lambda name]` expression. For example: `{{#lambda.lowercase}}FRAGMENT TO LOWERCASE{{/lambda.lowercase}}` to lower case text between `lambda.lowercase`. + ## Extensions OpenAPI supports a concept called "Extensions". These are called "Specification Extensions" [in 3.x](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#specificationExtensions) and "Vendor Extensions" [in 2.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#vendorExtensions). @@ -861,7 +876,7 @@ paths: #### x-mysqlSchema -MySQL schema generator creates vendor extensions based on openapi `dataType` and `dataFormat`. When user defined extensions with same key already exists codegen accepts those as is. It means it won't validate properties or correct it for you. Every model in `definitions` can contain table related and column related extensions like in example below: +MySQL schema generator creates vendor extensions based on openapi `dataType` and `dataFormat`. When user defined extensions with same key already exists codegen accepts those as is. It means it won't validate properties or correct it for you. Every model in `definitions` can contain table related and column related extensions like in example below: ```yaml definitions: diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OpenAPIYamlGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OpenAPIYamlGenerator.java index ca1e9102664..02481665a55 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OpenAPIYamlGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OpenAPIYamlGenerator.java @@ -42,7 +42,7 @@ public class OpenAPIYamlGenerator extends DefaultCodegen implements CodegenConfi super(); embeddedTemplateDir = templateDir = "openapi-yaml"; outputFolder = "generated-code/openapi-yaml"; - cliOptions.add(new CliOption(OUTPUT_NAME, "output filename")); + cliOptions.add(CliOption.newString(OUTPUT_NAME, "Output filename").defaultValue(outputFile)); supportingFiles.add(new SupportingFile("README.md", "", "README.md")); } From 3b584c21388d2b141152feee32dec16fbbdfa092 Mon Sep 17 00:00:00 2001 From: timmiotool <33017641+Tim-Smyth@users.noreply.github.com> Date: Mon, 29 Jul 2019 18:06:20 +0200 Subject: [PATCH 15/75] validation for primitive request bodies #3491 (#3492) * Add parameters to primitive request bodies Signed-off-by: tim.smyth * Replace tabs for spaces Signed-off-by: tim.smyth --- .../java/org/openapitools/codegen/DefaultCodegen.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 661a7ab7f09..acb24f48f36 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -4928,6 +4928,15 @@ public class DefaultCodegen implements CodegenConfig { codegenParameter.dataType = codegenProperty.dataType; codegenParameter.description = codegenProperty.description; codegenParameter.paramName = toParamName(codegenParameter.baseName); + codegenParameter.minimum = codegenProperty.minimum; + codegenParameter.maximum = codegenProperty.maximum; + codegenParameter.exclusiveMinimum = codegenProperty.exclusiveMinimum; + codegenParameter.exclusiveMaximum = codegenProperty.exclusiveMaximum; + codegenParameter.minLength = codegenProperty.minLength; + codegenParameter.maxLength = codegenProperty.maxLength; + codegenParameter.pattern = codegenProperty.pattern; + + if (codegenProperty.complexType != null) { imports.add(codegenProperty.complexType); From f90507b52768282f745bd75c886906c52315232d Mon Sep 17 00:00:00 2001 From: Doxoh Date: Tue, 30 Jul 2019 12:22:15 +0200 Subject: [PATCH 16/75] [aspnetcore] Support cookie parameter (#3490) * Fix typo useDefaultRoutng to useDefaultRouting * support the cookie functionality in aspnetcore * Changes like wing328 comments --- .../resources/aspnetcore/2.1/controller.mustache | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/controller.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/controller.mustache index 0c136c8a8b8..99492c9a604 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/controller.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/controller.mustache @@ -40,9 +40,14 @@ namespace {{apiPackage}} [SwaggerOperation("{{operationId}}")]{{#responses}}{{#dataType}} [SwaggerResponse(statusCode: {{code}}, type: typeof({{&dataType}}), description: "{{message}}")]{{/dataType}}{{^dataType}}{{/dataType}}{{/responses}}{{/useSwashbuckle}}{{^useSwashbuckle}}{{#responses}}{{#dataType}} [ProducesResponseType(statusCode: {{code}}, type: typeof({{&dataType}}))]{{/dataType}}{{^dataType}}{{/dataType}}{{/responses}}{{/useSwashbuckle}} - public {{operationModifier}} {{#operationResultTask}}{{#operationIsAsync}}async {{/operationIsAsync}}Task<{{/operationResultTask}}IActionResult{{#operationResultTask}}>{{/operationResultTask}} {{operationId}}({{#allParams}}{{>pathParam}}{{>queryParam}}{{>bodyParam}}{{>formParam}}{{>headerParam}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{^generateBody}};{{/generateBody}} + public {{operationModifier}} {{#operationResultTask}}{{#operationIsAsync}}async {{/operationIsAsync}}Task<{{/operationResultTask}}IActionResult{{#operationResultTask}}>{{/operationResultTask}} {{operationId}}({{#allParams}}{{>pathParam}}{{>queryParam}}{{>bodyParam}}{{>formParam}}{{>headerParam}}{{#hasMore}}{{^isCookieParam}}, {{/isCookieParam}}{{/hasMore}}{{/allParams}}){{^generateBody}};{{/generateBody}} {{#generateBody}} - { {{#responses}} + { + {{#cookieParams}} + var {{paramName}} = Request.Cookies["{{paramName}}"]; + {{/cookieParams}} + +{{#responses}} {{#dataType}} //TODO: Uncomment the next line to return response {{code}} or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode({{code}}, default({{&dataType}})); @@ -50,7 +55,8 @@ namespace {{apiPackage}} {{^dataType}} //TODO: Uncomment the next line to return response {{code}} or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode({{code}}); -{{/dataType}}{{/responses}} +{{/dataType}} +{{/responses}} {{#returnType}} string exampleJson = null; {{#examples}} From 6824bd8b2445e54c25f26589ac51eac3de62f0e9 Mon Sep 17 00:00:00 2001 From: julaudo Date: Tue, 30 Jul 2019 15:47:17 +0200 Subject: [PATCH 17/75] #2694 [BUG][Typescript Axios] Content-type not set (#2695) * #2694 [BUG][Typescript Axios] Content-type not set * Test required allOf * re-generate typescript-axios samples * re-generate typescript-axios samples --- .../openapitools/codegen/DefaultCodegen.java | 7 ++ .../typescript-axios/apiInner.mustache | 4 +- .../codegen/DefaultCodegenTest.java | 38 ++++++++++ .../resources/3_0/allOf-required-parent.yaml | 75 +++++++++++++++++++ .../test/resources/3_0/allOf-required.yaml | 42 +++++++++++ .../typescript-axios/builds/default/api.ts | 58 +++++++++----- .../typescript-axios/builds/es6-target/api.ts | 58 +++++++++----- .../builds/with-complex-headers/api.ts | 58 +++++++++----- .../builds/with-interfaces/api.ts | 58 +++++++++----- .../api/another/level/pet-api.ts | 22 ++++-- .../api/another/level/store-api.ts | 12 ++- .../api/another/level/user-api.ts | 24 ++++-- .../builds/with-npm-version/api.ts | 58 +++++++++----- 13 files changed, 404 insertions(+), 110 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/allOf-required-parent.yaml create mode 100644 modules/openapi-generator/src/test/resources/3_0/allOf-required.yaml diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index acb24f48f36..90ae91674c1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -1870,6 +1870,9 @@ public class DefaultCodegen implements CodegenConfig { } } + if(composed.getRequired() != null) { + required.addAll(composed.getRequired()); + } addVars(m, unaliasPropertySchema(properties), required, unaliasPropertySchema(allProperties), allRequired); // end of code block for composed schema @@ -1975,6 +1978,10 @@ public class DefaultCodegen implements CodegenConfig { addProperties(properties, required, component); } + if(schema.getRequired() != null) { + required.addAll(schema.getRequired()); + } + if (composedSchema.getOneOf() != null) { throw new RuntimeException("Please report the issue: Cannot process oneOf (Composed Scheme) in addProperties: " + schema); } diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache index ad390575a88..62103f4c7db 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache @@ -170,10 +170,10 @@ export const {{classname}}AxiosParamCreator = function (configuration?: Configur } {{/isListContainer}} {{/formParams}}{{/vendorExtensions}} - {{#hasFormParams}}{{#multipartFormData}} + {{#vendorExtensions}}{{#hasFormParams}}{{^multipartFormData}} localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded';{{/multipartFormData}}{{#multipartFormData}} localVarHeaderParameter['Content-Type'] = 'multipart/form-data';{{/multipartFormData}} - {{/hasFormParams}} + {{/hasFormParams}}{{/vendorExtensions}} {{#bodyParam}} {{^consumes}} localVarHeaderParameter['Content-Type'] = 'application/json'; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java index 871958108e8..167177017f5 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java @@ -477,6 +477,44 @@ public class DefaultCodegenTest { Assert.assertEquals(childModel.parentSchema, "Person"); } + @Test + public void testAllOfRequired() { + final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/allOf-required.yaml"); + DefaultCodegen codegen = new DefaultCodegen(); + + Schema child = openAPI.getComponents().getSchemas().get("clubForCreation"); + codegen.setOpenAPI(openAPI); + CodegenModel childModel = codegen.fromModel("clubForCreation", child); + showVars(childModel); + } + + @Test + public void testAllOfParent() { + final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/allOf-required-parent.yaml"); + DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + + Schema person = openAPI.getComponents().getSchemas().get("person"); + CodegenModel personModel = codegen.fromModel("person", person); + showVars(personModel); + + Schema personForCreation = openAPI.getComponents().getSchemas().get("personForCreation"); + CodegenModel personForCreationModel = codegen.fromModel("personForCreation", personForCreation); + showVars(personForCreationModel); + + Schema personForUpdate = openAPI.getComponents().getSchemas().get("personForUpdate"); + CodegenModel personForUpdateModel = codegen.fromModel("personForUpdate", personForUpdate); + showVars(personForUpdateModel); + } + + private void showVars(CodegenModel model) { + if(model.getRequiredVars() != null) { + + System.out.println(model.getRequiredVars().stream().map(v -> v.name).collect(Collectors.toList())); + } + } + + @Test public void testCallbacks() { final OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/callbacks.yaml"); diff --git a/modules/openapi-generator/src/test/resources/3_0/allOf-required-parent.yaml b/modules/openapi-generator/src/test/resources/3_0/allOf-required-parent.yaml new file mode 100644 index 00000000000..d6a24e2aef7 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/allOf-required-parent.yaml @@ -0,0 +1,75 @@ +openapi: 3.0.1 +info: + version: 1.0.0 + title: Example + license: + name: MIT +servers: + - url: http://api.example.xyz/v1 +paths: + /person/display/{personId}: + get: + parameters: + - name: personId + in: path + required: true + description: The id of the person to retrieve + schema: + type: string + operationId: list + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/person" +components: + schemas: + person: + allOf: + - $ref: '#/components/schemas/personForCreation' + - properties: + id: + type: integer + format: int32 + required: + - id + + personForCreation: + allOf: + - $ref: '#/components/schemas/personForUpdate' + required: + - firstName + - name + - email + + personForUpdate: + properties: + firstName: + type: string + maxLength: 255 + name: + type: string + maxLength: 255 + birthDate: + type: string + format: date + address: + type: string + maxLength: 255 + postalCode: + type: string + maxLength: 255 + city: + type: string + maxLength: 255 + phoneNumber: + type: string + pattern: ^((\+)33|0)[1-9](\d{2}){4}$ + email: + type: string + format: email + nationality: + type: string + maxLength: 255 \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/allOf-required.yaml b/modules/openapi-generator/src/test/resources/3_0/allOf-required.yaml new file mode 100644 index 00000000000..adf10632952 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/allOf-required.yaml @@ -0,0 +1,42 @@ +openapi: 3.0.1 +info: + version: 1.0.0 + title: Example + license: + name: MIT +servers: + - url: http://api.example.xyz/v1 +paths: + /person/display/{personId}: + get: + parameters: + - name: personId + in: path + required: true + description: The id of the person to retrieve + schema: + type: string + operationId: list + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/clubForCreation" +components: + schemas: + clubForCreation: + allOf: + - $ref: '#/components/schemas/clubForUpdate' + required: + - name + + clubForUpdate: + properties: + name: + type: string + maxLength: 255 + shortName: + type: string + maxLength: 255 \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/default/api.ts b/samples/client/petstore/typescript-axios/builds/default/api.ts index c746467d270..a74fbd67fae 100644 --- a/samples/client/petstore/typescript-axios/builds/default/api.ts +++ b/samples/client/petstore/typescript-axios/builds/default/api.ts @@ -283,7 +283,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -335,7 +336,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -381,7 +383,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -427,7 +430,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -469,7 +473,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -511,7 +516,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -570,6 +576,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } + localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; @@ -626,6 +634,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } + localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; @@ -1001,7 +1011,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1037,7 +1048,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1071,7 +1083,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1104,7 +1117,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -1319,7 +1333,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -1356,7 +1371,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -1393,7 +1409,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -1431,7 +1448,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1465,7 +1483,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1511,7 +1530,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1539,7 +1559,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1578,7 +1599,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/api.ts b/samples/client/petstore/typescript-axios/builds/es6-target/api.ts index c746467d270..a74fbd67fae 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/api.ts +++ b/samples/client/petstore/typescript-axios/builds/es6-target/api.ts @@ -283,7 +283,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -335,7 +336,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -381,7 +383,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -427,7 +430,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -469,7 +473,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -511,7 +516,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -570,6 +576,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } + localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; @@ -626,6 +634,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } + localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; @@ -1001,7 +1011,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1037,7 +1048,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1071,7 +1083,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1104,7 +1117,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -1319,7 +1333,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -1356,7 +1371,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -1393,7 +1409,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -1431,7 +1448,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1465,7 +1483,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1511,7 +1530,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1539,7 +1559,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1578,7 +1599,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts b/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts index 0d55f954c5a..8414cbc351d 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts @@ -332,7 +332,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -384,7 +385,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -430,7 +432,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -476,7 +479,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -518,7 +522,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -560,7 +565,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -619,6 +625,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } + localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; @@ -675,6 +683,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } + localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; @@ -1056,7 +1066,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1092,7 +1103,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1126,7 +1138,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1159,7 +1172,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -1374,7 +1388,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -1411,7 +1426,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -1448,7 +1464,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -1486,7 +1503,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1520,7 +1538,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1566,7 +1585,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1594,7 +1614,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1633,7 +1654,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts b/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts index 8b55c348453..2e124df7807 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts @@ -283,7 +283,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -335,7 +336,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -381,7 +383,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -427,7 +430,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -469,7 +473,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -511,7 +516,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -570,6 +576,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } + localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; @@ -626,6 +634,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } + localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; @@ -1094,7 +1104,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1130,7 +1141,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1164,7 +1176,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1197,7 +1210,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -1459,7 +1473,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -1496,7 +1511,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -1533,7 +1549,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -1571,7 +1588,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1605,7 +1623,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1651,7 +1670,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1679,7 +1699,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1718,7 +1739,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts index 99b968d0283..486d267caf2 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts @@ -58,7 +58,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -110,7 +111,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -156,7 +158,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -202,7 +205,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -244,7 +248,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -286,7 +291,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -345,6 +351,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } + localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; @@ -401,6 +409,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } + localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts index b8c0ea2f6a9..fde70168950 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts @@ -49,7 +49,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -85,7 +86,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -119,7 +121,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -152,7 +155,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts index fdf8f18d093..d8ded5b31df 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts @@ -48,7 +48,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -85,7 +86,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -122,7 +124,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -160,7 +163,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -194,7 +198,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -240,7 +245,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -268,7 +274,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -307,7 +314,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts index c746467d270..a74fbd67fae 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts @@ -283,7 +283,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -335,7 +336,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -381,7 +383,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -427,7 +430,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -469,7 +473,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -511,7 +516,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -570,6 +576,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } + localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; @@ -626,6 +634,8 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) } + localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; @@ -1001,7 +1011,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1037,7 +1048,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1071,7 +1083,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1104,7 +1117,8 @@ export const StoreApiAxiosParamCreator = function (configuration?: Configuration const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -1319,7 +1333,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -1356,7 +1371,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -1393,7 +1409,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 @@ -1431,7 +1448,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1465,7 +1483,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1511,7 +1530,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) } - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1539,7 +1559,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 delete localVarUrlObj.search; localVarRequestOptions.headers = {...localVarHeaderParameter, ...options.headers}; @@ -1578,7 +1599,8 @@ export const UserApiAxiosParamCreator = function (configuration?: Configuration) const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarHeaderParameter['Content-Type'] = 'application/json'; localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 From d46cabcd4f7aa9b33dd526af0e6224670031e93e Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 31 Jul 2019 13:50:29 +0800 Subject: [PATCH 18/75] Better handling of dot in inline model name (#3498) * better handling of dot in inline model name * do nothing if title is present * add comment --- .../openapitools/codegen/InlineModelResolver.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java index 5ea4a08a1a3..4ed482f4b8f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java @@ -407,9 +407,19 @@ public class InlineModelResolver { } } + /** + * Generates a unique model name. Non-alphanumeric characters will be replaced + * with underscores + * + * @param title String title field in the schema if present + * @param key String model name + */ private String resolveModelName(String title, String key) { if (title == null) { - return uniqueName(key); + // for auto-generated schema name, replace non-alphanumeric characters with underscore + // to avoid bugs with schema look up with inline schema created on the fly + // e.g. io.schema.User_name => io_schema_User_name + return uniqueName(key).replaceAll("[^A-Za-z0-9]", "_"); } else { return uniqueName(title); } @@ -589,4 +599,4 @@ public class InlineModelResolver { target.addExtension(extName, vendorExtensions.get(extName)); } } -} \ No newline at end of file +} From 4c9d0234683e82335554573498282198a9e305da Mon Sep 17 00:00:00 2001 From: Thibault Duperron Date: Wed, 31 Jul 2019 08:22:05 +0200 Subject: [PATCH 19/75] Enable async option for spring-cloud library (#2670) * Enable async option for spring-cloud library * Samples --- bin/spring-all-petstore.sh | 1 + bin/spring-cloud-feign-async-petstore.sh | 35 +++ .../codegen/languages/SpringCodegen.java | 73 +++-- .../src/main/resources/scala-finch/sbt | 0 .../java/spring/SpringCodegenTest.java | 53 +++- .../.openapi-generator-ignore | 23 ++ .../.openapi-generator/VERSION | 1 + .../petstore/spring-cloud-async/README.md | 53 ++++ .../petstore/spring-cloud-async/pom.xml | 64 +++++ .../java/org/openapitools/api/PetApi.java | 151 ++++++++++ .../org/openapitools/api/PetApiClient.java | 8 + .../java/org/openapitools/api/StoreApi.java | 76 +++++ .../org/openapitools/api/StoreApiClient.java | 8 + .../java/org/openapitools/api/UserApi.java | 106 +++++++ .../org/openapitools/api/UserApiClient.java | 8 + .../ApiKeyRequestInterceptor.java | 31 +++ .../configuration/ClientConfiguration.java | 49 ++++ .../java/org/openapitools/model/Category.java | 105 +++++++ .../openapitools/model/ModelApiResponse.java | 130 +++++++++ .../java/org/openapitools/model/Order.java | 241 ++++++++++++++++ .../main/java/org/openapitools/model/Pet.java | 262 ++++++++++++++++++ .../main/java/org/openapitools/model/Tag.java | 105 +++++++ .../java/org/openapitools/model/User.java | 255 +++++++++++++++++ 23 files changed, 1806 insertions(+), 32 deletions(-) create mode 100755 bin/spring-cloud-feign-async-petstore.sh mode change 100644 => 100755 modules/openapi-generator/src/main/resources/scala-finch/sbt create mode 100644 samples/client/petstore/spring-cloud-async/.openapi-generator-ignore create mode 100644 samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION create mode 100644 samples/client/petstore/spring-cloud-async/README.md create mode 100644 samples/client/petstore/spring-cloud-async/pom.xml create mode 100644 samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java create mode 100644 samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApiClient.java create mode 100644 samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java create mode 100644 samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApiClient.java create mode 100644 samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java create mode 100644 samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApiClient.java create mode 100644 samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/configuration/ApiKeyRequestInterceptor.java create mode 100644 samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/configuration/ClientConfiguration.java create mode 100644 samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java create mode 100644 samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java create mode 100644 samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java create mode 100644 samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java create mode 100644 samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java create mode 100644 samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java diff --git a/bin/spring-all-petstore.sh b/bin/spring-all-petstore.sh index e3060626f7b..3f3536cf1ab 100755 --- a/bin/spring-all-petstore.sh +++ b/bin/spring-all-petstore.sh @@ -2,6 +2,7 @@ # Generate clients: ./bin/spring-cloud-feign-petstore.sh +./bin/spring-cloud-feign-async-petstore.sh ./bin/spring-stubs.sh # Generate spring-mvc servers: diff --git a/bin/spring-cloud-feign-async-petstore.sh b/bin/spring-cloud-feign-async-petstore.sh new file mode 100755 index 00000000000..ec2df408974 --- /dev/null +++ b/bin/spring-cloud-feign-async-petstore.sh @@ -0,0 +1,35 @@ +#!/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 -B 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/JavaSpring/libraries/spring-cloud -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g spring -c bin/spring-cloud-feign-petstore.json -o samples/client/petstore/spring-cloud-async --additional-properties hideGenerationTimestamp=true,java8=true,async=true $@" + +echo "Removing files and folders under samples/client/petstore/spring-cloud-async/src/main" +rm -rf samples/client/petstore/spring-cloud-async/src/main +find samples/client/petstore/spring-cloud-async -maxdepth 1 -type f ! -name "README.md" -exec rm {} + +java $JAVA_OPTS -jar $executable $ags diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index 4b8373004f7..cff6cc3ad75 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -132,7 +132,7 @@ public class SpringCodegen extends AbstractJavaCodegen cliOptions.add(CliOption.newBoolean(IMPLICIT_HEADERS, "Skip header parameters in the generated API methods using @ApiImplicitParams annotation.", implicitHeaders)); cliOptions.add(CliOption.newBoolean(OPENAPI_DOCKET_CONFIG, "Generate Spring OpenAPI Docket configuration class.", openapiDocketConfig)); cliOptions.add(CliOption.newBoolean(API_FIRST, "Generate the API from the OAI spec at server compile time (API first approach)", apiFirst)); - cliOptions.add(CliOption.newBoolean(USE_OPTIONAL,"Use Optional container for optional parameters", useOptional)); + cliOptions.add(CliOption.newBoolean(USE_OPTIONAL, "Use Optional container for optional parameters", useOptional)); cliOptions.add(CliOption.newBoolean(HATEOAS, "Use Spring HATEOAS library to allow adding HATEOAS links", hateoas)); cliOptions.add(CliOption.newBoolean(RETURN_SUCCESS_CODE, "Generated server returns 2xx code", returnSuccessCode)); cliOptions.add(CliOption.newBoolean(UNHANDLED_EXCEPTION_HANDLING, "Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).", unhandledException)); @@ -172,7 +172,7 @@ public class SpringCodegen extends AbstractJavaCodegen @Override public void processOpts() { - List> configOptions = additionalProperties.entrySet().stream() + List> configOptions = additionalProperties.entrySet().stream() .filter(e -> !Arrays.asList(API_FIRST, "hideGenerationTimestamp").contains(e.getKey())) .filter(e -> cliOptions.stream().map(CliOption::getOpt).anyMatch(opt -> opt.equals(e.getKey()))) .map(e -> Pair.of(e.getKey(), e.getValue().toString())) @@ -220,7 +220,7 @@ public class SpringCodegen extends AbstractJavaCodegen } else { additionalProperties.put(BASE_PACKAGE, basePackage); } - + if (additionalProperties.containsKey(VIRTUAL_SERVICE)) { this.setVirtualService(Boolean.valueOf(additionalProperties.get(VIRTUAL_SERVICE).toString())); } @@ -248,7 +248,7 @@ public class SpringCodegen extends AbstractJavaCodegen } if (additionalProperties.containsKey(REACTIVE)) { - if (!library.equals(SPRING_BOOT)) { + if (!SPRING_BOOT.equals(library)) { throw new IllegalArgumentException("Currently, reactive option is only supported with Spring-boot"); } this.setReactive(Boolean.valueOf(additionalProperties.get(REACTIVE).toString())); @@ -287,7 +287,7 @@ public class SpringCodegen extends AbstractJavaCodegen if (additionalProperties.containsKey(API_FIRST)) { this.setApiFirst(Boolean.valueOf(additionalProperties.get(API_FIRST).toString())); } - + if (additionalProperties.containsKey(HATEOAS)) { this.setHateoas(Boolean.valueOf(additionalProperties.get(HATEOAS).toString())); } @@ -398,12 +398,15 @@ public class SpringCodegen extends AbstractJavaCodegen apiTemplateFiles.put("apiDelegate.mustache", "Delegate.java"); } + if (this.java8) { additionalProperties.put("javaVersion", "1.8"); - additionalProperties.put("jdk8-default-interface", !this.skipDefaultInterface); - if (!SPRING_CLOUD_LIBRARY.equals(library)) { - additionalProperties.put("jdk8", true); + if (SPRING_CLOUD_LIBRARY.equals(library)) { + additionalProperties.put("jdk8-default-interface", false); + } else { + additionalProperties.put("jdk8-default-interface", !this.skipDefaultInterface); } + additionalProperties.put("jdk8", true); if (this.async) { additionalProperties.put(RESPONSE_WRAPPER, "CompletableFuture"); } @@ -414,7 +417,8 @@ public class SpringCodegen extends AbstractJavaCodegen additionalProperties.put(RESPONSE_WRAPPER, "Callable"); } - if(!this.apiFirst && !this.reactive) { + + if (!this.apiFirst && !this.reactive) { additionalProperties.put("useSpringfox", true); } @@ -458,7 +462,7 @@ public class SpringCodegen extends AbstractJavaCodegen @Override public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation co, Map> operations) { - if((library.equals(SPRING_BOOT) || library.equals(SPRING_MVC_LIBRARY)) && !useTags) { + if ((library.equals(SPRING_BOOT) || library.equals(SPRING_MVC_LIBRARY)) && !useTags) { String basePath = resourcePath; if (basePath.startsWith("/")) { basePath = basePath.substring(1); @@ -490,7 +494,7 @@ public class SpringCodegen extends AbstractJavaCodegen } */ - if(!additionalProperties.containsKey(TITLE)) { + if (!additionalProperties.containsKey(TITLE)) { // From the title, compute a reasonable name for the package and the API String title = openAPI.getInfo().getTitle(); @@ -506,7 +510,7 @@ public class SpringCodegen extends AbstractJavaCodegen additionalProperties.put(TITLE, this.title); } - if(!additionalProperties.containsKey(SERVER_PORT)) { + if (!additionalProperties.containsKey(SERVER_PORT)) { URL url = URLPathUtils.getServerURL(openAPI); this.additionalProperties.put(SERVER_PORT, URLPathUtils.getPort(url, 8080)); } @@ -578,7 +582,7 @@ public class SpringCodegen extends AbstractJavaCodegen } }); - if(implicitHeaders){ + if (implicitHeaders) { removeHeadersFromAllParams(operation.allParams); } } @@ -589,12 +593,12 @@ public class SpringCodegen extends AbstractJavaCodegen private interface DataTypeAssigner { void setReturnType(String returnType); + void setReturnContainer(String returnContainer); } /** - * - * @param returnType The return type that needs to be converted + * @param returnType The return type that needs to be converted * @param dataTypeAssigner An object that will assign the data to the respective fields in the model. */ private void doDataTypeAssignment(String returnType, DataTypeAssigner dataTypeAssigner) { @@ -625,29 +629,30 @@ public class SpringCodegen extends AbstractJavaCodegen /** * This method removes header parameters from the list of parameters and also * corrects last allParams hasMore state. + * * @param allParams list of all parameters */ private void removeHeadersFromAllParams(List allParams) { - if(allParams.isEmpty()){ + if (allParams.isEmpty()) { return; } final ArrayList copy = new ArrayList<>(allParams); allParams.clear(); - for(CodegenParameter p : copy){ - if(!p.isHeaderParam){ + for (CodegenParameter p : copy) { + if (!p.isHeaderParam) { allParams.add(p); } } if (!allParams.isEmpty()) { - allParams.get(allParams.size()-1).hasMore =false; + allParams.get(allParams.size() - 1).hasMore = false; } } @Override public Map postProcessSupportingFileData(Map objs) { generateYAMLSpecFile(objs); - if(library.equals(SPRING_CLOUD_LIBRARY)) { + if (library.equals(SPRING_CLOUD_LIBRARY)) { List authMethods = (List) objs.get("authMethods"); if (authMethods != null) { for (CodegenSecurity authMethod : authMethods) { @@ -717,9 +722,13 @@ public class SpringCodegen extends AbstractJavaCodegen return this.basePackage; } - public void setInterfaceOnly(boolean interfaceOnly) { this.interfaceOnly = interfaceOnly; } + public void setInterfaceOnly(boolean interfaceOnly) { + this.interfaceOnly = interfaceOnly; + } - public void setDelegatePattern(boolean delegatePattern) { this.delegatePattern = delegatePattern; } + public void setDelegatePattern(boolean delegatePattern) { + this.delegatePattern = delegatePattern; + } public void setSingleContentTypes(boolean singleContentTypes) { this.singleContentTypes = singleContentTypes; @@ -729,13 +738,21 @@ public class SpringCodegen extends AbstractJavaCodegen public void setJava8(boolean java8) { this.java8 = java8; } - public void setVirtualService(boolean virtualService) { this.virtualService = virtualService; } + public void setVirtualService(boolean virtualService) { + this.virtualService = virtualService; + } - public void setAsync(boolean async) { this.async = async; } + public void setAsync(boolean async) { + this.async = async; + } - public void setReactive(boolean reactive) { this.reactive = reactive; } + public void setReactive(boolean reactive) { + this.reactive = reactive; + } - public void setResponseWrapper(String responseWrapper) { this.responseWrapper = responseWrapper; } + public void setResponseWrapper(String responseWrapper) { + this.responseWrapper = responseWrapper; + } public void setUseTags(boolean useTags) { this.useTags = useTags; @@ -752,7 +769,7 @@ public class SpringCodegen extends AbstractJavaCodegen public void setApiFirst(boolean apiFirst) { this.apiFirst = apiFirst; } - + public void setHateoas(boolean hateoas) { this.hateoas = hateoas; } @@ -793,7 +810,7 @@ public class SpringCodegen extends AbstractJavaCodegen objs = super.postProcessModelsEnum(objs); //Add imports for Jackson - List> imports = (List>)objs.get("imports"); + List> imports = (List>) objs.get("imports"); List models = (List) objs.get("models"); for (Object _mo : models) { Map mo = (Map) _mo; diff --git a/modules/openapi-generator/src/main/resources/scala-finch/sbt b/modules/openapi-generator/src/main/resources/scala-finch/sbt old mode 100644 new mode 100755 diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index 4fa35f9675a..578b485e8d1 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -41,6 +41,9 @@ import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertNotNull; +import static org.openapitools.codegen.languages.SpringCodegen.RESPONSE_WRAPPER; +import static org.testng.Assert.assertTrue; + public class SpringCodegenTest { @Test @@ -103,10 +106,10 @@ public class SpringCodegenTest { codegen.additionalProperties().put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true"); codegen.additionalProperties().put(CodegenConstants.MODEL_PACKAGE, "xyz.yyyyy.mmmmm.model"); codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "xyz.yyyyy.aaaaa.api"); - codegen.additionalProperties().put(CodegenConstants.INVOKER_PACKAGE,"xyz.yyyyy.iiii.invoker"); - codegen.additionalProperties().put(SpringCodegen.BASE_PACKAGE,"xyz.yyyyy.bbbb.base"); - codegen.additionalProperties().put(SpringCodegen.CONFIG_PACKAGE,"xyz.yyyyy.cccc.config"); - codegen.additionalProperties().put(SpringCodegen.SERVER_PORT,"8088"); + codegen.additionalProperties().put(CodegenConstants.INVOKER_PACKAGE, "xyz.yyyyy.iiii.invoker"); + codegen.additionalProperties().put(SpringCodegen.BASE_PACKAGE, "xyz.yyyyy.bbbb.base"); + codegen.additionalProperties().put(SpringCodegen.CONFIG_PACKAGE, "xyz.yyyyy.cccc.config"); + codegen.additionalProperties().put(SpringCodegen.SERVER_PORT, "8088"); codegen.processOpts(); OpenAPI openAPI = new OpenAPI(); @@ -179,4 +182,46 @@ public class SpringCodegenTest { .collect(groupingBy(CliOption::getOpt)) .forEach((k,v) -> assertEquals(v.size(), 1, k + " is described multiple times")); } + + @Test + public void springcloudWithJava8DisabeJdk8() { + final SpringCodegen codegen = new SpringCodegen(); + codegen.additionalProperties().put(SpringCodegen.JAVA_8, true); + codegen.additionalProperties().put(CodegenConstants.LIBRARY, "spring-cloud"); + codegen.processOpts(); + + Assert.assertEquals(codegen.additionalProperties().get("jdk8-default-interface"), false); + } + + @Test + public void springcloudWithAsyncHasResponseWrapperCallable() { + final SpringCodegen codegen = new SpringCodegen(); + codegen.additionalProperties().put(SpringCodegen.JAVA_8, false); + codegen.additionalProperties().put(SpringCodegen.ASYNC, true); + codegen.additionalProperties().put(CodegenConstants.LIBRARY, "spring-cloud"); + codegen.processOpts(); + + Assert.assertNull(codegen.additionalProperties().get("jdk8-default-interface")); + Assert.assertEquals(codegen.additionalProperties().get(RESPONSE_WRAPPER), "Callable"); + } + + @Test + public void springcloudWithAsyncAndJava8HasResponseWrapperCompletableFuture() { + final SpringCodegen codegen = new SpringCodegen(); + codegen.additionalProperties().put(SpringCodegen.JAVA_8, true); + codegen.additionalProperties().put(SpringCodegen.ASYNC, true); + codegen.additionalProperties().put(CodegenConstants.LIBRARY, "spring-cloud"); + codegen.processOpts(); + + Assert.assertEquals(codegen.additionalProperties().get("jdk8-default-interface"), false); + Assert.assertEquals(codegen.additionalProperties().get(RESPONSE_WRAPPER), "CompletableFuture"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void reactiveRequiredSpringBoot() { + final SpringCodegen codegen = new SpringCodegen(); + codegen.additionalProperties().put(SpringCodegen.REACTIVE, true); + codegen.additionalProperties().put(CodegenConstants.LIBRARY, "spring-cloud"); + codegen.processOpts(); + } } diff --git a/samples/client/petstore/spring-cloud-async/.openapi-generator-ignore b/samples/client/petstore/spring-cloud-async/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/spring-cloud-async/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION b/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION new file mode 100644 index 00000000000..83a328a9227 --- /dev/null +++ b/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud-async/README.md b/samples/client/petstore/spring-cloud-async/README.md new file mode 100644 index 00000000000..f176b79c8ae --- /dev/null +++ b/samples/client/petstore/spring-cloud-async/README.md @@ -0,0 +1,53 @@ +# petstore-spring-cloud + +## Requirements + +Building the API client library requires [Maven](https://maven.apache.org/) to be installed. + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn deploy +``` + +Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + petstore-spring-cloud + 1.0.0 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy +compile "org.openapitools:petstore-spring-cloud:1.0.0" +``` + +### Others + +At first generate the JAR by executing: + +mvn package + +Then manually install the following JARs: + +* target/petstore-spring-cloud-1.0.0.jar +* target/lib/*.jar diff --git a/samples/client/petstore/spring-cloud-async/pom.xml b/samples/client/petstore/spring-cloud-async/pom.xml new file mode 100644 index 00000000000..1ee79c2f74d --- /dev/null +++ b/samples/client/petstore/spring-cloud-async/pom.xml @@ -0,0 +1,64 @@ + + 4.0.0 + org.openapitools + petstore-spring-cloud + jar + petstore-spring-cloud + 1.0.0 + + 1.8 + ${java.version} + ${java.version} + 1.5.18 + + + org.springframework.boot + spring-boot-starter-parent + 2.0.5.RELEASE + + + src/main/java + + + + + + org.springframework.cloud + spring-cloud-starter-parent + Finchley.SR1 + pom + import + + + + + + + io.swagger + swagger-annotations + ${swagger-core-version} + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + org.springframework.cloud + spring-cloud-starter-oauth2 + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + org.openapitools + jackson-databind-nullable + 0.1.0 + + + org.springframework.boot + spring-boot-starter-test + test + + + diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java new file mode 100644 index 00000000000..ac5ee6b513c --- /dev/null +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java @@ -0,0 +1,151 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import org.openapitools.model.ModelApiResponse; +import org.openapitools.model.Pet; +import org.springframework.core.io.Resource; +import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +@Validated +@Api(value = "Pet", description = "the Pet API") +public interface PetApi { + + @ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) + @RequestMapping(value = "/pet", + consumes = "application/json", + method = RequestMethod.POST) + CompletableFuture> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); + + + @ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid pet value") }) + @RequestMapping(value = "/pet/{petId}", + method = RequestMethod.DELETE) + CompletableFuture> deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); + + + @ApiOperation(value = "Finds Pets by status", nickname = "findPetsByStatus", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value") }) + @RequestMapping(value = "/pet/findByStatus", + produces = "application/json", + method = RequestMethod.GET) + CompletableFuture>> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status); + + + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid tag value") }) + @RequestMapping(value = "/pet/findByTags", + produces = "application/json", + method = RequestMethod.GET) + CompletableFuture>> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags); + + + @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { + @Authorization(value = "api_key") + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Pet.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found") }) + @RequestMapping(value = "/pet/{petId}", + produces = "application/json", + method = RequestMethod.GET) + CompletableFuture> getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathVariable("petId") Long petId); + + + @ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception") }) + @RequestMapping(value = "/pet", + consumes = "application/json", + method = RequestMethod.PUT) + CompletableFuture> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); + + + @ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 405, message = "Invalid input") }) + @RequestMapping(value = "/pet/{petId}", + consumes = "application/x-www-form-urlencoded", + method = RequestMethod.POST) + CompletableFuture> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet" ) @RequestParam(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestParam(value="status", required=false) String status); + + + @ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + }, tags={ "pet", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", + produces = "application/json", + consumes = "multipart/form-data", + method = RequestMethod.POST) + CompletableFuture> uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server" ) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @RequestParam("file") MultipartFile file); + +} diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApiClient.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApiClient.java new file mode 100644 index 00000000000..ac33f943323 --- /dev/null +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApiClient.java @@ -0,0 +1,8 @@ +package org.openapitools.api; + +import org.springframework.cloud.openfeign.FeignClient; +import org.openapitools.configuration.ClientConfiguration; + +@FeignClient(name="${openAPIPetstore.name:openAPIPetstore}", url="${openAPIPetstore.url:http://petstore.swagger.io/v2}", configuration = ClientConfiguration.class) +public interface PetApiClient extends PetApi { +} \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java new file mode 100644 index 00000000000..311fb8b6386 --- /dev/null +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java @@ -0,0 +1,76 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import java.util.Map; +import org.openapitools.model.Order; +import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +@Validated +@Api(value = "Store", description = "the Store API") +public interface StoreApi { + + @ApiOperation(value = "Delete purchase order by ID", nickname = "deleteOrder", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) + @RequestMapping(value = "/store/order/{orderId}", + method = RequestMethod.DELETE) + CompletableFuture> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("orderId") String orderId); + + + @ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { + @Authorization(value = "api_key") + }, tags={ "store", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) + @RequestMapping(value = "/store/inventory", + produces = "application/json", + method = RequestMethod.GET) + CompletableFuture>> getInventory(); + + + @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") }) + @RequestMapping(value = "/store/order/{orderId}", + produces = "application/json", + method = RequestMethod.GET) + CompletableFuture> getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("orderId") Long orderId); + + + @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Order.class), + @ApiResponse(code = 400, message = "Invalid Order") }) + @RequestMapping(value = "/store/order", + produces = "application/json", + method = RequestMethod.POST) + CompletableFuture> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body); + +} diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApiClient.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApiClient.java new file mode 100644 index 00000000000..0943d581356 --- /dev/null +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApiClient.java @@ -0,0 +1,8 @@ +package org.openapitools.api; + +import org.springframework.cloud.openfeign.FeignClient; +import org.openapitools.configuration.ClientConfiguration; + +@FeignClient(name="${openAPIPetstore.name:openAPIPetstore}", url="${openAPIPetstore.url:http://petstore.swagger.io/v2}", configuration = ClientConfiguration.class) +public interface StoreApiClient extends StoreApi { +} \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java new file mode 100644 index 00000000000..50ae11724df --- /dev/null +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java @@ -0,0 +1,106 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import java.util.List; +import org.openapitools.model.User; +import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +@Validated +@Api(value = "User", description = "the User API") +public interface UserApi { + + @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) + @RequestMapping(value = "/user", + method = RequestMethod.POST) + CompletableFuture> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body); + + + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) + @RequestMapping(value = "/user/createWithArray", + method = RequestMethod.POST) + CompletableFuture> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); + + + @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) + @RequestMapping(value = "/user/createWithList", + method = RequestMethod.POST) + CompletableFuture> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); + + + @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) + @RequestMapping(value = "/user/{username}", + method = RequestMethod.DELETE) + CompletableFuture> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username); + + + @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") }) + @RequestMapping(value = "/user/{username}", + produces = "application/json", + method = RequestMethod.GET) + CompletableFuture> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathVariable("username") String username); + + + @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") }) + @RequestMapping(value = "/user/login", + produces = "application/json", + method = RequestMethod.GET) + CompletableFuture> loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password); + + + @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation") }) + @RequestMapping(value = "/user/logout", + method = RequestMethod.GET) + CompletableFuture> logoutUser(); + + + @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") }) + @RequestMapping(value = "/user/{username}", + method = RequestMethod.PUT) + CompletableFuture> updateUser(@ApiParam(value = "name that need to be deleted",required=true) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody User body); + +} diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApiClient.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApiClient.java new file mode 100644 index 00000000000..1933bd82d3a --- /dev/null +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApiClient.java @@ -0,0 +1,8 @@ +package org.openapitools.api; + +import org.springframework.cloud.openfeign.FeignClient; +import org.openapitools.configuration.ClientConfiguration; + +@FeignClient(name="${openAPIPetstore.name:openAPIPetstore}", url="${openAPIPetstore.url:http://petstore.swagger.io/v2}", configuration = ClientConfiguration.class) +public interface UserApiClient extends UserApi { +} \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/configuration/ApiKeyRequestInterceptor.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/configuration/ApiKeyRequestInterceptor.java new file mode 100644 index 00000000000..199278dcb53 --- /dev/null +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/configuration/ApiKeyRequestInterceptor.java @@ -0,0 +1,31 @@ +package org.openapitools.configuration; + +import feign.RequestInterceptor; +import feign.RequestTemplate; +import feign.Util; + + +public class ApiKeyRequestInterceptor implements RequestInterceptor { + private final String location; + private final String name; + private String value; + + public ApiKeyRequestInterceptor(String location, String name, String value) { + Util.checkNotNull(location, "location", new Object[0]); + Util.checkNotNull(name, "name", new Object[0]); + Util.checkNotNull(value, "value", new Object[0]); + this.location = location; + this.name = name; + this.value = value; + } + + @Override + public void apply(RequestTemplate requestTemplate) { + if(location.equals("header")) { + requestTemplate.header(name, value); + } else if(location.equals("query")) { + requestTemplate.query(name, value); + } + } + +} diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/configuration/ClientConfiguration.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/configuration/ClientConfiguration.java new file mode 100644 index 00000000000..abf7e746252 --- /dev/null +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/configuration/ClientConfiguration.java @@ -0,0 +1,49 @@ +package org.openapitools.configuration; + +import feign.Logger; +import feign.auth.BasicAuthRequestInterceptor; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.cloud.security.oauth2.client.feign.OAuth2FeignRequestInterceptor; +import org.springframework.security.oauth2.client.DefaultOAuth2ClientContext; +import org.springframework.security.oauth2.client.resource.BaseOAuth2ProtectedResourceDetails; +import org.springframework.security.oauth2.client.token.grant.client.ClientCredentialsResourceDetails; +import org.springframework.security.oauth2.client.token.grant.code.AuthorizationCodeResourceDetails; +import org.springframework.security.oauth2.client.token.grant.implicit.ImplicitResourceDetails; +import org.springframework.security.oauth2.client.token.grant.password.ResourceOwnerPasswordResourceDetails; +import org.springframework.security.oauth2.common.exceptions.InvalidGrantException; +import org.springframework.security.oauth2.common.exceptions.OAuth2Exception; + +@Configuration +@EnableConfigurationProperties +public class ClientConfiguration { + + @Value("${openAPIPetstore.security.apiKey.key:}") + private String apiKeyKey; + + @Bean + @ConditionalOnProperty(name = "openAPIPetstore.security.apiKey.key") + public ApiKeyRequestInterceptor apiKeyRequestInterceptor() { + return new ApiKeyRequestInterceptor("header", "api_key", this.apiKeyKey); + } + + @Bean + @ConditionalOnProperty("openAPIPetstore.security.petstoreAuth.client-id") + public OAuth2FeignRequestInterceptor petstoreAuthRequestInterceptor() { + return new OAuth2FeignRequestInterceptor(new DefaultOAuth2ClientContext(), petstoreAuthResourceDetails()); + } + + @Bean + @ConditionalOnProperty("openAPIPetstore.security.petstoreAuth.client-id") + @ConfigurationProperties("openAPIPetstore.security.petstoreAuth") + public ImplicitResourceDetails petstoreAuthResourceDetails() { + ImplicitResourceDetails details = new ImplicitResourceDetails(); + details.setUserAuthorizationUri("http://petstore.swagger.io/api/oauth/dialog"); + return details; + } + +} diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java new file mode 100644 index 00000000000..b1ad95d3952 --- /dev/null +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java @@ -0,0 +1,105 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * A category for a pet + */ +@ApiModel(description = "A category for a pet") + +public class Category { + @JsonProperty("id") + private Long id; + + @JsonProperty("name") + private String name; + + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @ApiModelProperty(value = "") + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Category name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @ApiModelProperty(value = "") + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(this.id, category.id) && + Objects.equals(this.name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java new file mode 100644 index 00000000000..cc9dc2341c6 --- /dev/null +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -0,0 +1,130 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * Describes the result of uploading an image resource + */ +@ApiModel(description = "Describes the result of uploading an image resource") + +public class ModelApiResponse { + @JsonProperty("code") + private Integer code; + + @JsonProperty("type") + private String type; + + @JsonProperty("message") + private String message; + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + */ + @ApiModelProperty(value = "") + + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @ApiModelProperty(value = "") + + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @ApiModelProperty(value = "") + + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(this.code, _apiResponse.code) && + Objects.equals(this.type, _apiResponse.type) && + Objects.equals(this.message, _apiResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java new file mode 100644 index 00000000000..0878b2dfe7b --- /dev/null +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java @@ -0,0 +1,241 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import org.openapitools.jackson.nullable.JsonNullable; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * An order for a pets from the pet store + */ +@ApiModel(description = "An order for a pets from the pet store") + +public class Order { + @JsonProperty("id") + private Long id; + + @JsonProperty("petId") + private Long petId; + + @JsonProperty("quantity") + private Integer quantity; + + @JsonProperty("shipDate") + private OffsetDateTime shipDate; + + /** + * Order Status + */ + public enum StatusEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("status") + private StatusEnum status; + + @JsonProperty("complete") + private Boolean complete = false; + + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @ApiModelProperty(value = "") + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get petId + * @return petId + */ + @ApiModelProperty(value = "") + + + public Long getPetId() { + return petId; + } + + public void setPetId(Long petId) { + this.petId = petId; + } + + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * @return quantity + */ + @ApiModelProperty(value = "") + + + public Integer getQuantity() { + return quantity; + } + + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Get shipDate + * @return shipDate + */ + @ApiModelProperty(value = "") + + @Valid + + public OffsetDateTime getShipDate() { + return shipDate; + } + + public void setShipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + } + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Order Status + * @return status + */ + @ApiModelProperty(value = "Order Status") + + + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + /** + * Get complete + * @return complete + */ + @ApiModelProperty(value = "") + + + public Boolean getComplete() { + return complete; + } + + public void setComplete(Boolean complete) { + this.complete = complete; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(this.id, order.id) && + Objects.equals(this.petId, order.petId) && + Objects.equals(this.quantity, order.quantity) && + Objects.equals(this.shipDate, order.shipDate) && + Objects.equals(this.status, order.status) && + Objects.equals(this.complete, order.complete); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java new file mode 100644 index 00000000000..20e109b15ca --- /dev/null +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java @@ -0,0 +1,262 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.model.Category; +import org.openapitools.model.Tag; +import org.openapitools.jackson.nullable.JsonNullable; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * A pet for sale in the pet store + */ +@ApiModel(description = "A pet for sale in the pet store") + +public class Pet { + @JsonProperty("id") + private Long id; + + @JsonProperty("category") + private Category category = null; + + @JsonProperty("name") + private String name; + + @JsonProperty("photoUrls") + @Valid + private List photoUrls = new ArrayList<>(); + + @JsonProperty("tags") + @Valid + private List tags = null; + + /** + * pet status in the store + */ + public enum StatusEnum { + AVAILABLE("available"), + + PENDING("pending"), + + SOLD("sold"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("status") + private StatusEnum status; + + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @ApiModelProperty(value = "") + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + */ + @ApiModelProperty(value = "") + + @Valid + + public Category getCategory() { + return category; + } + + public void setCategory(Category category) { + this.category = category; + } + + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @ApiModelProperty(example = "doggie", required = true, value = "") + @NotNull + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get photoUrls + * @return photoUrls + */ + @ApiModelProperty(required = true, value = "") + @NotNull + + + public List getPhotoUrls() { + return photoUrls; + } + + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * @return tags + */ + @ApiModelProperty(value = "") + + @Valid + + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * pet status in the store + * @return status + */ + @ApiModelProperty(value = "pet status in the store") + + + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(this.id, pet.id) && + Objects.equals(this.category, pet.category) && + Objects.equals(this.name, pet.name) && + Objects.equals(this.photoUrls, pet.photoUrls) && + Objects.equals(this.tags, pet.tags) && + Objects.equals(this.status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java new file mode 100644 index 00000000000..8eb2e846891 --- /dev/null +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java @@ -0,0 +1,105 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * A tag for a pet + */ +@ApiModel(description = "A tag for a pet") + +public class Tag { + @JsonProperty("id") + private Long id; + + @JsonProperty("name") + private String name; + + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @ApiModelProperty(value = "") + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Tag name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @ApiModelProperty(value = "") + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(this.id, tag.id) && + Objects.equals(this.name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java new file mode 100644 index 00000000000..95d92cd2ecb --- /dev/null +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java @@ -0,0 +1,255 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * A User who is purchasing from the pet store + */ +@ApiModel(description = "A User who is purchasing from the pet store") + +public class User { + @JsonProperty("id") + private Long id; + + @JsonProperty("username") + private String username; + + @JsonProperty("firstName") + private String firstName; + + @JsonProperty("lastName") + private String lastName; + + @JsonProperty("email") + private String email; + + @JsonProperty("password") + private String password; + + @JsonProperty("phone") + private String phone; + + @JsonProperty("userStatus") + private Integer userStatus; + + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @ApiModelProperty(value = "") + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + */ + @ApiModelProperty(value = "") + + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + */ + @ApiModelProperty(value = "") + + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + */ + @ApiModelProperty(value = "") + + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + */ + @ApiModelProperty(value = "") + + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + @ApiModelProperty(value = "") + + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * Get phone + * @return phone + */ + @ApiModelProperty(value = "") + + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + /** + * User Status + * @return userStatus + */ + @ApiModelProperty(value = "User Status") + + + public Integer getUserStatus() { + return userStatus; + } + + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(this.id, user.id) && + Objects.equals(this.username, user.username) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.email, user.email) && + Objects.equals(this.password, user.password) && + Objects.equals(this.phone, user.phone) && + Objects.equals(this.userStatus, user.userStatus); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + From 199447a3986dbf63ee8996531db6e9d46d7fedb1 Mon Sep 17 00:00:00 2001 From: Richard Whitehouse Date: Wed, 31 Jul 2019 12:50:51 +0100 Subject: [PATCH 20/75] Add richardwhiuk to the Rust Technical Committee (#3506) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 065ec69d340..599b0d4f234 100644 --- a/README.md +++ b/README.md @@ -810,7 +810,7 @@ If you want to join the committee, please kindly apply by sending an email to te | Python | @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11) @tomplus (2018/10) @Jyhess (2019/01) | | R | @Ramanth (2019/07) @saigiridhar21 (2019/07) | | Ruby | @cliffano (2017/07) @zlx (2017/09) @autopp (2019/02) | -| Rust | @frol (2017/07) @farcaller (2017/08) @bjgill (2017/12) | +| Rust | @frol (2017/07) @farcaller (2017/08) @bjgill (2017/12) @richardwhiuk (2019/07) | | Scala | @clasnake (2017/07), @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert), @shijinkui (2018/01), @ramzimaalej (2018/03) | | Swift | @jgavris (2017/07) @ehyche (2017/08) @Edubits (2017/09) @jaz-ah (2017/09) @d-date (2018/03) | | TypeScript | @TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) @macjohnny (2018/01) @nicokoenig (2018/09) @topce (2018/10) @akehir (2019/07) | From 88af8964fdcaf06f0816751d39388191ed8a219c Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 31 Jul 2019 06:18:30 -0700 Subject: [PATCH 21/75] [python-experimental] automatically use values for enums of length1 (#3118) * Update python client java generator * Updates python generator mustache files * Python sample regenerated * Switches from getfullargspec to getargspec for python2 compatibility * Uses getattr to get model class init method to correctly see its arguments, linting fixes to pass python tests * Updates comment in python centerator to restart CI tests * Adds bin/windows/python-experimental-petstore.bat * CHanges spec update to apply to the python-experimental spec * Moves new python templates to python-experimental * Moves generator python java code to python-experimental * Reverts python generator mustache files * Regenerates python, v3 python, python-experimental samples * Test moved to python-experimental, unused python files removed --- bin/windows/python-experimental-petstore.bat | 10 + .../PythonClientExperimentalCodegen.java | 119 ++ .../python/python-experimental/api.mustache | 294 +++++ .../python-experimental/api_client.mustache | 665 ++++++++++ .../python-experimental/api_doc.mustache | 78 ++ .../api_doc_example.mustache | 58 + .../python/python-experimental/model.mustache | 241 ++++ .../python-experimental/model_doc.mustache | 13 + ...ith-fake-endpoints-models-for-testing.yaml | 83 +- .../petstore/python-experimental/README.md | 5 +- .../docs/AnotherFakeApi.md | 4 +- .../python-experimental/docs/FakeApi.md | 183 ++- .../docs/FakeClassnameTags123Api.md | 6 +- .../python-experimental/docs/PetApi.md | 76 +- .../python-experimental/docs/StoreApi.md | 16 +- .../docs/TypeHolderDefault.md | 6 +- .../docs/TypeHolderExample.md | 6 +- .../python-experimental/docs/UserApi.md | 34 +- .../openapi_client/api_client.py | 658 ++++++++++ .../petstore_api/api/another_fake_api.py | 64 +- .../petstore_api/api/fake_api.py | 1144 +++++++++++------ .../api/fake_classname_tags_123_api.py | 64 +- .../petstore_api/api/pet_api.py | 594 +++++---- .../petstore_api/api/store_api.py | 248 ++-- .../petstore_api/api/user_api.py | 498 +++---- .../models/additional_properties_any_type.py | 21 +- .../models/additional_properties_array.py | 21 +- .../models/additional_properties_boolean.py | 21 +- .../models/additional_properties_class.py | 141 +- .../models/additional_properties_integer.py | 21 +- .../models/additional_properties_number.py | 21 +- .../models/additional_properties_object.py | 21 +- .../models/additional_properties_string.py | 21 +- .../petstore_api/models/animal.py | 33 +- .../petstore_api/models/api_response.py | 45 +- .../models/array_of_array_of_number_only.py | 21 +- .../models/array_of_number_only.py | 21 +- .../petstore_api/models/array_test.py | 45 +- .../petstore_api/models/capitalization.py | 81 +- .../petstore_api/models/cat.py | 29 +- .../petstore_api/models/cat_all_of.py | 21 +- .../petstore_api/models/category.py | 33 +- .../petstore_api/models/class_model.py | 21 +- .../petstore_api/models/client.py | 21 +- .../petstore_api/models/dog.py | 29 +- .../petstore_api/models/dog_all_of.py | 21 +- .../petstore_api/models/enum_arrays.py | 33 +- .../petstore_api/models/enum_class.py | 7 +- .../petstore_api/models/enum_test.py | 71 +- .../petstore_api/models/file.py | 21 +- .../models/file_schema_test_class.py | 33 +- .../petstore_api/models/format_test.py | 165 ++- .../petstore_api/models/has_only_read_only.py | 33 +- .../petstore_api/models/list.py | 21 +- .../petstore_api/models/map_test.py | 57 +- ...perties_and_additional_properties_class.py | 45 +- .../petstore_api/models/model200_response.py | 33 +- .../petstore_api/models/model_return.py | 21 +- .../petstore_api/models/name.py | 57 +- .../petstore_api/models/number_only.py | 21 +- .../petstore_api/models/order.py | 83 +- .../petstore_api/models/outer_composite.py | 45 +- .../petstore_api/models/outer_enum.py | 7 +- .../petstore_api/models/pet.py | 83 +- .../petstore_api/models/read_only_first.py | 33 +- .../petstore_api/models/special_model_name.py | 21 +- .../petstore_api/models/tag.py | 33 +- .../models/type_holder_default.py | 121 +- .../models/type_holder_example.py | 79 +- .../petstore_api/models/user.py | 105 +- .../petstore_api/models/xml_item.py | 357 +++-- .../test/test_type_holder_default.py | 13 +- 72 files changed, 5602 insertions(+), 1872 deletions(-) create mode 100644 bin/windows/python-experimental-petstore.bat create mode 100644 modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache create mode 100644 modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache create mode 100644 modules/openapi-generator/src/main/resources/python/python-experimental/api_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/python/python-experimental/api_doc_example.mustache create mode 100644 modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache create mode 100644 modules/openapi-generator/src/main/resources/python/python-experimental/model_doc.mustache create mode 100644 samples/client/petstore/python-experimental/openapi_client/api_client.py diff --git a/bin/windows/python-experimental-petstore.bat b/bin/windows/python-experimental-petstore.bat new file mode 100644 index 00000000000..50df98535f4 --- /dev/null +++ b/bin/windows/python-experimental-petstore.bat @@ -0,0 +1,10 @@ +set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g python-experimental -o samples\client\petstore\python-experimental -DpackageName=petstore_api + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java index ba468d47ded..ffbad6f5d23 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java @@ -16,14 +16,29 @@ package org.openapitools.codegen.languages; +import java.text.DateFormat; +import java.text.SimpleDateFormat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import io.swagger.v3.oas.models.media.Schema; +import org.openapitools.codegen.*; +import org.openapitools.codegen.utils.ModelUtils; + +import java.util.*; +import java.util.regex.Pattern; + public class PythonClientExperimentalCodegen extends PythonClientCodegen { private static final Logger LOGGER = LoggerFactory.getLogger(PythonClientExperimentalCodegen.class); public PythonClientExperimentalCodegen() { super(); + + supportingFiles.add(new SupportingFile("python-experimental/api_client.mustache", packagePath(), "api_client.py")); + apiDocTemplateFiles.put("python-experimental/api_doc.mustache", ".md"); + apiTemplateFiles.put("python-experimental/api.mustache", ".py"); + modelDocTemplateFiles.put("python-experimental/model_doc.mustache", ".md"); + modelTemplateFiles.put("python-experimental/model.mustache", ".py"); } /** @@ -36,4 +51,108 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen { public String getName() { return "python-experimental"; } + + public String dateToString(Schema p, Date date, DateFormat dateFormatter, DateFormat dateTimeFormatter) { + // converts a date into a date or date-time python string + if (!(ModelUtils.isDateSchema(p) || ModelUtils.isDateTimeSchema(p))) { + throw new RuntimeException("passed schema must be of type Date or DateTime"); + } + if (ModelUtils.isDateSchema(p)) { + return "dateutil_parser('" + dateFormatter.format(date) + "').date()"; + } + return "dateutil_parser('" + dateTimeFormatter.format(date) + "')"; + } + + /** + * Return the default value of the property + * @param p OpenAPI property object + * @return string presentation of the default value of the property + */ + @Override + public String toDefaultValue(Schema p) { + // if a variable has no default set and only has one allowed value + // using enum of length == 1 we use that value. Server/client usage: + // python servers: should only use default values for optional params + // python clients: should only use default values for required params + Object defaultObject = null; + Boolean enumLengthOne = (p.getEnum() != null && p.getEnum().size() == 1); + if (p.getDefault() != null) { + defaultObject = p.getDefault(); + } else if (enumLengthOne) { + defaultObject = p.getEnum().get(0); + } + + // convert datetime and date enums if they exist + DateFormat iso8601Date = new SimpleDateFormat("yyyy-MM-dd", Locale.ROOT); + DateFormat iso8601DateTime = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT); + TimeZone utc = TimeZone.getTimeZone("UTC"); + iso8601Date.setTimeZone(utc); + iso8601DateTime.setTimeZone(utc); + + if (ModelUtils.isDateSchema(p) || ModelUtils.isDateTimeSchema(p)) { + List currentEnum = p.getEnum(); + List fixedEnum = new ArrayList(); + String fixedValue = null; + Date date = null; + if (currentEnum != null && !currentEnum.isEmpty()) { + for (Object enumItem : currentEnum) { + date = (Date) enumItem; + fixedValue = dateToString(p, date, iso8601Date, iso8601DateTime); + fixedEnum.add(fixedValue); + } + p.setEnum(fixedEnum); + } + + // convert the example if it exists + Object currentExample = p.getExample(); + if (currentExample != null) { + date = (Date) currentExample; + fixedValue = dateToString(p, date, iso8601Date, iso8601DateTime); + fixedEnum.add(fixedValue); + p.setExample(fixedValue); + } + + // fix defaultObject + if (defaultObject != null) { + date = (Date) defaultObject; + fixedValue = dateToString(p, date, iso8601Date, iso8601DateTime); + p.setDefault(fixedValue); + defaultObject = fixedValue; + } + } + + if (defaultObject == null) { + return null; + } + + String defaultValue = null; + if (ModelUtils.isStringSchema(p)) { + defaultValue = defaultObject.toString(); + if (ModelUtils.isDateSchema(p) || ModelUtils.isDateTimeSchema(p)) { + return defaultValue; + } + + if (!ModelUtils.isByteArraySchema(p) && !ModelUtils.isBinarySchema(p) && !ModelUtils.isFileSchema(p) && !ModelUtils.isUUIDSchema(p) && !ModelUtils.isEmailSchema(p) && !ModelUtils.isDateTimeSchema(p) && !ModelUtils.isDateSchema(p)) { + if (Pattern.compile("\r\n|\r|\n").matcher((String) defaultValue).find()) { + defaultValue = "'''" + defaultValue + "'''"; + } else { + defaultValue = "'" + defaultValue + "'"; + } + } + return defaultValue; + } else if (ModelUtils.isIntegerSchema(p) || ModelUtils.isNumberSchema(p) || ModelUtils.isBooleanSchema(p)) { + defaultValue = String.valueOf(defaultObject); + if (ModelUtils.isBooleanSchema(p)) { + if (Boolean.valueOf(defaultValue) == false) { + return "False"; + } else { + return "True"; + } + } + return defaultValue; + } else { + return defaultObject.toString(); + } + } + } diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache new file mode 100644 index 00000000000..edf76be03bb --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache @@ -0,0 +1,294 @@ +# coding: utf-8 + +{{>partial_header}} + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from {{packageName}}.api_client import ApiClient +from {{packageName}}.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +{{#operations}} +class {{classname}}(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client +{{#operation}} + + def {{operationId}}(self{{#requiredParams}}{{^defaultValue}}, {{paramName}}{{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}}, {{paramName}}={{{defaultValue}}}{{/defaultValue}}{{/requiredParams}}, **kwargs): # noqa: E501 + """{{#summary}}{{{.}}}{{/summary}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 + +{{#notes}} + {{{notes}}} # noqa: E501 +{{/notes}} + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.{{operationId}}({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}}{{paramName}}={{{defaultValue}}}, {{/defaultValue}}{{/requiredParams}}async_req=True) + >>> result = thread.get() + +{{#requiredParams}} +{{^hasMore}} + Args: +{{/hasMore}} +{{/requiredParams}} +{{#requiredParams}} +{{^defaultValue}} + {{paramName}} ({{dataType}}):{{#description}} {{description}}{{/description}}{{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}} + {{paramName}} ({{dataType}}):{{#description}} {{description}}.{{/description}} defaults to {{{defaultValue}}}, must be one of [{{{defaultValue}}}]{{/defaultValue}}{{/requiredParams}} + + Keyword Args:{{#optionalParams}} + {{paramName}} ({{dataType}}):{{#description}} {{description}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/defaultValue}}{{/optionalParams}} + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}None{{/returnType}}: + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.{{operationId}}_with_http_info({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}}{{paramName}}={{paramName}}, {{/defaultValue}}{{/requiredParams}}**kwargs) # noqa: E501 + else: + (data) = self.{{operationId}}_with_http_info({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}}{{paramName}}={{paramName}}, {{/defaultValue}}{{/requiredParams}}**kwargs) # noqa: E501 + return data + + def {{operationId}}_with_http_info(self{{#requiredParams}}{{^defaultValue}}, {{paramName}}{{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}}, {{paramName}}=None{{/defaultValue}}{{/requiredParams}}, **kwargs): # noqa: E501 + """{{#summary}}{{{.}}}{{/summary}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 + +{{#notes}} + {{{notes}}} # noqa: E501 +{{/notes}} + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.{{operationId}}_with_http_info({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}async_req=True) + >>> result = thread.get() + +{{#requiredParams}} +{{^hasMore}} + Args: +{{/hasMore}} +{{/requiredParams}} +{{#requiredParams}} +{{^defaultValue}} + {{paramName}} ({{dataType}}):{{#description}} {{description}}{{/description}}{{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}} + {{paramName}} ({{dataType}}):{{#description}} {{description}}.{{/description}} defaults to {{{defaultValue}}}, must be one of [{{{defaultValue}}}]{{/defaultValue}}{{/requiredParams}} + + Keyword Args:{{#optionalParams}} + {{paramName}} ({{dataType}}):{{#description}} {{description}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/defaultValue}}{{/optionalParams}} + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}None{{/returnType}}: + """ + + {{#servers.0}} + local_var_hosts = [{{#servers}} + '{{{url}}}'{{^-last}},{{/-last}}{{/servers}} + ] + local_var_host = local_var_hosts[0] + if kwargs.get('_host_index'): + if (int(kwargs.get('_host_index')) < 0 or + int(kwargs.get('_host_index')) >= len(local_var_hosts)): + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(local_var_host) + ) + local_var_host = local_var_hosts[int(kwargs.get('_host_index'))] + {{/servers.0}} + local_var_params = locals() + + all_params = [{{#allParams}}'{{paramName}}'{{#hasMore}}, {{/hasMore}}{{/allParams}}] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params{{#servers.0}} and key != "_host_index"{{/servers.0}}: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method {{operationId}}" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] +{{#allParams}} +{{^isNullable}} +{{#required}} + # verify the required parameter '{{paramName}}' is set + if ('{{paramName}}' not in local_var_params or + local_var_params['{{paramName}}'] is None): + raise ApiValueError("Missing the required parameter `{{paramName}}` when calling `{{operationId}}`") # noqa: E501 +{{/required}} +{{/isNullable}} +{{#-last}} +{{/-last}} +{{/allParams}} +{{#allParams}} +{{#isEnum}} +{{#isContainer}} + allowed_values = [{{#allowableValues}}{{#values}}{{#items.isString}}"{{/items.isString}}{{{this}}}{{#items.isString}}"{{/items.isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501 +{{#isListContainer}} + if ('{{{paramName}}}' in local_var_params and + not set(local_var_params['{{{paramName}}}']).issubset(set(allowed_values))): # noqa: E501 + raise ValueError( + "Invalid values for `{{{paramName}}}` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(local_var_params['{{{paramName}}}']) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) +{{/isListContainer}} +{{#isMapContainer}} + if ('{{{paramName}}}' in local_var_params and + not set(local_var_params['{{{paramName}}}'].keys()).issubset(set(allowed_values))): + raise ValueError( + "Invalid keys in `{{{paramName}}}` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(local_var_params['{{{paramName}}}'].keys()) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) +{{/isMapContainer}} +{{/isContainer}} +{{^isContainer}} + allowed_values = [{{#allowableValues}}{{#values}}{{#isString}}"{{/isString}}{{{this}}}{{#isString}}"{{/isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501 + if ('{{{paramName}}}' in local_var_params and + local_var_params['{{{paramName}}}'] not in allowed_values): + raise ValueError( + "Invalid value for `{{{paramName}}}` ({0}), must be one of {1}" # noqa: E501 + .format(local_var_params['{{{paramName}}}'], allowed_values) + ) +{{/isContainer}} +{{/isEnum}} +{{/allParams}} +{{#allParams}} +{{#hasValidation}} + {{#maxLength}} + if ('{{paramName}}' in local_var_params and + len(local_var_params['{{paramName}}']) > {{maxLength}}): + raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, length must be less than or equal to `{{maxLength}}`") # noqa: E501 + {{/maxLength}} + {{#minLength}} + if ('{{paramName}}' in local_var_params and + len(local_var_params['{{paramName}}']) < {{minLength}}): + raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, length must be greater than or equal to `{{minLength}}`") # noqa: E501 + {{/minLength}} + {{#maximum}} + if '{{paramName}}' in local_var_params and local_var_params['{{paramName}}'] >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}: # noqa: E501 + raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}`{{maximum}}`") # noqa: E501 + {{/maximum}} + {{#minimum}} + if '{{paramName}}' in local_var_params and local_var_params['{{paramName}}'] <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}: # noqa: E501 + raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}`{{minimum}}`") # noqa: E501 + {{/minimum}} + {{#pattern}} + if '{{paramName}}' in local_var_params and not re.search(r'{{{vendorExtensions.x-regex}}}', local_var_params['{{paramName}}']{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}): # noqa: E501 + raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must conform to the pattern `{{{pattern}}}`") # noqa: E501 + {{/pattern}} + {{#maxItems}} + if ('{{paramName}}' in local_var_params and + len(local_var_params['{{paramName}}']) > {{maxItems}}): + raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, number of items must be less than or equal to `{{maxItems}}`") # noqa: E501 + {{/maxItems}} + {{#minItems}} + if ('{{paramName}}' in local_var_params and + len(local_var_params['{{paramName}}']) < {{minItems}}): + raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, number of items must be greater than or equal to `{{minItems}}`") # noqa: E501 + {{/minItems}} +{{/hasValidation}} +{{/allParams}} + + collection_formats = {} + + path_params = {} +{{#pathParams}} + if '{{paramName}}' in local_var_params: + path_params['{{baseName}}'] = local_var_params['{{paramName}}']{{#isListContainer}} # noqa: E501 + collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} # noqa: E501 +{{/pathParams}} + + query_params = [] +{{#queryParams}} + if '{{paramName}}' in local_var_params: + query_params.append(('{{baseName}}', local_var_params['{{paramName}}'])){{#isListContainer}} # noqa: E501 + collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} # noqa: E501 +{{/queryParams}} + + header_params = {} +{{#headerParams}} + if '{{paramName}}' in local_var_params: + header_params['{{baseName}}'] = local_var_params['{{paramName}}']{{#isListContainer}} # noqa: E501 + collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} # noqa: E501 +{{/headerParams}} + + form_params = [] + local_var_files = {} +{{#formParams}} + if '{{paramName}}' in local_var_params: + {{^isFile}}form_params.append(('{{baseName}}', local_var_params['{{paramName}}'])){{/isFile}}{{#isFile}}local_var_files['{{baseName}}'] = local_var_params['{{paramName}}']{{/isFile}}{{#isListContainer}} # noqa: E501 + collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} # noqa: E501 +{{/formParams}} + + body_params = None +{{#bodyParam}} + if '{{paramName}}' in local_var_params: + body_params = local_var_params['{{paramName}}'] +{{/bodyParam}} + {{#hasProduces}} + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + [{{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}}]) # noqa: E501 + + {{/hasProduces}} + {{#hasConsumes}} + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + [{{#consumes}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}]) # noqa: E501 + + {{/hasConsumes}} + # Authentication setting + auth_settings = [{{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}] # noqa: E501 + + return self.api_client.call_api( + '{{{path}}}', '{{httpMethod}}', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type={{#returnType}}'{{returnType}}'{{/returnType}}{{^returnType}}None{{/returnType}}, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + {{#servers.0}} + _host=local_var_host, + {{/servers.0}} + collection_formats=collection_formats) +{{/operation}} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache new file mode 100644 index 00000000000..e955eb05707 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -0,0 +1,665 @@ +# coding: utf-8 +{{>partial_header}} +from __future__ import absolute_import + +import datetime +import inspect +import json +import mimetypes +from multiprocessing.pool import ThreadPool +import os +import re +import tempfile + +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import quote +{{#tornado}} +import tornado.gen +{{/tornado}} + +from {{packageName}}.configuration import Configuration +import {{modelPackage}} +from {{packageName}} import rest +from {{packageName}}.exceptions import ApiValueError + + +class ApiClient(object): + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + :param pool_threads: The number of threads to use for async requests + to the API. More threads means more concurrent API requests. + """ + + PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int if six.PY3 else long, # noqa: F821 + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'object': object, + } + _pool = None + + def __init__(self, configuration=None, header_name=None, header_value=None, + cookie=None, pool_threads=1): + if configuration is None: + configuration = Configuration() + self.configuration = configuration + self.pool_threads = pool_threads + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = '{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{packageVersion}}}/python{{/httpUserAgent}}' + + def __del__(self): + if self._pool: + self._pool.close() + self._pool.join() + self._pool = None + + @property + def pool(self): + """Create thread pool on first request + avoids instantiating unused threadpool for blocking clients. + """ + if self._pool is None: + self._pool = ThreadPool(self.pool_threads) + return self._pool + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + {{#tornado}} + @tornado.gen.coroutine + {{/tornado}} + {{#asyncio}}async {{/asyncio}}def __call_api( + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None, _host=None): + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, + collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, + collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, + collection_formats) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, + collection_formats) + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth(header_params, query_params, auth_settings) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + # perform request and return response + response_data = {{#asyncio}}await {{/asyncio}}{{#tornado}}yield {{/tornado}}self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + + self.last_response = response_data + + return_data = response_data + if _preload_content: + # deserialize response data + if response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None + +{{^tornado}} + if _return_http_data_only: + return (return_data) + else: + return (return_data, response_data.status, + response_data.getheaders()) +{{/tornado}} +{{#tornado}} + if _return_http_data_only: + raise tornado.gen.Return(return_data) + else: + raise tornado.gen.Return((return_data, response_data.status, + response_data.getheaders())) +{{/tornado}} + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) + for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) + for sub_obj in obj) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + + if isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) + for attr, _ in six.iteritems(obj.openapi_types) + if getattr(obj, attr) is not None} + + return {key: self.sanitize_for_serialization(val) + for key, val in six.iteritems(obj_dict)} + + def deserialize(self, response, response_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == "file": + return self.__deserialize_file(response) + + # fetch data from response object + try: + data = json.loads(response.data) + except ValueError: + data = response.data + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if type(klass) == str: + if klass.startswith('list['): + sub_kls = re.match(r'list\[(.*)\]', klass).group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('dict('): + sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in six.iteritems(data)} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr({{modelPackage}}, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datatime(data) + else: + return self.__deserialize_model(data, klass) + + def call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_type=None, auth_settings=None, async_req=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None, _host=None): + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async_req request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response: Response data type. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + if not async_req: + return self.__call_api(resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_type, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout, _host) + else: + thread = self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host)) + return thread + + def request(self, method, url, query_params=None, headers=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + else: + raise ApiValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def files_parameters(self, files=None): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + + if files: + for k, v in six.iteritems(files): + if not v: + continue + file_names = v if type(v) is list else [v] + for n in file_names: + with open(n, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([k, tuple([filename, filedata, mimetype])])) + + return params + + def select_header_accept(self, accepts): + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return + + accepts = [x.lower() for x in accepts] + + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return 'application/json' + + content_types = [x.lower() for x in content_types] + + if 'application/json' in content_types or '*/*' in content_types: + return 'application/json' + else: + return content_types[0] + + def update_params_for_auth(self, headers, querys, auth_settings): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param querys: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + """ + if not auth_settings: + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + if not auth_setting['value']: + continue + elif auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + querys.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return six.text_type(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + from dateutil.parser import parse + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datatime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + from dateutil.parser import parse + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + if not klass.openapi_types and not hasattr(klass, + 'get_real_child_model'): + return data + + used_data = data + if not isinstance(data, (list, dict)): + used_data = [data] + keyword_args = {} + positional_args = [] + if klass.openapi_types is not None: + for attr, attr_type in six.iteritems(klass.openapi_types): + if (data is not None and + klass.attribute_map[attr] in used_data): + value = used_data[klass.attribute_map[attr]] + keyword_args[attr] = self.__deserialize(value, attr_type) + + end_index = None + argspec = inspect.getargspec(getattr(klass, '__init__')) + if argspec.defaults: + end_index = -len(argspec.defaults) + required_positional_args = argspec.args[1:end_index] + + for index, req_positional_arg in enumerate(required_positional_args): + if keyword_args and req_positional_arg in keyword_args: + positional_args.append(keyword_args[req_positional_arg]) + del keyword_args[req_positional_arg] + elif (not keyword_args and index < len(used_data) and + isinstance(used_data, list)): + positional_args.append(used_data[index]) + + instance = klass(*positional_args, **keyword_args) + + if hasattr(instance, 'get_real_child_model'): + klass_name = instance.get_real_child_model(data) + if klass_name: + instance = self.__deserialize(data, klass_name) + return instance diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc.mustache new file mode 100644 index 00000000000..5cc638a2eb6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc.mustache @@ -0,0 +1,78 @@ +# {{packageName}}.{{classname}}{{#description}} +{{description}}{{/description}} + +All URIs are relative to *{{basePath}}* + +Method | HTTP request | Description +------------- | ------------- | ------------- +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{/operation}}{{/operations}} + +{{#operations}} +{{#operation}} +# **{{{operationId}}}** +> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}({{#requiredParams}}{{^defaultValue}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/defaultValue}}{{/requiredParams}}) + +{{{summary}}}{{#notes}} + +{{{notes}}}{{/notes}} + +### Example + +{{#hasAuthMethods}} +{{#authMethods}} +{{#isBasic}} +{{^isBasicBearer}} +* Basic Authentication ({{name}}): +{{/isBasicBearer}} +{{#isBasicBearer}} +* Bearer{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} Authentication ({{name}}): +{{/isBasicBearer}} +{{/isBasic}} +{{#isApiKey}} +* Api Key Authentication ({{name}}): +{{/isApiKey }} +{{#isOAuth}} +* OAuth Authentication ({{name}}): +{{/isOAuth }} +{{> api_doc_example }} +{{/authMethods}} +{{/hasAuthMethods}} +{{^hasAuthMethods}} +{{> api_doc_example }} +{{/hasAuthMethods}} +### Parameters +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +Name | Type | Description | Notes +------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} +{{#requiredParams}}{{^defaultValue}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}{{/isFile}}| {{description}} | +{{/defaultValue}}{{/requiredParams}}{{#requiredParams}}{{#defaultValue}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}{{/isFile}}| {{description}} | defaults to {{{.}}} +{{/defaultValue}}{{/requiredParams}}{{#optionalParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}{{/isFile}}| {{description}} | [optional]{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}} +{{/optionalParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}} + +### Authorization + +{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} + +### HTTP request headers + + - **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} + - **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}} + +{{#responses.0}} +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +{{#responses}} +**{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | +{{/responses}} +{{/responses.0}} + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +{{/operation}} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc_example.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc_example.mustache new file mode 100644 index 00000000000..e5eeee6b0ef --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_doc_example.mustache @@ -0,0 +1,58 @@ +```python +from __future__ import print_function +import time +import {{{packageName}}} +from {{{packageName}}}.rest import ApiException +from pprint import pprint +{{> python_doc_auth_partial}} +{{#hasAuthMethods}} +# Defining host is optional and default to {{{basePath}}} +configuration.host = "{{{basePath}}}" +# Create an instance of the API class +api_instance = {{{packageName}}}.{{{classname}}}({{{packageName}}}.ApiClient(configuration)) +{{/hasAuthMethods}} +{{^hasAuthMethods}} +# Create an instance of the API class +api_instance = {{{packageName}}}.{{{classname}}}() +{{/hasAuthMethods}} +{{#requiredParams}}{{^defaultValue}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}} +{{/defaultValue}}{{/requiredParams}}{{#optionalParams}}{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/defaultValue}} +{{/optionalParams}} + +{{#requiredParams}} +{{^hasMore}} +# example passing only required values which don't have defaults set +try: +{{#summary}} # {{{.}}} +{{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#requiredParams}}{{^defaultValue}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/defaultValue}}{{/requiredParams}}){{#returnType}} + pprint(api_response){{/returnType}} +except ApiException as e: + print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) +{{/hasMore}} +{{/requiredParams}} + +{{#optionalParams}} +{{^hasMore}} +# example passing only required values which don't have defaults set +# and optional values +try: +{{#summary}} # {{{.}}} +{{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#requiredParams}}{{^defaultValue}}{{paramName}}, {{/defaultValue}}{{/requiredParams}}{{#optionalParams}}{{paramName}}={{paramName}}{{#hasMore}}, {{/hasMore}}{{/optionalParams}}){{#returnType}} + pprint(api_response){{/returnType}} +except ApiException as e: + print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) +{{/hasMore}} +{{/optionalParams}} + +{{^requiredParams}} +{{^optionalParams}} +# example, this endpoint has no required or optional parameters +try: +{{#summary}} # {{{.}}} +{{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}(){{#returnType}} + pprint(api_response){{/returnType}} +except ApiException as e: + print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) +{{/optionalParams}} +{{/requiredParams}} +``` diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache new file mode 100644 index 00000000000..7dc8e01fa62 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache @@ -0,0 +1,241 @@ +# coding: utf-8 + +{{>partial_header}} + +import pprint +import re # noqa: F401 + +import six + + +{{#models}} +{{#model}} +class {{classname}}(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """{{#allowableValues}} + + """ + allowed enum values + """ +{{#enumVars}} + {{name}} = {{{value}}}{{^-last}} +{{/-last}} +{{/enumVars}}{{/allowableValues}} + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { +{{#requiredVars}} + '{{name}}': '{{{dataType}}}', +{{/requiredVars}} +{{#optionalVars}} + '{{name}}': '{{{dataType}}}', +{{/optionalVars}} + } + + attribute_map = { +{{#requiredVars}} + '{{name}}': '{{baseName}}', # noqa: E501 +{{/requiredVars}} +{{#optionalVars}} + '{{name}}': '{{baseName}}', # noqa: E501 +{{/optionalVars}} + } +{{#discriminator}} + + discriminator_value_class_map = { + {{#children}}'{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}': '{{{classname}}}'{{^-last}}, + {{/-last}}{{/children}} + } +{{/discriminator}} + + def __init__(self{{#requiredVars}}{{^defaultValue}}, {{name}}{{/defaultValue}}{{/requiredVars}}{{#requiredVars}}{{#defaultValue}}, {{name}}={{{defaultValue}}}{{/defaultValue}}{{/requiredVars}}{{#optionalVars}}, {{name}}=None{{/optionalVars}}): # noqa: E501 + """{{classname}} - a model defined in OpenAPI + +{{#requiredVars}}{{^hasMore}} Args:{{/hasMore}}{{/requiredVars}}{{#requiredVars}}{{^defaultValue}} + {{name}} ({{dataType}}):{{#description}} {{description}}{{/description}}{{/defaultValue}}{{/requiredVars}} + + Keyword Args:{{#requiredVars}}{{#defaultValue}} + {{name}} ({{dataType}}):{{#description}} {{description}}.{{/description}} defaults to {{{defaultValue}}}, must be one of [{{{defaultValue}}}]{{/defaultValue}} # noqa: E501{{/requiredVars}}{{#optionalVars}} + {{name}} ({{dataType}}):{{#description}} {{description}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/defaultValue}} # noqa: E501{{/optionalVars}} + """ +{{#vars}}{{#-first}} +{{/-first}} + self._{{name}} = None +{{/vars}} + self.discriminator = {{#discriminator}}'{{{discriminatorName}}}'{{/discriminator}}{{^discriminator}}None{{/discriminator}} +{{#vars}}{{#-first}} +{{/-first}} +{{#required}} + self.{{name}} = {{name}} +{{/required}} +{{^required}} +{{#isNullable}} + self.{{name}} = {{name}} +{{/isNullable}} +{{^isNullable}} + if {{name}} is not None: + self.{{name}} = {{name}} # noqa: E501 +{{/isNullable}} +{{/required}} +{{/vars}} + +{{#vars}} + @property + def {{name}}(self): + """Gets the {{name}} of this {{classname}}. # noqa: E501 + +{{#description}} + {{{description}}} # noqa: E501 +{{/description}} + + :return: The {{name}} of this {{classname}}. # noqa: E501 + :rtype: {{dataType}} + """ + return self._{{name}} + + @{{name}}.setter + def {{name}}( + self, + {{name}}): + """Sets the {{name}} of this {{classname}}. + +{{#description}} + {{{description}}} # noqa: E501 +{{/description}} + + :param {{name}}: The {{name}} of this {{classname}}. # noqa: E501 + :type: {{dataType}} + """ +{{^isNullable}} +{{#required}} + if {{name}} is None: + raise ValueError("Invalid value for `{{name}}`, must not be `None`") # noqa: E501 +{{/required}} +{{/isNullable}} +{{#isEnum}} +{{#isContainer}} + allowed_values = [{{#isNullable}}None,{{/isNullable}}{{#allowableValues}}{{#values}}{{#items.isString}}"{{/items.isString}}{{{this}}}{{#items.isString}}"{{/items.isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501 +{{#isListContainer}} + if not set({{{name}}}).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set({{{name}}}) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) +{{/isListContainer}} +{{#isMapContainer}} + if not set({{{name}}}.keys()).issubset(set(allowed_values)): + raise ValueError( + "Invalid keys in `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set({{{name}}}.keys()) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) +{{/isMapContainer}} +{{/isContainer}} +{{^isContainer}} + allowed_values = [{{#isNullable}}None,{{/isNullable}}{{#allowableValues}}{{#values}}{{#isString}}"{{/isString}}{{{this}}}{{#isString}}"{{/isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501 + if {{{name}}} not in allowed_values: + raise ValueError( + "Invalid value for `{{{name}}}` ({0}), must be one of {1}" # noqa: E501 + .format({{{name}}}, allowed_values) + ) +{{/isContainer}} +{{/isEnum}} +{{^isEnum}} +{{#hasValidation}} +{{#maxLength}} + if {{name}} is not None and len({{name}}) > {{maxLength}}: + raise ValueError("Invalid value for `{{name}}`, length must be less than or equal to `{{maxLength}}`") # noqa: E501 +{{/maxLength}} +{{#minLength}} + if {{name}} is not None and len({{name}}) < {{minLength}}: + raise ValueError("Invalid value for `{{name}}`, length must be greater than or equal to `{{minLength}}`") # noqa: E501 +{{/minLength}} +{{#maximum}} + if {{name}} is not None and {{name}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}: # noqa: E501 + raise ValueError("Invalid value for `{{name}}`, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}`{{maximum}}`") # noqa: E501 +{{/maximum}} +{{#minimum}} + if {{name}} is not None and {{name}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}: # noqa: E501 + raise ValueError("Invalid value for `{{name}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}`{{minimum}}`") # noqa: E501 +{{/minimum}} +{{#pattern}} + if {{name}} is not None and not re.search(r'{{{vendorExtensions.x-regex}}}', {{name}}{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}): # noqa: E501 + raise ValueError(r"Invalid value for `{{name}}`, must be a follow pattern or equal to `{{{pattern}}}`") # noqa: E501 +{{/pattern}} +{{#maxItems}} + if {{name}} is not None and len({{name}}) > {{maxItems}}: + raise ValueError("Invalid value for `{{name}}`, number of items must be less than or equal to `{{maxItems}}`") # noqa: E501 +{{/maxItems}} +{{#minItems}} + if {{name}} is not None and len({{name}}) < {{minItems}}: + raise ValueError("Invalid value for `{{name}}`, number of items must be greater than or equal to `{{minItems}}`") # noqa: E501 +{{/minItems}} +{{/hasValidation}} +{{/isEnum}} + + self._{{name}} = ( + {{name}}) + +{{/vars}} +{{#discriminator}} + def get_real_child_model(self, data): + """Returns the real base class specified by the discriminator""" + discriminator_key = self.attribute_map[self.discriminator] + discriminator_value = data[discriminator_key] + return self.discriminator_value_class_map.get(discriminator_value) + +{{/discriminator}} + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, {{classname}}): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_doc.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_doc.mustache new file mode 100644 index 00000000000..b6e1b263fcd --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_doc.mustache @@ -0,0 +1,13 @@ +{{#models}}{{#model}}# {{classname}} + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +{{#requiredVars}}{{^defaultValue}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{#readOnly}}[readonly] {{/readOnly}} +{{/defaultValue}}{{/requiredVars}}{{#requiredVars}}{{#defaultValue}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}defaults to {{{.}}}{{/defaultValue}} +{{/defaultValue}}{{/requiredVars}}{{#optionalVars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | [optional] {{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}} +{{/optionalVars}} + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +{{/model}}{{/models}} diff --git a/modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml index ed907f27854..d424cd93e96 100644 --- a/modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1041,6 +1041,50 @@ paths: responses: '200': description: Success + /fake/enums-of-length-one/{path_string}/{path_integer}: + put: + tags: + - fake + description: 'This route has required values with enums of 1' + operationId: testEndpointEnumsLengthOne + parameters: + - in: query + name: query_integer + required: true + type: integer + format: int32 + enum: + - 3 + - in: query + name: query_string + required: true + type: string + enum: + - brillig + - in: path + name: path_string + required: true + type: string + enum: + - hello + - in: path + name: path_integer + required: true + type: integer + enum: + - 34 + - in: header + name: header_number + required: true + type: number + format: double + enum: + - 1.234 + consumes: + - application/json + responses: + '200': + description: Success '/fake/{petId}/uploadImageWithRequiredFile': post: tags: @@ -1703,6 +1747,7 @@ definitions: type: string TypeHolderDefault: type: object + description: a model to test optional properties with server defaults required: - string_item - number_item @@ -1716,12 +1761,25 @@ definitions: number_item: type: number default: 1.234 + format: double integer_item: type: integer + format: int32 default: -2 bool_item: type: boolean default: true + # swagger-parser does not see date defaults yet: https://github.com/swagger-api/swagger-parser/issues/971 + date_item: + type: string + format: date + default: 2017-07-21 + # swagger-parser does not see date-time defaults yet: https://github.com/swagger-api/swagger-parser/issues/971 + datetime_item: + type: string + format: date-time + default: 2017-07-21T17:32:28Z + # swagger-parser does not see array defaults yet: https://github.com/swagger-api/swagger-parser/issues/971 array_item: type: array items: @@ -1733,22 +1791,30 @@ definitions: - 3 TypeHolderExample: type: object + description: a model to test required properties with an example and length one enum required: - string_item - number_item - integer_item - bool_item - array_item + # - date_item/datetime_item adding date and datetime enums will be a future task, this does not yet work in many languages properties: string_item: type: string example: what + enum: [what] number_item: type: number + format: double example: 1.234 + enum: [1.234] integer_item: type: integer + format: int32 + enum: [-2] example: -2 + # swagger-parser does not see bool enums yet https://github.com/swagger-api/swagger-parser/issues/985 bool_item: type: boolean example: true @@ -1757,10 +1823,17 @@ definitions: items: type: integer example: - - 0 - - 1 - - 2 - - 3 + - + - 0 + - 1 + - 2 + - 3 + enum: + - + - 0 + - 1 + - 2 + - 3 XmlItem: type: object xml: @@ -1939,4 +2012,4 @@ definitions: type: integer xml: namespace: http://g.com/schema - prefix: g + prefix: g \ No newline at end of file diff --git a/samples/client/petstore/python-experimental/README.md b/samples/client/petstore/python-experimental/README.md index 3e91b2678be..8f84fade2fb 100644 --- a/samples/client/petstore/python-experimental/README.md +++ b/samples/client/petstore/python-experimental/README.md @@ -52,7 +52,9 @@ from petstore_api.rest import ApiException from pprint import pprint -# create an instance of the API class +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class api_instance = petstore_api.AnotherFakeApi(petstore_api.ApiClient(configuration)) body = petstore_api.Client() # Client | client model @@ -80,6 +82,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | *FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | *FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**test_endpoint_enums_length_one**](docs/FakeApi.md#test_endpoint_enums_length_one) | **PUT** /fake/enums-of-length-one/{path_string}/{path_integer} | *FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters *FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) diff --git a/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md b/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md index c3f84772cfd..67906afc0cd 100644 --- a/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md +++ b/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md @@ -23,7 +23,7 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# create an instance of the API class +# Create an instance of the API class api_instance = petstore_api.AnotherFakeApi() body = petstore_api.Client() # Client | client model @@ -39,7 +39,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **body** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/python-experimental/docs/FakeApi.md b/samples/client/petstore/python-experimental/docs/FakeApi.md index 946a8ce3e77..5aa5443d06f 100644 --- a/samples/client/petstore/python-experimental/docs/FakeApi.md +++ b/samples/client/petstore/python-experimental/docs/FakeApi.md @@ -12,6 +12,7 @@ Method | HTTP request | Description [**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | [**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | [**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model +[**test_endpoint_enums_length_one**](FakeApi.md#test_endpoint_enums_length_one) | **PUT** /fake/enums-of-length-one/{path_string}/{path_integer} | [**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters [**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) @@ -35,7 +36,7 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# create an instance of the API class +# Create an instance of the API class api_instance = petstore_api.FakeApi() xml_item = petstore_api.XmlItem() # XmlItem | XmlItem Body @@ -50,7 +51,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **xml_item** | [**XmlItem**](XmlItem.md)| XmlItem Body | + **xml_item** | [**XmlItem**](XmlItem.md)| XmlItem Body | ### Return type @@ -73,7 +74,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **fake_outer_boolean_serialize** -> bool fake_outer_boolean_serialize(body=body) +> bool fake_outer_boolean_serialize() @@ -88,7 +89,7 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# create an instance of the API class +# Create an instance of the API class api_instance = petstore_api.FakeApi() body = True # bool | Input boolean as post body (optional) @@ -103,7 +104,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **bool**| Input boolean as post body | [optional] + **body** | **bool**| Input boolean as post body | [optional] ### Return type @@ -126,7 +127,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **fake_outer_composite_serialize** -> OuterComposite fake_outer_composite_serialize(body=body) +> OuterComposite fake_outer_composite_serialize() @@ -141,7 +142,7 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# create an instance of the API class +# Create an instance of the API class api_instance = petstore_api.FakeApi() body = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional) @@ -156,7 +157,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -179,7 +180,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **fake_outer_number_serialize** -> float fake_outer_number_serialize(body=body) +> float fake_outer_number_serialize() @@ -194,7 +195,7 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# create an instance of the API class +# Create an instance of the API class api_instance = petstore_api.FakeApi() body = 3.4 # float | Input number as post body (optional) @@ -209,7 +210,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **float**| Input number as post body | [optional] + **body** | **float**| Input number as post body | [optional] ### Return type @@ -232,7 +233,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **fake_outer_string_serialize** -> str fake_outer_string_serialize(body=body) +> str fake_outer_string_serialize() @@ -247,7 +248,7 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# create an instance of the API class +# Create an instance of the API class api_instance = petstore_api.FakeApi() body = 'body_example' # str | Input string as post body (optional) @@ -262,7 +263,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **str**| Input string as post body | [optional] + **body** | **str**| Input string as post body | [optional] ### Return type @@ -300,7 +301,7 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# create an instance of the API class +# Create an instance of the API class api_instance = petstore_api.FakeApi() body = petstore_api.FileSchemaTestClass() # FileSchemaTestClass | @@ -314,7 +315,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | ### Return type @@ -350,7 +351,7 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# create an instance of the API class +# Create an instance of the API class api_instance = petstore_api.FakeApi() query = 'query_example' # str | body = petstore_api.User() # User | @@ -365,8 +366,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **query** | **str**| | - **body** | [**User**](User.md)| | + **query** | **str**| | + **body** | [**User**](User.md)| | ### Return type @@ -404,7 +405,7 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# create an instance of the API class +# Create an instance of the API class api_instance = petstore_api.FakeApi() body = petstore_api.Client() # Client | client model @@ -420,7 +421,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **body** | [**Client**](Client.md)| client model | ### Return type @@ -442,8 +443,68 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **test_endpoint_enums_length_one** +> test_endpoint_enums_length_one() + + + +This route has required values with enums of 1 + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +query_integer = 3 # int | (default to 3) +query_string = 'brillig' # str | (default to 'brillig') +path_string = 'hello' # str | (default to 'hello') +path_integer = 34 # int | (default to 34) +header_number = 1.234 # float | (default to 1.234) + +try: + api_instance.test_endpoint_enums_length_one(query_integer, query_string, path_string, path_integer, header_number) +except ApiException as e: + print("Exception when calling FakeApi->test_endpoint_enums_length_one: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query_integer** | **int**| | defaults to 3 + **query_string** | **str**| | defaults to 'brillig' + **path_string** | **str**| | defaults to 'hello' + **path_integer** | **int**| | defaults to 34 + **header_number** | **float**| | defaults to 1.234 + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **test_endpoint_parameters** -> test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) +> test_endpoint_parameters(number, double, pattern_without_delimiter, byte) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -463,7 +524,9 @@ configuration = petstore_api.Configuration() configuration.username = 'YOUR_USERNAME' configuration.password = 'YOUR_PASSWORD' -# create an instance of the API class +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class api_instance = petstore_api.FakeApi(petstore_api.ApiClient(configuration)) number = 3.4 # float | None double = 3.4 # float | None @@ -491,20 +554,20 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **number** | **float**| None | - **double** | **float**| None | - **pattern_without_delimiter** | **str**| None | - **byte** | **str**| None | - **integer** | **int**| None | [optional] - **int32** | **int**| None | [optional] - **int64** | **int**| None | [optional] - **float** | **float**| None | [optional] - **string** | **str**| None | [optional] - **binary** | **file**| None | [optional] - **date** | **date**| None | [optional] - **date_time** | **datetime**| None | [optional] - **password** | **str**| None | [optional] - **param_callback** | **str**| None | [optional] + **number** | **float**| None | + **double** | **float**| None | + **pattern_without_delimiter** | **str**| None | + **byte** | **str**| None | + **integer** | **int**| None | [optional] + **int32** | **int**| None | [optional] + **int64** | **int**| None | [optional] + **float** | **float**| None | [optional] + **string** | **str**| None | [optional] + **binary** | **file**| None | [optional] + **date** | **date**| None | [optional] + **date_time** | **datetime**| None | [optional] + **password** | **str**| None | [optional] + **param_callback** | **str**| None | [optional] ### Return type @@ -528,7 +591,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_enum_parameters** -> test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) +> test_enum_parameters() To test enum parameters @@ -543,7 +606,7 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# create an instance of the API class +# Create an instance of the API class api_instance = petstore_api.FakeApi() enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional) enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to '-efg') @@ -565,14 +628,14 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **enum_header_string_array** | [**list[str]**](str.md)| Header parameter enum test (string array) | [optional] - **enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to '-efg'] - **enum_query_string_array** | [**list[str]**](str.md)| Query parameter enum test (string array) | [optional] - **enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to '-efg'] - **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] - **enum_query_double** | **float**| Query parameter enum test (double) | [optional] - **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] [default to '$'] - **enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to '-efg'] + **enum_header_string_array** | [**list[str]**](str.md)| Header parameter enum test (string array) | [optional] + **enum_header_string** | **str**| Header parameter enum test (string) | [optional] if omitted the server will use the default value of '-efg' + **enum_query_string_array** | [**list[str]**](str.md)| Query parameter enum test (string array) | [optional] + **enum_query_string** | **str**| Query parameter enum test (string) | [optional] if omitted the server will use the default value of '-efg' + **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] + **enum_query_double** | **float**| Query parameter enum test (double) | [optional] + **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] if omitted the server will use the default value of '$' + **enum_form_string** | **str**| Form parameter enum test (string) | [optional] if omitted the server will use the default value of '-efg' ### Return type @@ -596,7 +659,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_group_parameters** -> test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) +> test_group_parameters(required_string_group, required_boolean_group, required_int64_group) Fake endpoint to test group parameters (optional) @@ -611,7 +674,7 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# create an instance of the API class +# Create an instance of the API class api_instance = petstore_api.FakeApi() required_string_group = 56 # int | Required String in group parameters required_boolean_group = True # bool | Required Boolean in group parameters @@ -631,12 +694,12 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **required_string_group** | **int**| Required String in group parameters | - **required_boolean_group** | **bool**| Required Boolean in group parameters | - **required_int64_group** | **int**| Required Integer in group parameters | - **string_group** | **int**| String in group parameters | [optional] - **boolean_group** | **bool**| Boolean in group parameters | [optional] - **int64_group** | **int**| Integer in group parameters | [optional] + **required_string_group** | **int**| Required String in group parameters | + **required_boolean_group** | **bool**| Required Boolean in group parameters | + **required_int64_group** | **int**| Required Integer in group parameters | + **string_group** | **int**| String in group parameters | [optional] + **boolean_group** | **bool**| Boolean in group parameters | [optional] + **int64_group** | **int**| Integer in group parameters | [optional] ### Return type @@ -672,7 +735,7 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# create an instance of the API class +# Create an instance of the API class api_instance = petstore_api.FakeApi() param = {'key': 'param_example'} # dict(str, str) | request body @@ -687,7 +750,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | [**dict(str, str)**](str.md)| request body | + **param** | [**dict(str, str)**](str.md)| request body | ### Return type @@ -723,7 +786,7 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# create an instance of the API class +# Create an instance of the API class api_instance = petstore_api.FakeApi() param = 'param_example' # str | field1 param2 = 'param2_example' # str | field2 @@ -739,8 +802,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **str**| field1 | - **param2** | **str**| field2 | + **param** | **str**| field1 | + **param2** | **str**| field2 | ### Return type diff --git a/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md index 7ffcf211224..321fd9e1854 100644 --- a/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md @@ -29,7 +29,9 @@ configuration.api_key['api_key_query'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['api_key_query'] = 'Bearer' -# create an instance of the API class +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class api_instance = petstore_api.FakeClassnameTags123Api(petstore_api.ApiClient(configuration)) body = petstore_api.Client() # Client | client model @@ -45,7 +47,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **body** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/python-experimental/docs/PetApi.md b/samples/client/petstore/python-experimental/docs/PetApi.md index 3ed2551bd64..cda559d0c62 100644 --- a/samples/client/petstore/python-experimental/docs/PetApi.md +++ b/samples/client/petstore/python-experimental/docs/PetApi.md @@ -33,7 +33,9 @@ configuration = petstore_api.Configuration() # Configure OAuth2 access token for authorization: petstore_auth configuration.access_token = 'YOUR_ACCESS_TOKEN' -# create an instance of the API class +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store @@ -48,7 +50,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -72,7 +74,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **delete_pet** -> delete_pet(pet_id, api_key=api_key) +> delete_pet(pet_id) Deletes a pet @@ -89,7 +91,9 @@ configuration = petstore_api.Configuration() # Configure OAuth2 access token for authorization: petstore_auth configuration.access_token = 'YOUR_ACCESS_TOKEN' -# create an instance of the API class +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) pet_id = 56 # int | Pet id to delete api_key = 'api_key_example' # str | (optional) @@ -105,8 +109,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| Pet id to delete | - **api_key** | **str**| | [optional] + **pet_id** | **int**| Pet id to delete | + **api_key** | **str**| | [optional] ### Return type @@ -149,7 +153,9 @@ configuration = petstore_api.Configuration() # Configure OAuth2 access token for authorization: petstore_auth configuration.access_token = 'YOUR_ACCESS_TOKEN' -# create an instance of the API class +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) status = ['status_example'] # list[str] | Status values that need to be considered for filter @@ -165,7 +171,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**list[str]**](str.md)| Status values that need to be considered for filter | + **status** | [**list[str]**](str.md)| Status values that need to be considered for filter | ### Return type @@ -208,7 +214,9 @@ configuration = petstore_api.Configuration() # Configure OAuth2 access token for authorization: petstore_auth configuration.access_token = 'YOUR_ACCESS_TOKEN' -# create an instance of the API class +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) tags = ['tags_example'] # list[str] | Tags to filter by @@ -224,7 +232,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**list[str]**](str.md)| Tags to filter by | + **tags** | [**list[str]**](str.md)| Tags to filter by | ### Return type @@ -269,7 +277,9 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['api_key'] = 'Bearer' -# create an instance of the API class +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) pet_id = 56 # int | ID of pet to return @@ -285,7 +295,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to return | + **pet_id** | **int**| ID of pet to return | ### Return type @@ -327,7 +337,9 @@ configuration = petstore_api.Configuration() # Configure OAuth2 access token for authorization: petstore_auth configuration.access_token = 'YOUR_ACCESS_TOKEN' -# create an instance of the API class +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) body = petstore_api.Pet() # Pet | Pet object that needs to be added to the store @@ -342,7 +354,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -368,7 +380,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_pet_with_form** -> update_pet_with_form(pet_id, name=name, status=status) +> update_pet_with_form(pet_id) Updates a pet in the store with form data @@ -385,7 +397,9 @@ configuration = petstore_api.Configuration() # Configure OAuth2 access token for authorization: petstore_auth configuration.access_token = 'YOUR_ACCESS_TOKEN' -# create an instance of the API class +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) pet_id = 56 # int | ID of pet that needs to be updated name = 'name_example' # str | Updated name of the pet (optional) @@ -402,9 +416,9 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet that needs to be updated | - **name** | **str**| Updated name of the pet | [optional] - **status** | **str**| Updated status of the pet | [optional] + **pet_id** | **int**| ID of pet that needs to be updated | + **name** | **str**| Updated name of the pet | [optional] + **status** | **str**| Updated status of the pet | [optional] ### Return type @@ -427,7 +441,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **upload_file** -> ApiResponse upload_file(pet_id, additional_metadata=additional_metadata, file=file) +> ApiResponse upload_file(pet_id) uploads an image @@ -444,7 +458,9 @@ configuration = petstore_api.Configuration() # Configure OAuth2 access token for authorization: petstore_auth configuration.access_token = 'YOUR_ACCESS_TOKEN' -# create an instance of the API class +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) pet_id = 56 # int | ID of pet to update additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) @@ -462,9 +478,9 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to update | - **additional_metadata** | **str**| Additional data to pass to server | [optional] - **file** | **file**| file to upload | [optional] + **pet_id** | **int**| ID of pet to update | + **additional_metadata** | **str**| Additional data to pass to server | [optional] + **file** | **file**| file to upload | [optional] ### Return type @@ -487,7 +503,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **upload_file_with_required_file** -> ApiResponse upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) +> ApiResponse upload_file_with_required_file(pet_id, required_file) uploads an image (required) @@ -504,7 +520,9 @@ configuration = petstore_api.Configuration() # Configure OAuth2 access token for authorization: petstore_auth configuration.access_token = 'YOUR_ACCESS_TOKEN' -# create an instance of the API class +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) pet_id = 56 # int | ID of pet to update required_file = '/path/to/file' # file | file to upload @@ -522,9 +540,9 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to update | - **required_file** | **file**| file to upload | - **additional_metadata** | **str**| Additional data to pass to server | [optional] + **pet_id** | **int**| ID of pet to update | + **required_file** | **file**| file to upload | + **additional_metadata** | **str**| Additional data to pass to server | [optional] ### Return type diff --git a/samples/client/petstore/python-experimental/docs/StoreApi.md b/samples/client/petstore/python-experimental/docs/StoreApi.md index 76b94f73dcf..8c49f326222 100644 --- a/samples/client/petstore/python-experimental/docs/StoreApi.md +++ b/samples/client/petstore/python-experimental/docs/StoreApi.md @@ -26,7 +26,7 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# create an instance of the API class +# Create an instance of the API class api_instance = petstore_api.StoreApi() order_id = 'order_id_example' # str | ID of the order that needs to be deleted @@ -41,7 +41,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_id** | **str**| ID of the order that needs to be deleted | + **order_id** | **str**| ID of the order that needs to be deleted | ### Return type @@ -86,7 +86,9 @@ configuration.api_key['api_key'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['api_key'] = 'Bearer' -# create an instance of the API class +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class api_instance = petstore_api.StoreApi(petstore_api.ApiClient(configuration)) try: @@ -136,7 +138,7 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# create an instance of the API class +# Create an instance of the API class api_instance = petstore_api.StoreApi() order_id = 56 # int | ID of pet that needs to be fetched @@ -152,7 +154,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_id** | **int**| ID of pet that needs to be fetched | + **order_id** | **int**| ID of pet that needs to be fetched | ### Return type @@ -190,7 +192,7 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# create an instance of the API class +# Create an instance of the API class api_instance = petstore_api.StoreApi() body = petstore_api.Order() # Order | order placed for purchasing the pet @@ -206,7 +208,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **body** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/python-experimental/docs/TypeHolderDefault.md b/samples/client/petstore/python-experimental/docs/TypeHolderDefault.md index 861da021826..fc82b9a827d 100644 --- a/samples/client/petstore/python-experimental/docs/TypeHolderDefault.md +++ b/samples/client/petstore/python-experimental/docs/TypeHolderDefault.md @@ -4,9 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **string_item** | **str** | | [default to 'what'] -**number_item** | **float** | | -**integer_item** | **int** | | +**number_item** | **float** | | [default to 1.234] +**integer_item** | **int** | | [default to -2] **bool_item** | **bool** | | [default to True] +**date_item** | **date** | | [optional] +**datetime_item** | **datetime** | | [optional] **array_item** | **list[int]** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-experimental/docs/TypeHolderExample.md b/samples/client/petstore/python-experimental/docs/TypeHolderExample.md index d59718cdcb1..bb334f9925b 100644 --- a/samples/client/petstore/python-experimental/docs/TypeHolderExample.md +++ b/samples/client/petstore/python-experimental/docs/TypeHolderExample.md @@ -3,9 +3,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**string_item** | **str** | | -**number_item** | **float** | | -**integer_item** | **int** | | +**string_item** | **str** | | [default to 'what'] +**number_item** | **float** | | [default to 1.234] +**integer_item** | **int** | | [default to -2] **bool_item** | **bool** | | **array_item** | **list[int]** | | diff --git a/samples/client/petstore/python-experimental/docs/UserApi.md b/samples/client/petstore/python-experimental/docs/UserApi.md index 783bb991ce1..b4df7a36803 100644 --- a/samples/client/petstore/python-experimental/docs/UserApi.md +++ b/samples/client/petstore/python-experimental/docs/UserApi.md @@ -30,7 +30,7 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# create an instance of the API class +# Create an instance of the API class api_instance = petstore_api.UserApi() body = petstore_api.User() # User | Created user object @@ -45,7 +45,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **body** | [**User**](User.md)| Created user object | ### Return type @@ -81,7 +81,7 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# create an instance of the API class +# Create an instance of the API class api_instance = petstore_api.UserApi() body = [petstore_api.User()] # list[User] | List of user object @@ -96,7 +96,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**list[User]**](User.md)| List of user object | + **body** | [**list[User]**](User.md)| List of user object | ### Return type @@ -132,7 +132,7 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# create an instance of the API class +# Create an instance of the API class api_instance = petstore_api.UserApi() body = [petstore_api.User()] # list[User] | List of user object @@ -147,7 +147,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**list[User]**](User.md)| List of user object | + **body** | [**list[User]**](User.md)| List of user object | ### Return type @@ -185,7 +185,7 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# create an instance of the API class +# Create an instance of the API class api_instance = petstore_api.UserApi() username = 'username_example' # str | The name that needs to be deleted @@ -200,7 +200,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **str**| The name that needs to be deleted | + **username** | **str**| The name that needs to be deleted | ### Return type @@ -237,7 +237,7 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# create an instance of the API class +# Create an instance of the API class api_instance = petstore_api.UserApi() username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. @@ -253,7 +253,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **str**| The name that needs to be fetched. Use user1 for testing. | + **username** | **str**| The name that needs to be fetched. Use user1 for testing. | ### Return type @@ -291,7 +291,7 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# create an instance of the API class +# Create an instance of the API class api_instance = petstore_api.UserApi() username = 'username_example' # str | The user name for login password = 'password_example' # str | The password for login in clear text @@ -308,8 +308,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **str**| The user name for login | - **password** | **str**| The password for login in clear text | + **username** | **str**| The user name for login | + **password** | **str**| The password for login in clear text | ### Return type @@ -346,7 +346,7 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# create an instance of the API class +# Create an instance of the API class api_instance = petstore_api.UserApi() try: @@ -395,7 +395,7 @@ import petstore_api from petstore_api.rest import ApiException from pprint import pprint -# create an instance of the API class +# Create an instance of the API class api_instance = petstore_api.UserApi() username = 'username_example' # str | name that need to be deleted body = petstore_api.User() # User | Updated user object @@ -411,8 +411,8 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **str**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **username** | **str**| name that need to be deleted | + **body** | [**User**](User.md)| Updated user object | ### Return type diff --git a/samples/client/petstore/python-experimental/openapi_client/api_client.py b/samples/client/petstore/python-experimental/openapi_client/api_client.py new file mode 100644 index 00000000000..efe3e5c3789 --- /dev/null +++ b/samples/client/petstore/python-experimental/openapi_client/api_client.py @@ -0,0 +1,658 @@ +# coding: utf-8 +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +from __future__ import absolute_import + +import datetime +import inspect +import json +import mimetypes +from multiprocessing.pool import ThreadPool +import os +import re +import tempfile + +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import quote + +from petstore_api.configuration import Configuration +import petstore_api.models +from petstore_api import rest +from petstore_api.exceptions import ApiValueError + + +class ApiClient(object): + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + :param pool_threads: The number of threads to use for async requests + to the API. More threads means more concurrent API requests. + """ + + PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int if six.PY3 else long, # noqa: F821 + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'object': object, + } + _pool = None + + def __init__(self, configuration=None, header_name=None, header_value=None, + cookie=None, pool_threads=1): + if configuration is None: + configuration = Configuration() + self.configuration = configuration + self.pool_threads = pool_threads + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'OpenAPI-Generator/1.0.0/python' + + def __del__(self): + if self._pool: + self._pool.close() + self._pool.join() + self._pool = None + + @property + def pool(self): + """Create thread pool on first request + avoids instantiating unused threadpool for blocking clients. + """ + if self._pool is None: + self._pool = ThreadPool(self.pool_threads) + return self._pool + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + def __call_api( + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None, _host=None): + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, + collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, + collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, + collection_formats) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, + collection_formats) + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth(header_params, query_params, auth_settings) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + # perform request and return response + response_data = self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + + self.last_response = response_data + + return_data = response_data + if _preload_content: + # deserialize response data + if response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None + + if _return_http_data_only: + return (return_data) + else: + return (return_data, response_data.status, + response_data.getheaders()) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) + for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) + for sub_obj in obj) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + + if isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) + for attr, _ in six.iteritems(obj.openapi_types) + if getattr(obj, attr) is not None} + + return {key: self.sanitize_for_serialization(val) + for key, val in six.iteritems(obj_dict)} + + def deserialize(self, response, response_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == "file": + return self.__deserialize_file(response) + + # fetch data from response object + try: + data = json.loads(response.data) + except ValueError: + data = response.data + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if type(klass) == str: + if klass.startswith('list['): + sub_kls = re.match(r'list\[(.*)\]', klass).group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('dict('): + sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in six.iteritems(data)} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(petstore_api.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datatime(data) + else: + return self.__deserialize_model(data, klass) + + def call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_type=None, auth_settings=None, async_req=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None, _host=None): + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async_req request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response: Response data type. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + if not async_req: + return self.__call_api(resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_type, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout, _host) + else: + thread = self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host)) + return thread + + def request(self, method, url, query_params=None, headers=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + else: + raise ApiValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def files_parameters(self, files=None): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + + if files: + for k, v in six.iteritems(files): + if not v: + continue + file_names = v if type(v) is list else [v] + for n in file_names: + with open(n, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([k, tuple([filename, filedata, mimetype])])) + + return params + + def select_header_accept(self, accepts): + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return + + accepts = [x.lower() for x in accepts] + + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return 'application/json' + + content_types = [x.lower() for x in content_types] + + if 'application/json' in content_types or '*/*' in content_types: + return 'application/json' + else: + return content_types[0] + + def update_params_for_auth(self, headers, querys, auth_settings): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param querys: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + """ + if not auth_settings: + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + if not auth_setting['value']: + continue + elif auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + querys.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return six.text_type(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + from dateutil.parser import parse + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datatime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + from dateutil.parser import parse + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + if not klass.openapi_types and not hasattr(klass, + 'get_real_child_model'): + return data + + used_data = data + if not isinstance(data, (list, dict)): + used_data = [data] + keyword_args = {} + positional_args = [] + if klass.openapi_types is not None: + for attr, attr_type in six.iteritems(klass.openapi_types): + if (data is not None and + klass.attribute_map[attr] in used_data): + value = used_data[klass.attribute_map[attr]] + keyword_args[attr] = self.__deserialize(value, attr_type) + + end_index = None + argspec = inspect.getargspec(getattr(klass, '__init__')) + if argspec.defaults: + end_index = -len(argspec.defaults) + required_positional_args = argspec.args[1:end_index] + + for index, req_positional_arg in enumerate(required_positional_args): + if keyword_args and req_positional_arg in keyword_args: + positional_args.append(keyword_args[req_positional_arg]) + del keyword_args[req_positional_arg] + elif (not keyword_args and index < len(used_data) and + isinstance(used_data, list)): + positional_args.append(used_data[index]) + + instance = klass(*positional_args, **keyword_args) + + if hasattr(instance, 'get_real_child_model'): + klass_name = instance.get_real_child_model(data) + if klass_name: + instance = self.__deserialize(data, klass_name) + return instance diff --git a/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py index a47a8e3ea18..01d055616eb 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py @@ -18,7 +18,7 @@ import re # noqa: F401 import six from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( +from petstore_api.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError ) @@ -45,21 +45,28 @@ class AnotherFakeApi(object): >>> thread = api.call_123_test_special_tags(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param Client body: client model (required) - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Client - If the method is called asynchronously, - returns the request thread. + Args: + body (Client): client model + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + Client: """ kwargs['_return_http_data_only'] = True - return self.call_123_test_special_tags_with_http_info(body, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.call_123_test_special_tags_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.call_123_test_special_tags_with_http_info(body, **kwargs) # noqa: E501 + return data def call_123_test_special_tags_with_http_info(self, body, **kwargs): # noqa: E501 """To test special tags # noqa: E501 @@ -70,20 +77,21 @@ class AnotherFakeApi(object): >>> thread = api.call_123_test_special_tags_with_http_info(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param Client body: client model (required) - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: tuple(Client, status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. + Args: + body (Client): client model + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + Client: """ local_var_params = locals() diff --git a/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py b/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py index 1847804c552..0f14ef6739d 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py @@ -18,7 +18,7 @@ import re # noqa: F401 import six from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( +from petstore_api.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError ) @@ -45,21 +45,28 @@ class FakeApi(object): >>> thread = api.create_xml_item(xml_item, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param XmlItem xml_item: XmlItem Body (required) - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + xml_item (XmlItem): XmlItem Body + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ kwargs['_return_http_data_only'] = True - return self.create_xml_item_with_http_info(xml_item, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.create_xml_item_with_http_info(xml_item, **kwargs) # noqa: E501 + else: + (data) = self.create_xml_item_with_http_info(xml_item, **kwargs) # noqa: E501 + return data def create_xml_item_with_http_info(self, xml_item, **kwargs): # noqa: E501 """creates an XmlItem # noqa: E501 @@ -70,20 +77,21 @@ class FakeApi(object): >>> thread = api.create_xml_item_with_http_info(xml_item, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param XmlItem xml_item: XmlItem Body (required) - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + xml_item (XmlItem): XmlItem Body + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ local_var_params = locals() @@ -153,21 +161,28 @@ class FakeApi(object): >>> thread = api.fake_outer_boolean_serialize(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param bool body: Input boolean as post body - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: bool - If the method is called asynchronously, - returns the request thread. + + + Keyword Args: + body (bool): Input boolean as post body. [optional] + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + bool: """ kwargs['_return_http_data_only'] = True - return self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.fake_outer_boolean_serialize_with_http_info(**kwargs) # noqa: E501 + return data def fake_outer_boolean_serialize_with_http_info(self, **kwargs): # noqa: E501 """fake_outer_boolean_serialize # noqa: E501 @@ -178,20 +193,21 @@ class FakeApi(object): >>> thread = api.fake_outer_boolean_serialize_with_http_info(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param bool body: Input boolean as post body - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: tuple(bool, status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. + + + Keyword Args: + body (bool): Input boolean as post body. [optional] + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + bool: """ local_var_params = locals() @@ -257,21 +273,28 @@ class FakeApi(object): >>> thread = api.fake_outer_composite_serialize(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param OuterComposite body: Input composite as post body - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: OuterComposite - If the method is called asynchronously, - returns the request thread. + + + Keyword Args: + body (OuterComposite): Input composite as post body. [optional] + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + OuterComposite: """ kwargs['_return_http_data_only'] = True - return self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.fake_outer_composite_serialize_with_http_info(**kwargs) # noqa: E501 + return data def fake_outer_composite_serialize_with_http_info(self, **kwargs): # noqa: E501 """fake_outer_composite_serialize # noqa: E501 @@ -282,20 +305,21 @@ class FakeApi(object): >>> thread = api.fake_outer_composite_serialize_with_http_info(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param OuterComposite body: Input composite as post body - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: tuple(OuterComposite, status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. + + + Keyword Args: + body (OuterComposite): Input composite as post body. [optional] + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + OuterComposite: """ local_var_params = locals() @@ -361,21 +385,28 @@ class FakeApi(object): >>> thread = api.fake_outer_number_serialize(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param float body: Input number as post body - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: float - If the method is called asynchronously, - returns the request thread. + + + Keyword Args: + body (float): Input number as post body. [optional] + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + float: """ kwargs['_return_http_data_only'] = True - return self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.fake_outer_number_serialize_with_http_info(**kwargs) # noqa: E501 + return data def fake_outer_number_serialize_with_http_info(self, **kwargs): # noqa: E501 """fake_outer_number_serialize # noqa: E501 @@ -386,20 +417,21 @@ class FakeApi(object): >>> thread = api.fake_outer_number_serialize_with_http_info(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param float body: Input number as post body - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: tuple(float, status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. + + + Keyword Args: + body (float): Input number as post body. [optional] + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + float: """ local_var_params = locals() @@ -465,21 +497,28 @@ class FakeApi(object): >>> thread = api.fake_outer_string_serialize(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param str body: Input string as post body - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: str - If the method is called asynchronously, - returns the request thread. + + + Keyword Args: + body (str): Input string as post body. [optional] + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + str: """ kwargs['_return_http_data_only'] = True - return self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.fake_outer_string_serialize_with_http_info(**kwargs) # noqa: E501 + return data def fake_outer_string_serialize_with_http_info(self, **kwargs): # noqa: E501 """fake_outer_string_serialize # noqa: E501 @@ -490,20 +529,21 @@ class FakeApi(object): >>> thread = api.fake_outer_string_serialize_with_http_info(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param str body: Input string as post body - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: tuple(str, status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. + + + Keyword Args: + body (str): Input string as post body. [optional] + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + str: """ local_var_params = locals() @@ -569,21 +609,28 @@ class FakeApi(object): >>> thread = api.test_body_with_file_schema(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param FileSchemaTestClass body: (required) - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + body (FileSchemaTestClass): + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ kwargs['_return_http_data_only'] = True - return self.test_body_with_file_schema_with_http_info(body, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.test_body_with_file_schema_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.test_body_with_file_schema_with_http_info(body, **kwargs) # noqa: E501 + return data def test_body_with_file_schema_with_http_info(self, body, **kwargs): # noqa: E501 """test_body_with_file_schema # noqa: E501 @@ -594,20 +641,21 @@ class FakeApi(object): >>> thread = api.test_body_with_file_schema_with_http_info(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param FileSchemaTestClass body: (required) - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + body (FileSchemaTestClass): + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ local_var_params = locals() @@ -676,22 +724,28 @@ class FakeApi(object): >>> thread = api.test_body_with_query_params(query, body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param str query: (required) - :param User body: (required) - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + query (str): body (User): + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ kwargs['_return_http_data_only'] = True - return self.test_body_with_query_params_with_http_info(query, body, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.test_body_with_query_params_with_http_info(query, body, **kwargs) # noqa: E501 + else: + (data) = self.test_body_with_query_params_with_http_info(query, body, **kwargs) # noqa: E501 + return data def test_body_with_query_params_with_http_info(self, query, body, **kwargs): # noqa: E501 """test_body_with_query_params # noqa: E501 @@ -701,21 +755,21 @@ class FakeApi(object): >>> thread = api.test_body_with_query_params_with_http_info(query, body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param str query: (required) - :param User body: (required) - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + query (str): body (User): + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ local_var_params = locals() @@ -791,21 +845,28 @@ class FakeApi(object): >>> thread = api.test_client_model(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param Client body: client model (required) - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Client - If the method is called asynchronously, - returns the request thread. + Args: + body (Client): client model + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + Client: """ kwargs['_return_http_data_only'] = True - return self.test_client_model_with_http_info(body, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.test_client_model_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.test_client_model_with_http_info(body, **kwargs) # noqa: E501 + return data def test_client_model_with_http_info(self, body, **kwargs): # noqa: E501 """To test \"client\" model # noqa: E501 @@ -816,20 +877,21 @@ class FakeApi(object): >>> thread = api.test_client_model_with_http_info(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param Client body: client model (required) - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: tuple(Client, status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. + Args: + body (Client): client model + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + Client: """ local_var_params = locals() @@ -894,6 +956,187 @@ class FakeApi(object): _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) + def test_endpoint_enums_length_one(self, query_integer=3, query_string='brillig', path_string='hello', path_integer=34, header_number=1.234, **kwargs): # noqa: E501 + """test_endpoint_enums_length_one # noqa: E501 + + This route has required values with enums of 1 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_endpoint_enums_length_one(query_integer=3, query_string='brillig', path_string='hello', path_integer=34, header_number=1.234, async_req=True) + >>> result = thread.get() + + Args: + + query_integer (int): defaults to 3, must be one of [3] + query_string (str): defaults to 'brillig', must be one of ['brillig'] + path_string (str): defaults to 'hello', must be one of ['hello'] + path_integer (int): defaults to 34, must be one of [34] + header_number (float): defaults to 1.234, must be one of [1.234] + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.test_endpoint_enums_length_one_with_http_info(query_integer=query_integer, query_string=query_string, path_string=path_string, path_integer=path_integer, header_number=header_number, **kwargs) # noqa: E501 + else: + (data) = self.test_endpoint_enums_length_one_with_http_info(query_integer=query_integer, query_string=query_string, path_string=path_string, path_integer=path_integer, header_number=header_number, **kwargs) # noqa: E501 + return data + + def test_endpoint_enums_length_one_with_http_info(self, query_integer=None, query_string=None, path_string=None, path_integer=None, header_number=None, **kwargs): # noqa: E501 + """test_endpoint_enums_length_one # noqa: E501 + + This route has required values with enums of 1 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_endpoint_enums_length_one_with_http_info(async_req=True) + >>> result = thread.get() + + Args: + + query_integer (int): defaults to 3, must be one of [3] + query_string (str): defaults to 'brillig', must be one of ['brillig'] + path_string (str): defaults to 'hello', must be one of ['hello'] + path_integer (int): defaults to 34, must be one of [34] + header_number (float): defaults to 1.234, must be one of [1.234] + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: + """ + + local_var_params = locals() + + all_params = ['query_integer', 'query_string', 'path_string', 'path_integer', 'header_number'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method test_endpoint_enums_length_one" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'query_integer' is set + if ('query_integer' not in local_var_params or + local_var_params['query_integer'] is None): + raise ApiValueError("Missing the required parameter `query_integer` when calling `test_endpoint_enums_length_one`") # noqa: E501 + # verify the required parameter 'query_string' is set + if ('query_string' not in local_var_params or + local_var_params['query_string'] is None): + raise ApiValueError("Missing the required parameter `query_string` when calling `test_endpoint_enums_length_one`") # noqa: E501 + # verify the required parameter 'path_string' is set + if ('path_string' not in local_var_params or + local_var_params['path_string'] is None): + raise ApiValueError("Missing the required parameter `path_string` when calling `test_endpoint_enums_length_one`") # noqa: E501 + # verify the required parameter 'path_integer' is set + if ('path_integer' not in local_var_params or + local_var_params['path_integer'] is None): + raise ApiValueError("Missing the required parameter `path_integer` when calling `test_endpoint_enums_length_one`") # noqa: E501 + # verify the required parameter 'header_number' is set + if ('header_number' not in local_var_params or + local_var_params['header_number'] is None): + raise ApiValueError("Missing the required parameter `header_number` when calling `test_endpoint_enums_length_one`") # noqa: E501 + allowed_values = [3] # noqa: E501 + if ('query_integer' in local_var_params and + local_var_params['query_integer'] not in allowed_values): + raise ValueError( + "Invalid value for `query_integer` ({0}), must be one of {1}" # noqa: E501 + .format(local_var_params['query_integer'], allowed_values) + ) + allowed_values = ["brillig"] # noqa: E501 + if ('query_string' in local_var_params and + local_var_params['query_string'] not in allowed_values): + raise ValueError( + "Invalid value for `query_string` ({0}), must be one of {1}" # noqa: E501 + .format(local_var_params['query_string'], allowed_values) + ) + allowed_values = ["hello"] # noqa: E501 + if ('path_string' in local_var_params and + local_var_params['path_string'] not in allowed_values): + raise ValueError( + "Invalid value for `path_string` ({0}), must be one of {1}" # noqa: E501 + .format(local_var_params['path_string'], allowed_values) + ) + allowed_values = [34] # noqa: E501 + if ('path_integer' in local_var_params and + local_var_params['path_integer'] not in allowed_values): + raise ValueError( + "Invalid value for `path_integer` ({0}), must be one of {1}" # noqa: E501 + .format(local_var_params['path_integer'], allowed_values) + ) + allowed_values = [1.234] # noqa: E501 + if ('header_number' in local_var_params and + local_var_params['header_number'] not in allowed_values): + raise ValueError( + "Invalid value for `header_number` ({0}), must be one of {1}" # noqa: E501 + .format(local_var_params['header_number'], allowed_values) + ) + + collection_formats = {} + + path_params = {} + if 'path_string' in local_var_params: + path_params['path_string'] = local_var_params['path_string'] # noqa: E501 + if 'path_integer' in local_var_params: + path_params['path_integer'] = local_var_params['path_integer'] # noqa: E501 + + query_params = [] + if 'query_integer' in local_var_params: + query_params.append(('query_integer', local_var_params['query_integer'])) # noqa: E501 + if 'query_string' in local_var_params: + query_params.append(('query_string', local_var_params['query_string'])) # noqa: E501 + + header_params = {} + if 'header_number' in local_var_params: + header_params['header_number'] = local_var_params['header_number'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/enums-of-length-one/{path_string}/{path_integer}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + def test_endpoint_parameters(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 @@ -903,34 +1146,38 @@ class FakeApi(object): >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param float number: None (required) - :param float double: None (required) - :param str pattern_without_delimiter: None (required) - :param str byte: None (required) - :param int integer: None - :param int int32: None - :param int int64: None - :param float float: None - :param str string: None - :param file binary: None - :param date date: None - :param datetime date_time: None - :param str password: None - :param str param_callback: None - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + number (float): None double (float): None pattern_without_delimiter (str): None byte (str): None + + Keyword Args: + integer (int): None. [optional] + int32 (int): None. [optional] + int64 (int): None. [optional] + float (float): None. [optional] + string (str): None. [optional] + binary (file): None. [optional] + date (date): None. [optional] + date_time (datetime): None. [optional] + password (str): None. [optional] + param_callback (str): None. [optional] + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ kwargs['_return_http_data_only'] = True - return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501 + else: + (data) = self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, **kwargs) # noqa: E501 + return data def test_endpoint_parameters_with_http_info(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 @@ -941,33 +1188,31 @@ class FakeApi(object): >>> thread = api.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param float number: None (required) - :param float double: None (required) - :param str pattern_without_delimiter: None (required) - :param str byte: None (required) - :param int integer: None - :param int int32: None - :param int int64: None - :param float float: None - :param str string: None - :param file binary: None - :param date date: None - :param datetime date_time: None - :param str password: None - :param str param_callback: None - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + number (float): None double (float): None pattern_without_delimiter (str): None byte (str): None + + Keyword Args: + integer (int): None. [optional] + int32 (int): None. [optional] + int64 (int): None. [optional] + float (float): None. [optional] + string (str): None. [optional] + binary (file): None. [optional] + date (date): None. [optional] + date_time (datetime): None. [optional] + password (str): None. [optional] + param_callback (str): None. [optional] + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ local_var_params = locals() @@ -1002,7 +1247,6 @@ class FakeApi(object): if ('byte' not in local_var_params or local_var_params['byte'] is None): raise ApiValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`") # noqa: E501 - if 'number' in local_var_params and local_var_params['number'] > 543.2: # noqa: E501 raise ApiValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value less than or equal to `543.2`") # noqa: E501 if 'number' in local_var_params and local_var_params['number'] < 32.1: # noqa: E501 @@ -1031,6 +1275,7 @@ class FakeApi(object): if ('password' in local_var_params and len(local_var_params['password']) < 10): raise ApiValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be greater than or equal to `10`") # noqa: E501 + collection_formats = {} path_params = {} @@ -1103,28 +1348,35 @@ class FakeApi(object): >>> thread = api.test_enum_parameters(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param list[str] enum_header_string_array: Header parameter enum test (string array) - :param str enum_header_string: Header parameter enum test (string) - :param list[str] enum_query_string_array: Query parameter enum test (string array) - :param str enum_query_string: Query parameter enum test (string) - :param int enum_query_integer: Query parameter enum test (double) - :param float enum_query_double: Query parameter enum test (double) - :param list[str] enum_form_string_array: Form parameter enum test (string array) - :param str enum_form_string: Form parameter enum test (string) - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + + + Keyword Args: + enum_header_string_array (list[str]): Header parameter enum test (string array). [optional] + enum_header_string (str): Header parameter enum test (string). [optional] if omitted the server will use the default value of '-efg' + enum_query_string_array (list[str]): Query parameter enum test (string array). [optional] + enum_query_string (str): Query parameter enum test (string). [optional] if omitted the server will use the default value of '-efg' + enum_query_integer (int): Query parameter enum test (double). [optional] + enum_query_double (float): Query parameter enum test (double). [optional] + enum_form_string_array (list[str]): Form parameter enum test (string array). [optional] if omitted the server will use the default value of '$' + enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of '-efg' + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ kwargs['_return_http_data_only'] = True - return self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.test_enum_parameters_with_http_info(**kwargs) # noqa: E501 + return data def test_enum_parameters_with_http_info(self, **kwargs): # noqa: E501 """To test enum parameters # noqa: E501 @@ -1135,27 +1387,28 @@ class FakeApi(object): >>> thread = api.test_enum_parameters_with_http_info(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param list[str] enum_header_string_array: Header parameter enum test (string array) - :param str enum_header_string: Header parameter enum test (string) - :param list[str] enum_query_string_array: Query parameter enum test (string array) - :param str enum_query_string: Query parameter enum test (string) - :param int enum_query_integer: Query parameter enum test (double) - :param float enum_query_double: Query parameter enum test (double) - :param list[str] enum_form_string_array: Form parameter enum test (string array) - :param str enum_form_string: Form parameter enum test (string) - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + + + Keyword Args: + enum_header_string_array (list[str]): Header parameter enum test (string array). [optional] + enum_header_string (str): Header parameter enum test (string). [optional] if omitted the server will use the default value of '-efg' + enum_query_string_array (list[str]): Query parameter enum test (string array). [optional] + enum_query_string (str): Query parameter enum test (string). [optional] if omitted the server will use the default value of '-efg' + enum_query_integer (int): Query parameter enum test (double). [optional] + enum_query_double (float): Query parameter enum test (double). [optional] + enum_form_string_array (list[str]): Form parameter enum test (string array). [optional] if omitted the server will use the default value of '$' + enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of '-efg' + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ local_var_params = locals() @@ -1174,6 +1427,65 @@ class FakeApi(object): ) local_var_params[key] = val del local_var_params['kwargs'] + allowed_values = [">", "$"] # noqa: E501 + if ('enum_header_string_array' in local_var_params and + not set(local_var_params['enum_header_string_array']).issubset(set(allowed_values))): # noqa: E501 + raise ValueError( + "Invalid values for `enum_header_string_array` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(local_var_params['enum_header_string_array']) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + allowed_values = ["_abc", "-efg", "(xyz)"] # noqa: E501 + if ('enum_header_string' in local_var_params and + local_var_params['enum_header_string'] not in allowed_values): + raise ValueError( + "Invalid value for `enum_header_string` ({0}), must be one of {1}" # noqa: E501 + .format(local_var_params['enum_header_string'], allowed_values) + ) + allowed_values = [">", "$"] # noqa: E501 + if ('enum_query_string_array' in local_var_params and + not set(local_var_params['enum_query_string_array']).issubset(set(allowed_values))): # noqa: E501 + raise ValueError( + "Invalid values for `enum_query_string_array` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(local_var_params['enum_query_string_array']) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + allowed_values = ["_abc", "-efg", "(xyz)"] # noqa: E501 + if ('enum_query_string' in local_var_params and + local_var_params['enum_query_string'] not in allowed_values): + raise ValueError( + "Invalid value for `enum_query_string` ({0}), must be one of {1}" # noqa: E501 + .format(local_var_params['enum_query_string'], allowed_values) + ) + allowed_values = [1, -2] # noqa: E501 + if ('enum_query_integer' in local_var_params and + local_var_params['enum_query_integer'] not in allowed_values): + raise ValueError( + "Invalid value for `enum_query_integer` ({0}), must be one of {1}" # noqa: E501 + .format(local_var_params['enum_query_integer'], allowed_values) + ) + allowed_values = [1.1, -1.2] # noqa: E501 + if ('enum_query_double' in local_var_params and + local_var_params['enum_query_double'] not in allowed_values): + raise ValueError( + "Invalid value for `enum_query_double` ({0}), must be one of {1}" # noqa: E501 + .format(local_var_params['enum_query_double'], allowed_values) + ) + allowed_values = [">", "$"] # noqa: E501 + if ('enum_form_string_array' in local_var_params and + not set(local_var_params['enum_form_string_array']).issubset(set(allowed_values))): # noqa: E501 + raise ValueError( + "Invalid values for `enum_form_string_array` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(local_var_params['enum_form_string_array']) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + allowed_values = ["_abc", "-efg", "(xyz)"] # noqa: E501 + if ('enum_form_string' in local_var_params and + local_var_params['enum_form_string'] not in allowed_values): + raise ValueError( + "Invalid value for `enum_form_string` ({0}), must be one of {1}" # noqa: E501 + .format(local_var_params['enum_form_string'], allowed_values) + ) collection_formats = {} @@ -1238,26 +1550,31 @@ class FakeApi(object): >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param int required_string_group: Required String in group parameters (required) - :param bool required_boolean_group: Required Boolean in group parameters (required) - :param int required_int64_group: Required Integer in group parameters (required) - :param int string_group: String in group parameters - :param bool boolean_group: Boolean in group parameters - :param int int64_group: Integer in group parameters - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + required_string_group (int): Required String in group parameters required_boolean_group (bool): Required Boolean in group parameters required_int64_group (int): Required Integer in group parameters + + Keyword Args: + string_group (int): String in group parameters. [optional] + boolean_group (bool): Boolean in group parameters. [optional] + int64_group (int): Integer in group parameters. [optional] + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ kwargs['_return_http_data_only'] = True - return self.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, **kwargs) # noqa: E501 + else: + (data) = self.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, **kwargs) # noqa: E501 + return data def test_group_parameters_with_http_info(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501 """Fake endpoint to test group parameters (optional) # noqa: E501 @@ -1268,25 +1585,24 @@ class FakeApi(object): >>> thread = api.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param int required_string_group: Required String in group parameters (required) - :param bool required_boolean_group: Required Boolean in group parameters (required) - :param int required_int64_group: Required Integer in group parameters (required) - :param int string_group: String in group parameters - :param bool boolean_group: Boolean in group parameters - :param int int64_group: Integer in group parameters - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + required_string_group (int): Required String in group parameters required_boolean_group (bool): Required Boolean in group parameters required_int64_group (int): Required Integer in group parameters + + Keyword Args: + string_group (int): String in group parameters. [optional] + boolean_group (bool): Boolean in group parameters. [optional] + int64_group (int): Integer in group parameters. [optional] + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ local_var_params = locals() @@ -1369,21 +1685,28 @@ class FakeApi(object): >>> thread = api.test_inline_additional_properties(param, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param dict(str, str) param: request body (required) - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + param (dict(str, str)): request body + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ kwargs['_return_http_data_only'] = True - return self.test_inline_additional_properties_with_http_info(param, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.test_inline_additional_properties_with_http_info(param, **kwargs) # noqa: E501 + else: + (data) = self.test_inline_additional_properties_with_http_info(param, **kwargs) # noqa: E501 + return data def test_inline_additional_properties_with_http_info(self, param, **kwargs): # noqa: E501 """test inline additionalProperties # noqa: E501 @@ -1393,20 +1716,21 @@ class FakeApi(object): >>> thread = api.test_inline_additional_properties_with_http_info(param, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param dict(str, str) param: request body (required) - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + param (dict(str, str)): request body + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ local_var_params = locals() @@ -1475,22 +1799,28 @@ class FakeApi(object): >>> thread = api.test_json_form_data(param, param2, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param str param: field1 (required) - :param str param2: field2 (required) - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + param (str): field1 param2 (str): field2 + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ kwargs['_return_http_data_only'] = True - return self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501 + else: + (data) = self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501 + return data def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: E501 """test json serialization of form data # noqa: E501 @@ -1500,21 +1830,21 @@ class FakeApi(object): >>> thread = api.test_json_form_data_with_http_info(param, param2, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param str param: field1 (required) - :param str param2: field2 (required) - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + param (str): field1 param2 (str): field2 + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ local_var_params = locals() diff --git a/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py index 3e778e92268..f054a0a8ec7 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py @@ -18,7 +18,7 @@ import re # noqa: F401 import six from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( +from petstore_api.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError ) @@ -45,21 +45,28 @@ class FakeClassnameTags123Api(object): >>> thread = api.test_classname(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param Client body: client model (required) - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Client - If the method is called asynchronously, - returns the request thread. + Args: + body (Client): client model + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + Client: """ kwargs['_return_http_data_only'] = True - return self.test_classname_with_http_info(body, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.test_classname_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.test_classname_with_http_info(body, **kwargs) # noqa: E501 + return data def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 """To test class name in snake case # noqa: E501 @@ -70,20 +77,21 @@ class FakeClassnameTags123Api(object): >>> thread = api.test_classname_with_http_info(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param Client body: client model (required) - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: tuple(Client, status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. + Args: + body (Client): client model + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + Client: """ local_var_params = locals() diff --git a/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py b/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py index 1deb664c43e..bd1b58aa9ee 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py @@ -18,7 +18,7 @@ import re # noqa: F401 import six from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( +from petstore_api.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError ) @@ -44,21 +44,28 @@ class PetApi(object): >>> thread = api.add_pet(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param Pet body: Pet object that needs to be added to the store (required) - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + body (Pet): Pet object that needs to be added to the store + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ kwargs['_return_http_data_only'] = True - return self.add_pet_with_http_info(body, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.add_pet_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.add_pet_with_http_info(body, **kwargs) # noqa: E501 + return data def add_pet_with_http_info(self, body, **kwargs): # noqa: E501 """Add a new pet to the store # noqa: E501 @@ -68,20 +75,21 @@ class PetApi(object): >>> thread = api.add_pet_with_http_info(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param Pet body: Pet object that needs to be added to the store (required) - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + body (Pet): Pet object that needs to be added to the store + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ local_var_params = locals() @@ -150,22 +158,29 @@ class PetApi(object): >>> thread = api.delete_pet(pet_id, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param int pet_id: Pet id to delete (required) - :param str api_key: - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + pet_id (int): Pet id to delete + + Keyword Args: + api_key (str): [optional] + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ kwargs['_return_http_data_only'] = True - return self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501 + else: + (data) = self.delete_pet_with_http_info(pet_id, **kwargs) # noqa: E501 + return data def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501 """Deletes a pet # noqa: E501 @@ -175,21 +190,22 @@ class PetApi(object): >>> thread = api.delete_pet_with_http_info(pet_id, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param int pet_id: Pet id to delete (required) - :param str api_key: - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + pet_id (int): Pet id to delete + + Keyword Args: + api_key (str): [optional] + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ local_var_params = locals() @@ -257,21 +273,28 @@ class PetApi(object): >>> thread = api.find_pets_by_status(status, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param list[str] status: Status values that need to be considered for filter (required) - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: list[Pet] - If the method is called asynchronously, - returns the request thread. + Args: + status (list[str]): Status values that need to be considered for filter + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + list[Pet]: """ kwargs['_return_http_data_only'] = True - return self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501 + else: + (data) = self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501 + return data def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501 """Finds Pets by status # noqa: E501 @@ -282,20 +305,21 @@ class PetApi(object): >>> thread = api.find_pets_by_status_with_http_info(status, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param list[str] status: Status values that need to be considered for filter (required) - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: tuple(list[Pet], status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. + Args: + status (list[str]): Status values that need to be considered for filter + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + list[Pet]: """ local_var_params = locals() @@ -318,6 +342,14 @@ class PetApi(object): if ('status' not in local_var_params or local_var_params['status'] is None): raise ApiValueError("Missing the required parameter `status` when calling `find_pets_by_status`") # noqa: E501 + allowed_values = ["available", "pending", "sold"] # noqa: E501 + if ('status' in local_var_params and + not set(local_var_params['status']).issubset(set(allowed_values))): # noqa: E501 + raise ValueError( + "Invalid values for `status` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(local_var_params['status']) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) collection_formats = {} @@ -366,21 +398,28 @@ class PetApi(object): >>> thread = api.find_pets_by_tags(tags, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param list[str] tags: Tags to filter by (required) - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: list[Pet] - If the method is called asynchronously, - returns the request thread. + Args: + tags (list[str]): Tags to filter by + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + list[Pet]: """ kwargs['_return_http_data_only'] = True - return self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501 + else: + (data) = self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501 + return data def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501 """Finds Pets by tags # noqa: E501 @@ -391,20 +430,21 @@ class PetApi(object): >>> thread = api.find_pets_by_tags_with_http_info(tags, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param list[str] tags: Tags to filter by (required) - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: tuple(list[Pet], status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. + Args: + tags (list[str]): Tags to filter by + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + list[Pet]: """ local_var_params = locals() @@ -475,21 +515,28 @@ class PetApi(object): >>> thread = api.get_pet_by_id(pet_id, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param int pet_id: ID of pet to return (required) - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Pet - If the method is called asynchronously, - returns the request thread. + Args: + pet_id (int): ID of pet to return + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + Pet: """ kwargs['_return_http_data_only'] = True - return self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501 + else: + (data) = self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501 + return data def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501 """Find pet by ID # noqa: E501 @@ -500,20 +547,21 @@ class PetApi(object): >>> thread = api.get_pet_by_id_with_http_info(pet_id, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param int pet_id: ID of pet to return (required) - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: tuple(Pet, status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. + Args: + pet_id (int): ID of pet to return + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + Pet: """ local_var_params = locals() @@ -582,21 +630,28 @@ class PetApi(object): >>> thread = api.update_pet(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param Pet body: Pet object that needs to be added to the store (required) - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + body (Pet): Pet object that needs to be added to the store + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ kwargs['_return_http_data_only'] = True - return self.update_pet_with_http_info(body, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.update_pet_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.update_pet_with_http_info(body, **kwargs) # noqa: E501 + return data def update_pet_with_http_info(self, body, **kwargs): # noqa: E501 """Update an existing pet # noqa: E501 @@ -606,20 +661,21 @@ class PetApi(object): >>> thread = api.update_pet_with_http_info(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param Pet body: Pet object that needs to be added to the store (required) - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + body (Pet): Pet object that needs to be added to the store + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ local_var_params = locals() @@ -688,23 +744,30 @@ class PetApi(object): >>> thread = api.update_pet_with_form(pet_id, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param int pet_id: ID of pet that needs to be updated (required) - :param str name: Updated name of the pet - :param str status: Updated status of the pet - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + pet_id (int): ID of pet that needs to be updated + + Keyword Args: + name (str): Updated name of the pet. [optional] + status (str): Updated status of the pet. [optional] + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ kwargs['_return_http_data_only'] = True - return self.update_pet_with_form_with_http_info(pet_id, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.update_pet_with_form_with_http_info(pet_id, **kwargs) # noqa: E501 + else: + (data) = self.update_pet_with_form_with_http_info(pet_id, **kwargs) # noqa: E501 + return data def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501 """Updates a pet in the store with form data # noqa: E501 @@ -714,22 +777,23 @@ class PetApi(object): >>> thread = api.update_pet_with_form_with_http_info(pet_id, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param int pet_id: ID of pet that needs to be updated (required) - :param str name: Updated name of the pet - :param str status: Updated status of the pet - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + pet_id (int): ID of pet that needs to be updated + + Keyword Args: + name (str): Updated name of the pet. [optional] + status (str): Updated status of the pet. [optional] + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ local_var_params = locals() @@ -802,23 +866,30 @@ class PetApi(object): >>> thread = api.upload_file(pet_id, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param int pet_id: ID of pet to update (required) - :param str additional_metadata: Additional data to pass to server - :param file file: file to upload - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: ApiResponse - If the method is called asynchronously, - returns the request thread. + Args: + pet_id (int): ID of pet to update + + Keyword Args: + additional_metadata (str): Additional data to pass to server. [optional] + file (file): file to upload. [optional] + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + ApiResponse: """ kwargs['_return_http_data_only'] = True - return self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501 + else: + (data) = self.upload_file_with_http_info(pet_id, **kwargs) # noqa: E501 + return data def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 """uploads an image # noqa: E501 @@ -828,22 +899,23 @@ class PetApi(object): >>> thread = api.upload_file_with_http_info(pet_id, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param int pet_id: ID of pet to update (required) - :param str additional_metadata: Additional data to pass to server - :param file file: file to upload - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: tuple(ApiResponse, status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. + Args: + pet_id (int): ID of pet to update + + Keyword Args: + additional_metadata (str): Additional data to pass to server. [optional] + file (file): file to upload. [optional] + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + ApiResponse: """ local_var_params = locals() @@ -920,23 +992,29 @@ class PetApi(object): >>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param int pet_id: ID of pet to update (required) - :param file required_file: file to upload (required) - :param str additional_metadata: Additional data to pass to server - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: ApiResponse - If the method is called asynchronously, - returns the request thread. + Args: + pet_id (int): ID of pet to update required_file (file): file to upload + + Keyword Args: + additional_metadata (str): Additional data to pass to server. [optional] + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + ApiResponse: """ kwargs['_return_http_data_only'] = True - return self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501 + else: + (data) = self.upload_file_with_required_file_with_http_info(pet_id, required_file, **kwargs) # noqa: E501 + return data def upload_file_with_required_file_with_http_info(self, pet_id, required_file, **kwargs): # noqa: E501 """uploads an image (required) # noqa: E501 @@ -946,22 +1024,22 @@ class PetApi(object): >>> thread = api.upload_file_with_required_file_with_http_info(pet_id, required_file, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param int pet_id: ID of pet to update (required) - :param file required_file: file to upload (required) - :param str additional_metadata: Additional data to pass to server - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: tuple(ApiResponse, status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. + Args: + pet_id (int): ID of pet to update required_file (file): file to upload + + Keyword Args: + additional_metadata (str): Additional data to pass to server. [optional] + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + ApiResponse: """ local_var_params = locals() diff --git a/samples/client/petstore/python-experimental/petstore_api/api/store_api.py b/samples/client/petstore/python-experimental/petstore_api/api/store_api.py index c3aa1c4a3d5..c80423baf48 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/store_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/store_api.py @@ -18,7 +18,7 @@ import re # noqa: F401 import six from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( +from petstore_api.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError ) @@ -45,21 +45,28 @@ class StoreApi(object): >>> thread = api.delete_order(order_id, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param str order_id: ID of the order that needs to be deleted (required) - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + order_id (str): ID of the order that needs to be deleted + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ kwargs['_return_http_data_only'] = True - return self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501 + else: + (data) = self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501 + return data def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501 """Delete purchase order by ID # noqa: E501 @@ -70,20 +77,21 @@ class StoreApi(object): >>> thread = api.delete_order_with_http_info(order_id, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param str order_id: ID of the order that needs to be deleted (required) - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + order_id (str): ID of the order that needs to be deleted + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ local_var_params = locals() @@ -149,20 +157,27 @@ class StoreApi(object): >>> thread = api.get_inventory(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: dict(str, int) - If the method is called asynchronously, - returns the request thread. + + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + dict(str, int): """ kwargs['_return_http_data_only'] = True - return self.get_inventory_with_http_info(**kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.get_inventory_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_inventory_with_http_info(**kwargs) # noqa: E501 + return data def get_inventory_with_http_info(self, **kwargs): # noqa: E501 """Returns pet inventories by status # noqa: E501 @@ -173,19 +188,20 @@ class StoreApi(object): >>> thread = api.get_inventory_with_http_info(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: tuple(dict(str, int), status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. + + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + dict(str, int): """ local_var_params = locals() @@ -249,21 +265,28 @@ class StoreApi(object): >>> thread = api.get_order_by_id(order_id, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param int order_id: ID of pet that needs to be fetched (required) - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Order - If the method is called asynchronously, - returns the request thread. + Args: + order_id (int): ID of pet that needs to be fetched + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + Order: """ kwargs['_return_http_data_only'] = True - return self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501 + else: + (data) = self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501 + return data def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501 """Find purchase order by ID # noqa: E501 @@ -274,20 +297,21 @@ class StoreApi(object): >>> thread = api.get_order_by_id_with_http_info(order_id, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param int order_id: ID of pet that needs to be fetched (required) - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: tuple(Order, status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. + Args: + order_id (int): ID of pet that needs to be fetched + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + Order: """ local_var_params = locals() @@ -310,11 +334,11 @@ class StoreApi(object): if ('order_id' not in local_var_params or local_var_params['order_id'] is None): raise ApiValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") # noqa: E501 - if 'order_id' in local_var_params and local_var_params['order_id'] > 5: # noqa: E501 raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value less than or equal to `5`") # noqa: E501 if 'order_id' in local_var_params and local_var_params['order_id'] < 1: # noqa: E501 raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} path_params = {} @@ -360,21 +384,28 @@ class StoreApi(object): >>> thread = api.place_order(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param Order body: order placed for purchasing the pet (required) - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Order - If the method is called asynchronously, - returns the request thread. + Args: + body (Order): order placed for purchasing the pet + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + Order: """ kwargs['_return_http_data_only'] = True - return self.place_order_with_http_info(body, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.place_order_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.place_order_with_http_info(body, **kwargs) # noqa: E501 + return data def place_order_with_http_info(self, body, **kwargs): # noqa: E501 """Place an order for a pet # noqa: E501 @@ -384,20 +415,21 @@ class StoreApi(object): >>> thread = api.place_order_with_http_info(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param Order body: order placed for purchasing the pet (required) - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: tuple(Order, status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. + Args: + body (Order): order placed for purchasing the pet + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + Order: """ local_var_params = locals() diff --git a/samples/client/petstore/python-experimental/petstore_api/api/user_api.py b/samples/client/petstore/python-experimental/petstore_api/api/user_api.py index d3674f5ba5c..c8de4c6c277 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/user_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/user_api.py @@ -18,7 +18,7 @@ import re # noqa: F401 import six from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( +from petstore_api.exceptions import ( # noqa: F401 ApiTypeError, ApiValueError ) @@ -45,21 +45,28 @@ class UserApi(object): >>> thread = api.create_user(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param User body: Created user object (required) - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + body (User): Created user object + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ kwargs['_return_http_data_only'] = True - return self.create_user_with_http_info(body, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.create_user_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.create_user_with_http_info(body, **kwargs) # noqa: E501 + return data def create_user_with_http_info(self, body, **kwargs): # noqa: E501 """Create user # noqa: E501 @@ -70,20 +77,21 @@ class UserApi(object): >>> thread = api.create_user_with_http_info(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param User body: Created user object (required) - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + body (User): Created user object + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ local_var_params = locals() @@ -148,21 +156,28 @@ class UserApi(object): >>> thread = api.create_users_with_array_input(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param list[User] body: List of user object (required) - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + body (list[User]): List of user object + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ kwargs['_return_http_data_only'] = True - return self.create_users_with_array_input_with_http_info(body, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.create_users_with_array_input_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.create_users_with_array_input_with_http_info(body, **kwargs) # noqa: E501 + return data def create_users_with_array_input_with_http_info(self, body, **kwargs): # noqa: E501 """Creates list of users with given input array # noqa: E501 @@ -172,20 +187,21 @@ class UserApi(object): >>> thread = api.create_users_with_array_input_with_http_info(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param list[User] body: List of user object (required) - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + body (list[User]): List of user object + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ local_var_params = locals() @@ -250,21 +266,28 @@ class UserApi(object): >>> thread = api.create_users_with_list_input(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param list[User] body: List of user object (required) - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + body (list[User]): List of user object + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ kwargs['_return_http_data_only'] = True - return self.create_users_with_list_input_with_http_info(body, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.create_users_with_list_input_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.create_users_with_list_input_with_http_info(body, **kwargs) # noqa: E501 + return data def create_users_with_list_input_with_http_info(self, body, **kwargs): # noqa: E501 """Creates list of users with given input array # noqa: E501 @@ -274,20 +297,21 @@ class UserApi(object): >>> thread = api.create_users_with_list_input_with_http_info(body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param list[User] body: List of user object (required) - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + body (list[User]): List of user object + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ local_var_params = locals() @@ -353,21 +377,28 @@ class UserApi(object): >>> thread = api.delete_user(username, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param str username: The name that needs to be deleted (required) - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + username (str): The name that needs to be deleted + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ kwargs['_return_http_data_only'] = True - return self.delete_user_with_http_info(username, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.delete_user_with_http_info(username, **kwargs) # noqa: E501 + else: + (data) = self.delete_user_with_http_info(username, **kwargs) # noqa: E501 + return data def delete_user_with_http_info(self, username, **kwargs): # noqa: E501 """Delete user # noqa: E501 @@ -378,20 +409,21 @@ class UserApi(object): >>> thread = api.delete_user_with_http_info(username, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param str username: The name that needs to be deleted (required) - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + username (str): The name that needs to be deleted + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ local_var_params = locals() @@ -456,21 +488,28 @@ class UserApi(object): >>> thread = api.get_user_by_name(username, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param str username: The name that needs to be fetched. Use user1 for testing. (required) - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: User - If the method is called asynchronously, - returns the request thread. + Args: + username (str): The name that needs to be fetched. Use user1 for testing. + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + User: """ kwargs['_return_http_data_only'] = True - return self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501 + else: + (data) = self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501 + return data def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501 """Get user by user name # noqa: E501 @@ -480,20 +519,21 @@ class UserApi(object): >>> thread = api.get_user_by_name_with_http_info(username, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param str username: The name that needs to be fetched. Use user1 for testing. (required) - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: tuple(User, status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. + Args: + username (str): The name that needs to be fetched. Use user1 for testing. + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + User: """ local_var_params = locals() @@ -562,22 +602,28 @@ class UserApi(object): >>> thread = api.login_user(username, password, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param str username: The user name for login (required) - :param str password: The password for login in clear text (required) - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: str - If the method is called asynchronously, - returns the request thread. + Args: + username (str): The user name for login password (str): The password for login in clear text + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + str: """ kwargs['_return_http_data_only'] = True - return self.login_user_with_http_info(username, password, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.login_user_with_http_info(username, password, **kwargs) # noqa: E501 + else: + (data) = self.login_user_with_http_info(username, password, **kwargs) # noqa: E501 + return data def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501 """Logs user into the system # noqa: E501 @@ -587,21 +633,21 @@ class UserApi(object): >>> thread = api.login_user_with_http_info(username, password, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param str username: The user name for login (required) - :param str password: The password for login in clear text (required) - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: tuple(str, status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. + Args: + username (str): The user name for login password (str): The password for login in clear text + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + str: """ local_var_params = locals() @@ -676,20 +722,27 @@ class UserApi(object): >>> thread = api.logout_user(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ kwargs['_return_http_data_only'] = True - return self.logout_user_with_http_info(**kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.logout_user_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.logout_user_with_http_info(**kwargs) # noqa: E501 + return data def logout_user_with_http_info(self, **kwargs): # noqa: E501 """Logs out current logged in user session # noqa: E501 @@ -699,19 +752,20 @@ class UserApi(object): >>> thread = api.logout_user_with_http_info(async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ local_var_params = locals() @@ -771,22 +825,28 @@ class UserApi(object): >>> thread = api.update_user(username, body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param str username: name that need to be deleted (required) - :param User body: Updated user object (required) - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + username (str): name that need to be deleted body (User): Updated user object + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ kwargs['_return_http_data_only'] = True - return self.update_user_with_http_info(username, body, **kwargs) # noqa: E501 + if kwargs.get('async_req'): + return self.update_user_with_http_info(username, body, **kwargs) # noqa: E501 + else: + (data) = self.update_user_with_http_info(username, body, **kwargs) # noqa: E501 + return data def update_user_with_http_info(self, username, body, **kwargs): # noqa: E501 """Updated user # noqa: E501 @@ -797,21 +857,21 @@ class UserApi(object): >>> thread = api.update_user_with_http_info(username, body, async_req=True) >>> result = thread.get() - :param async_req bool: execute request asynchronously - :param str username: name that need to be deleted (required) - :param User body: Updated user object (required) - :param _return_http_data_only: response data without head status code - and headers - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: None - If the method is called asynchronously, - returns the request thread. + Args: + username (str): name that need to be deleted body (User): Updated user object + + Keyword Args: + async_req (bool): execute request asynchronously + param _preload_content (bool): if False, the urllib3.HTTPResponse + object will be returned without reading/decoding response data. + Default is True. + param _request_timeout (float/tuple): timeout setting for this + request. If one number provided, it will be total request + timeout. It can also be a pair (tuple) of (connection, read) + timeouts. + + Returns: + None: """ local_var_params = locals() diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_any_type.py b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_any_type.py index ed4f40068bf..ec5fa2a9a28 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_any_type.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_any_type.py @@ -31,21 +31,27 @@ class AdditionalPropertiesAnyType(object): and the value is json key in definition. """ openapi_types = { - 'name': 'str' + 'name': 'str', } attribute_map = { - 'name': 'name' + 'name': 'name', # noqa: E501 } def __init__(self, name=None): # noqa: E501 - """AdditionalPropertiesAnyType - a model defined in OpenAPI""" # noqa: E501 + """AdditionalPropertiesAnyType - a model defined in OpenAPI + + + + Keyword Args: + name (str): [optional] # noqa: E501 + """ self._name = None self.discriminator = None if name is not None: - self.name = name + self.name = name # noqa: E501 @property def name(self): @@ -58,7 +64,9 @@ class AdditionalPropertiesAnyType(object): return self._name @name.setter - def name(self, name): + def name( + self, + name): """Sets the name of this AdditionalPropertiesAnyType. @@ -66,7 +74,8 @@ class AdditionalPropertiesAnyType(object): :type: str """ - self._name = name + self._name = ( + name) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_array.py b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_array.py index 22b4133f367..e04ae6f4c04 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_array.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_array.py @@ -31,21 +31,27 @@ class AdditionalPropertiesArray(object): and the value is json key in definition. """ openapi_types = { - 'name': 'str' + 'name': 'str', } attribute_map = { - 'name': 'name' + 'name': 'name', # noqa: E501 } def __init__(self, name=None): # noqa: E501 - """AdditionalPropertiesArray - a model defined in OpenAPI""" # noqa: E501 + """AdditionalPropertiesArray - a model defined in OpenAPI + + + + Keyword Args: + name (str): [optional] # noqa: E501 + """ self._name = None self.discriminator = None if name is not None: - self.name = name + self.name = name # noqa: E501 @property def name(self): @@ -58,7 +64,9 @@ class AdditionalPropertiesArray(object): return self._name @name.setter - def name(self, name): + def name( + self, + name): """Sets the name of this AdditionalPropertiesArray. @@ -66,7 +74,8 @@ class AdditionalPropertiesArray(object): :type: str """ - self._name = name + self._name = ( + name) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_boolean.py b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_boolean.py index 24e2fc178ab..f5e7dc23d23 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_boolean.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_boolean.py @@ -31,21 +31,27 @@ class AdditionalPropertiesBoolean(object): and the value is json key in definition. """ openapi_types = { - 'name': 'str' + 'name': 'str', } attribute_map = { - 'name': 'name' + 'name': 'name', # noqa: E501 } def __init__(self, name=None): # noqa: E501 - """AdditionalPropertiesBoolean - a model defined in OpenAPI""" # noqa: E501 + """AdditionalPropertiesBoolean - a model defined in OpenAPI + + + + Keyword Args: + name (str): [optional] # noqa: E501 + """ self._name = None self.discriminator = None if name is not None: - self.name = name + self.name = name # noqa: E501 @property def name(self): @@ -58,7 +64,9 @@ class AdditionalPropertiesBoolean(object): return self._name @name.setter - def name(self, name): + def name( + self, + name): """Sets the name of this AdditionalPropertiesBoolean. @@ -66,7 +74,8 @@ class AdditionalPropertiesBoolean(object): :type: str """ - self._name = name + self._name = ( + name) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py index e9e9307d1b7..d5082c17ce4 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py @@ -41,25 +41,41 @@ class AdditionalPropertiesClass(object): 'map_map_anytype': 'dict(str, dict(str, object))', 'anytype_1': 'object', 'anytype_2': 'object', - 'anytype_3': 'object' + 'anytype_3': 'object', } attribute_map = { - 'map_string': 'map_string', - 'map_number': 'map_number', - 'map_integer': 'map_integer', - 'map_boolean': 'map_boolean', - 'map_array_integer': 'map_array_integer', - 'map_array_anytype': 'map_array_anytype', - 'map_map_string': 'map_map_string', - 'map_map_anytype': 'map_map_anytype', - 'anytype_1': 'anytype_1', - 'anytype_2': 'anytype_2', - 'anytype_3': 'anytype_3' + 'map_string': 'map_string', # noqa: E501 + 'map_number': 'map_number', # noqa: E501 + 'map_integer': 'map_integer', # noqa: E501 + 'map_boolean': 'map_boolean', # noqa: E501 + 'map_array_integer': 'map_array_integer', # noqa: E501 + 'map_array_anytype': 'map_array_anytype', # noqa: E501 + 'map_map_string': 'map_map_string', # noqa: E501 + 'map_map_anytype': 'map_map_anytype', # noqa: E501 + 'anytype_1': 'anytype_1', # noqa: E501 + 'anytype_2': 'anytype_2', # noqa: E501 + 'anytype_3': 'anytype_3', # noqa: E501 } def __init__(self, map_string=None, map_number=None, map_integer=None, map_boolean=None, map_array_integer=None, map_array_anytype=None, map_map_string=None, map_map_anytype=None, anytype_1=None, anytype_2=None, anytype_3=None): # noqa: E501 - """AdditionalPropertiesClass - a model defined in OpenAPI""" # noqa: E501 + """AdditionalPropertiesClass - a model defined in OpenAPI + + + + Keyword Args: + map_string (dict(str, str)): [optional] # noqa: E501 + map_number (dict(str, float)): [optional] # noqa: E501 + map_integer (dict(str, int)): [optional] # noqa: E501 + map_boolean (dict(str, bool)): [optional] # noqa: E501 + map_array_integer (dict(str, list[int])): [optional] # noqa: E501 + map_array_anytype (dict(str, list[object])): [optional] # noqa: E501 + map_map_string (dict(str, dict(str, str))): [optional] # noqa: E501 + map_map_anytype (dict(str, dict(str, object))): [optional] # noqa: E501 + anytype_1 (object): [optional] # noqa: E501 + anytype_2 (object): [optional] # noqa: E501 + anytype_3 (object): [optional] # noqa: E501 + """ self._map_string = None self._map_number = None @@ -75,27 +91,27 @@ class AdditionalPropertiesClass(object): self.discriminator = None if map_string is not None: - self.map_string = map_string + self.map_string = map_string # noqa: E501 if map_number is not None: - self.map_number = map_number + self.map_number = map_number # noqa: E501 if map_integer is not None: - self.map_integer = map_integer + self.map_integer = map_integer # noqa: E501 if map_boolean is not None: - self.map_boolean = map_boolean + self.map_boolean = map_boolean # noqa: E501 if map_array_integer is not None: - self.map_array_integer = map_array_integer + self.map_array_integer = map_array_integer # noqa: E501 if map_array_anytype is not None: - self.map_array_anytype = map_array_anytype + self.map_array_anytype = map_array_anytype # noqa: E501 if map_map_string is not None: - self.map_map_string = map_map_string + self.map_map_string = map_map_string # noqa: E501 if map_map_anytype is not None: - self.map_map_anytype = map_map_anytype + self.map_map_anytype = map_map_anytype # noqa: E501 if anytype_1 is not None: - self.anytype_1 = anytype_1 + self.anytype_1 = anytype_1 # noqa: E501 if anytype_2 is not None: - self.anytype_2 = anytype_2 + self.anytype_2 = anytype_2 # noqa: E501 if anytype_3 is not None: - self.anytype_3 = anytype_3 + self.anytype_3 = anytype_3 # noqa: E501 @property def map_string(self): @@ -108,7 +124,9 @@ class AdditionalPropertiesClass(object): return self._map_string @map_string.setter - def map_string(self, map_string): + def map_string( + self, + map_string): """Sets the map_string of this AdditionalPropertiesClass. @@ -116,7 +134,8 @@ class AdditionalPropertiesClass(object): :type: dict(str, str) """ - self._map_string = map_string + self._map_string = ( + map_string) @property def map_number(self): @@ -129,7 +148,9 @@ class AdditionalPropertiesClass(object): return self._map_number @map_number.setter - def map_number(self, map_number): + def map_number( + self, + map_number): """Sets the map_number of this AdditionalPropertiesClass. @@ -137,7 +158,8 @@ class AdditionalPropertiesClass(object): :type: dict(str, float) """ - self._map_number = map_number + self._map_number = ( + map_number) @property def map_integer(self): @@ -150,7 +172,9 @@ class AdditionalPropertiesClass(object): return self._map_integer @map_integer.setter - def map_integer(self, map_integer): + def map_integer( + self, + map_integer): """Sets the map_integer of this AdditionalPropertiesClass. @@ -158,7 +182,8 @@ class AdditionalPropertiesClass(object): :type: dict(str, int) """ - self._map_integer = map_integer + self._map_integer = ( + map_integer) @property def map_boolean(self): @@ -171,7 +196,9 @@ class AdditionalPropertiesClass(object): return self._map_boolean @map_boolean.setter - def map_boolean(self, map_boolean): + def map_boolean( + self, + map_boolean): """Sets the map_boolean of this AdditionalPropertiesClass. @@ -179,7 +206,8 @@ class AdditionalPropertiesClass(object): :type: dict(str, bool) """ - self._map_boolean = map_boolean + self._map_boolean = ( + map_boolean) @property def map_array_integer(self): @@ -192,7 +220,9 @@ class AdditionalPropertiesClass(object): return self._map_array_integer @map_array_integer.setter - def map_array_integer(self, map_array_integer): + def map_array_integer( + self, + map_array_integer): """Sets the map_array_integer of this AdditionalPropertiesClass. @@ -200,7 +230,8 @@ class AdditionalPropertiesClass(object): :type: dict(str, list[int]) """ - self._map_array_integer = map_array_integer + self._map_array_integer = ( + map_array_integer) @property def map_array_anytype(self): @@ -213,7 +244,9 @@ class AdditionalPropertiesClass(object): return self._map_array_anytype @map_array_anytype.setter - def map_array_anytype(self, map_array_anytype): + def map_array_anytype( + self, + map_array_anytype): """Sets the map_array_anytype of this AdditionalPropertiesClass. @@ -221,7 +254,8 @@ class AdditionalPropertiesClass(object): :type: dict(str, list[object]) """ - self._map_array_anytype = map_array_anytype + self._map_array_anytype = ( + map_array_anytype) @property def map_map_string(self): @@ -234,7 +268,9 @@ class AdditionalPropertiesClass(object): return self._map_map_string @map_map_string.setter - def map_map_string(self, map_map_string): + def map_map_string( + self, + map_map_string): """Sets the map_map_string of this AdditionalPropertiesClass. @@ -242,7 +278,8 @@ class AdditionalPropertiesClass(object): :type: dict(str, dict(str, str)) """ - self._map_map_string = map_map_string + self._map_map_string = ( + map_map_string) @property def map_map_anytype(self): @@ -255,7 +292,9 @@ class AdditionalPropertiesClass(object): return self._map_map_anytype @map_map_anytype.setter - def map_map_anytype(self, map_map_anytype): + def map_map_anytype( + self, + map_map_anytype): """Sets the map_map_anytype of this AdditionalPropertiesClass. @@ -263,7 +302,8 @@ class AdditionalPropertiesClass(object): :type: dict(str, dict(str, object)) """ - self._map_map_anytype = map_map_anytype + self._map_map_anytype = ( + map_map_anytype) @property def anytype_1(self): @@ -276,7 +316,9 @@ class AdditionalPropertiesClass(object): return self._anytype_1 @anytype_1.setter - def anytype_1(self, anytype_1): + def anytype_1( + self, + anytype_1): """Sets the anytype_1 of this AdditionalPropertiesClass. @@ -284,7 +326,8 @@ class AdditionalPropertiesClass(object): :type: object """ - self._anytype_1 = anytype_1 + self._anytype_1 = ( + anytype_1) @property def anytype_2(self): @@ -297,7 +340,9 @@ class AdditionalPropertiesClass(object): return self._anytype_2 @anytype_2.setter - def anytype_2(self, anytype_2): + def anytype_2( + self, + anytype_2): """Sets the anytype_2 of this AdditionalPropertiesClass. @@ -305,7 +350,8 @@ class AdditionalPropertiesClass(object): :type: object """ - self._anytype_2 = anytype_2 + self._anytype_2 = ( + anytype_2) @property def anytype_3(self): @@ -318,7 +364,9 @@ class AdditionalPropertiesClass(object): return self._anytype_3 @anytype_3.setter - def anytype_3(self, anytype_3): + def anytype_3( + self, + anytype_3): """Sets the anytype_3 of this AdditionalPropertiesClass. @@ -326,7 +374,8 @@ class AdditionalPropertiesClass(object): :type: object """ - self._anytype_3 = anytype_3 + self._anytype_3 = ( + anytype_3) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_integer.py b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_integer.py index 43bcf425a7b..9b3715f8f26 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_integer.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_integer.py @@ -31,21 +31,27 @@ class AdditionalPropertiesInteger(object): and the value is json key in definition. """ openapi_types = { - 'name': 'str' + 'name': 'str', } attribute_map = { - 'name': 'name' + 'name': 'name', # noqa: E501 } def __init__(self, name=None): # noqa: E501 - """AdditionalPropertiesInteger - a model defined in OpenAPI""" # noqa: E501 + """AdditionalPropertiesInteger - a model defined in OpenAPI + + + + Keyword Args: + name (str): [optional] # noqa: E501 + """ self._name = None self.discriminator = None if name is not None: - self.name = name + self.name = name # noqa: E501 @property def name(self): @@ -58,7 +64,9 @@ class AdditionalPropertiesInteger(object): return self._name @name.setter - def name(self, name): + def name( + self, + name): """Sets the name of this AdditionalPropertiesInteger. @@ -66,7 +74,8 @@ class AdditionalPropertiesInteger(object): :type: str """ - self._name = name + self._name = ( + name) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_number.py b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_number.py index b3e034035a8..1d4e26e8733 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_number.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_number.py @@ -31,21 +31,27 @@ class AdditionalPropertiesNumber(object): and the value is json key in definition. """ openapi_types = { - 'name': 'str' + 'name': 'str', } attribute_map = { - 'name': 'name' + 'name': 'name', # noqa: E501 } def __init__(self, name=None): # noqa: E501 - """AdditionalPropertiesNumber - a model defined in OpenAPI""" # noqa: E501 + """AdditionalPropertiesNumber - a model defined in OpenAPI + + + + Keyword Args: + name (str): [optional] # noqa: E501 + """ self._name = None self.discriminator = None if name is not None: - self.name = name + self.name = name # noqa: E501 @property def name(self): @@ -58,7 +64,9 @@ class AdditionalPropertiesNumber(object): return self._name @name.setter - def name(self, name): + def name( + self, + name): """Sets the name of this AdditionalPropertiesNumber. @@ -66,7 +74,8 @@ class AdditionalPropertiesNumber(object): :type: str """ - self._name = name + self._name = ( + name) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_object.py b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_object.py index 9ab56a4e553..96b92ade018 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_object.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_object.py @@ -31,21 +31,27 @@ class AdditionalPropertiesObject(object): and the value is json key in definition. """ openapi_types = { - 'name': 'str' + 'name': 'str', } attribute_map = { - 'name': 'name' + 'name': 'name', # noqa: E501 } def __init__(self, name=None): # noqa: E501 - """AdditionalPropertiesObject - a model defined in OpenAPI""" # noqa: E501 + """AdditionalPropertiesObject - a model defined in OpenAPI + + + + Keyword Args: + name (str): [optional] # noqa: E501 + """ self._name = None self.discriminator = None if name is not None: - self.name = name + self.name = name # noqa: E501 @property def name(self): @@ -58,7 +64,9 @@ class AdditionalPropertiesObject(object): return self._name @name.setter - def name(self, name): + def name( + self, + name): """Sets the name of this AdditionalPropertiesObject. @@ -66,7 +74,8 @@ class AdditionalPropertiesObject(object): :type: str """ - self._name = name + self._name = ( + name) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_string.py b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_string.py index 4667186bdc4..a61c1fb70e8 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_string.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_string.py @@ -31,21 +31,27 @@ class AdditionalPropertiesString(object): and the value is json key in definition. """ openapi_types = { - 'name': 'str' + 'name': 'str', } attribute_map = { - 'name': 'name' + 'name': 'name', # noqa: E501 } def __init__(self, name=None): # noqa: E501 - """AdditionalPropertiesString - a model defined in OpenAPI""" # noqa: E501 + """AdditionalPropertiesString - a model defined in OpenAPI + + + + Keyword Args: + name (str): [optional] # noqa: E501 + """ self._name = None self.discriminator = None if name is not None: - self.name = name + self.name = name # noqa: E501 @property def name(self): @@ -58,7 +64,9 @@ class AdditionalPropertiesString(object): return self._name @name.setter - def name(self, name): + def name( + self, + name): """Sets the name of this AdditionalPropertiesString. @@ -66,7 +74,8 @@ class AdditionalPropertiesString(object): :type: str """ - self._name = name + self._name = ( + name) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/animal.py b/samples/client/petstore/python-experimental/petstore_api/models/animal.py index 552ef0e8326..d5c0162b088 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/animal.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/animal.py @@ -32,12 +32,12 @@ class Animal(object): """ openapi_types = { 'class_name': 'str', - 'color': 'str' + 'color': 'str', } attribute_map = { - 'class_name': 'className', - 'color': 'color' + 'class_name': 'className', # noqa: E501 + 'color': 'color', # noqa: E501 } discriminator_value_class_map = { @@ -45,8 +45,15 @@ class Animal(object): 'Cat': 'Cat' } - def __init__(self, class_name=None, color='red'): # noqa: E501 - """Animal - a model defined in OpenAPI""" # noqa: E501 + def __init__(self, class_name, color=None): # noqa: E501 + """Animal - a model defined in OpenAPI + + Args: + class_name (str): + + Keyword Args: # noqa: E501 + color (str): [optional] if omitted the server will use the default value of 'red' # noqa: E501 + """ self._class_name = None self._color = None @@ -54,7 +61,7 @@ class Animal(object): self.class_name = class_name if color is not None: - self.color = color + self.color = color # noqa: E501 @property def class_name(self): @@ -67,7 +74,9 @@ class Animal(object): return self._class_name @class_name.setter - def class_name(self, class_name): + def class_name( + self, + class_name): """Sets the class_name of this Animal. @@ -77,7 +86,8 @@ class Animal(object): if class_name is None: raise ValueError("Invalid value for `class_name`, must not be `None`") # noqa: E501 - self._class_name = class_name + self._class_name = ( + class_name) @property def color(self): @@ -90,7 +100,9 @@ class Animal(object): return self._color @color.setter - def color(self, color): + def color( + self, + color): """Sets the color of this Animal. @@ -98,7 +110,8 @@ class Animal(object): :type: str """ - self._color = color + self._color = ( + color) def get_real_child_model(self, data): """Returns the real base class specified by the discriminator""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/api_response.py b/samples/client/petstore/python-experimental/petstore_api/models/api_response.py index 190c3df3452..43181962714 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/api_response.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/api_response.py @@ -33,17 +33,25 @@ class ApiResponse(object): openapi_types = { 'code': 'int', 'type': 'str', - 'message': 'str' + 'message': 'str', } attribute_map = { - 'code': 'code', - 'type': 'type', - 'message': 'message' + 'code': 'code', # noqa: E501 + 'type': 'type', # noqa: E501 + 'message': 'message', # noqa: E501 } def __init__(self, code=None, type=None, message=None): # noqa: E501 - """ApiResponse - a model defined in OpenAPI""" # noqa: E501 + """ApiResponse - a model defined in OpenAPI + + + + Keyword Args: + code (int): [optional] # noqa: E501 + type (str): [optional] # noqa: E501 + message (str): [optional] # noqa: E501 + """ self._code = None self._type = None @@ -51,11 +59,11 @@ class ApiResponse(object): self.discriminator = None if code is not None: - self.code = code + self.code = code # noqa: E501 if type is not None: - self.type = type + self.type = type # noqa: E501 if message is not None: - self.message = message + self.message = message # noqa: E501 @property def code(self): @@ -68,7 +76,9 @@ class ApiResponse(object): return self._code @code.setter - def code(self, code): + def code( + self, + code): """Sets the code of this ApiResponse. @@ -76,7 +86,8 @@ class ApiResponse(object): :type: int """ - self._code = code + self._code = ( + code) @property def type(self): @@ -89,7 +100,9 @@ class ApiResponse(object): return self._type @type.setter - def type(self, type): + def type( + self, + type): """Sets the type of this ApiResponse. @@ -97,7 +110,8 @@ class ApiResponse(object): :type: str """ - self._type = type + self._type = ( + type) @property def message(self): @@ -110,7 +124,9 @@ class ApiResponse(object): return self._message @message.setter - def message(self, message): + def message( + self, + message): """Sets the message of this ApiResponse. @@ -118,7 +134,8 @@ class ApiResponse(object): :type: str """ - self._message = message + self._message = ( + message) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py b/samples/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py index ebf96429801..d49c620abc1 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py @@ -31,21 +31,27 @@ class ArrayOfArrayOfNumberOnly(object): and the value is json key in definition. """ openapi_types = { - 'array_array_number': 'list[list[float]]' + 'array_array_number': 'list[list[float]]', } attribute_map = { - 'array_array_number': 'ArrayArrayNumber' + 'array_array_number': 'ArrayArrayNumber', # noqa: E501 } def __init__(self, array_array_number=None): # noqa: E501 - """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI""" # noqa: E501 + """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI + + + + Keyword Args: + array_array_number (list[list[float]]): [optional] # noqa: E501 + """ self._array_array_number = None self.discriminator = None if array_array_number is not None: - self.array_array_number = array_array_number + self.array_array_number = array_array_number # noqa: E501 @property def array_array_number(self): @@ -58,7 +64,9 @@ class ArrayOfArrayOfNumberOnly(object): return self._array_array_number @array_array_number.setter - def array_array_number(self, array_array_number): + def array_array_number( + self, + array_array_number): """Sets the array_array_number of this ArrayOfArrayOfNumberOnly. @@ -66,7 +74,8 @@ class ArrayOfArrayOfNumberOnly(object): :type: list[list[float]] """ - self._array_array_number = array_array_number + self._array_array_number = ( + array_array_number) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py b/samples/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py index 8e1837c46bd..f87d00b168a 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py @@ -31,21 +31,27 @@ class ArrayOfNumberOnly(object): and the value is json key in definition. """ openapi_types = { - 'array_number': 'list[float]' + 'array_number': 'list[float]', } attribute_map = { - 'array_number': 'ArrayNumber' + 'array_number': 'ArrayNumber', # noqa: E501 } def __init__(self, array_number=None): # noqa: E501 - """ArrayOfNumberOnly - a model defined in OpenAPI""" # noqa: E501 + """ArrayOfNumberOnly - a model defined in OpenAPI + + + + Keyword Args: + array_number (list[float]): [optional] # noqa: E501 + """ self._array_number = None self.discriminator = None if array_number is not None: - self.array_number = array_number + self.array_number = array_number # noqa: E501 @property def array_number(self): @@ -58,7 +64,9 @@ class ArrayOfNumberOnly(object): return self._array_number @array_number.setter - def array_number(self, array_number): + def array_number( + self, + array_number): """Sets the array_number of this ArrayOfNumberOnly. @@ -66,7 +74,8 @@ class ArrayOfNumberOnly(object): :type: list[float] """ - self._array_number = array_number + self._array_number = ( + array_number) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/array_test.py b/samples/client/petstore/python-experimental/petstore_api/models/array_test.py index f548fef3ee8..5098375a2f0 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/array_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/array_test.py @@ -33,17 +33,25 @@ class ArrayTest(object): openapi_types = { 'array_of_string': 'list[str]', 'array_array_of_integer': 'list[list[int]]', - 'array_array_of_model': 'list[list[ReadOnlyFirst]]' + 'array_array_of_model': 'list[list[ReadOnlyFirst]]', } attribute_map = { - 'array_of_string': 'array_of_string', - 'array_array_of_integer': 'array_array_of_integer', - 'array_array_of_model': 'array_array_of_model' + 'array_of_string': 'array_of_string', # noqa: E501 + 'array_array_of_integer': 'array_array_of_integer', # noqa: E501 + 'array_array_of_model': 'array_array_of_model', # noqa: E501 } def __init__(self, array_of_string=None, array_array_of_integer=None, array_array_of_model=None): # noqa: E501 - """ArrayTest - a model defined in OpenAPI""" # noqa: E501 + """ArrayTest - a model defined in OpenAPI + + + + Keyword Args: + array_of_string (list[str]): [optional] # noqa: E501 + array_array_of_integer (list[list[int]]): [optional] # noqa: E501 + array_array_of_model (list[list[ReadOnlyFirst]]): [optional] # noqa: E501 + """ self._array_of_string = None self._array_array_of_integer = None @@ -51,11 +59,11 @@ class ArrayTest(object): self.discriminator = None if array_of_string is not None: - self.array_of_string = array_of_string + self.array_of_string = array_of_string # noqa: E501 if array_array_of_integer is not None: - self.array_array_of_integer = array_array_of_integer + self.array_array_of_integer = array_array_of_integer # noqa: E501 if array_array_of_model is not None: - self.array_array_of_model = array_array_of_model + self.array_array_of_model = array_array_of_model # noqa: E501 @property def array_of_string(self): @@ -68,7 +76,9 @@ class ArrayTest(object): return self._array_of_string @array_of_string.setter - def array_of_string(self, array_of_string): + def array_of_string( + self, + array_of_string): """Sets the array_of_string of this ArrayTest. @@ -76,7 +86,8 @@ class ArrayTest(object): :type: list[str] """ - self._array_of_string = array_of_string + self._array_of_string = ( + array_of_string) @property def array_array_of_integer(self): @@ -89,7 +100,9 @@ class ArrayTest(object): return self._array_array_of_integer @array_array_of_integer.setter - def array_array_of_integer(self, array_array_of_integer): + def array_array_of_integer( + self, + array_array_of_integer): """Sets the array_array_of_integer of this ArrayTest. @@ -97,7 +110,8 @@ class ArrayTest(object): :type: list[list[int]] """ - self._array_array_of_integer = array_array_of_integer + self._array_array_of_integer = ( + array_array_of_integer) @property def array_array_of_model(self): @@ -110,7 +124,9 @@ class ArrayTest(object): return self._array_array_of_model @array_array_of_model.setter - def array_array_of_model(self, array_array_of_model): + def array_array_of_model( + self, + array_array_of_model): """Sets the array_array_of_model of this ArrayTest. @@ -118,7 +134,8 @@ class ArrayTest(object): :type: list[list[ReadOnlyFirst]] """ - self._array_array_of_model = array_array_of_model + self._array_array_of_model = ( + array_array_of_model) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/capitalization.py b/samples/client/petstore/python-experimental/petstore_api/models/capitalization.py index 0da6b77e84d..e94eca3e402 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/capitalization.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/capitalization.py @@ -36,20 +36,31 @@ class Capitalization(object): 'small_snake': 'str', 'capital_snake': 'str', 'sca_eth_flow_points': 'str', - 'att_name': 'str' + 'att_name': 'str', } attribute_map = { - 'small_camel': 'smallCamel', - 'capital_camel': 'CapitalCamel', - 'small_snake': 'small_Snake', - 'capital_snake': 'Capital_Snake', - 'sca_eth_flow_points': 'SCA_ETH_Flow_Points', - 'att_name': 'ATT_NAME' + 'small_camel': 'smallCamel', # noqa: E501 + 'capital_camel': 'CapitalCamel', # noqa: E501 + 'small_snake': 'small_Snake', # noqa: E501 + 'capital_snake': 'Capital_Snake', # noqa: E501 + 'sca_eth_flow_points': 'SCA_ETH_Flow_Points', # noqa: E501 + 'att_name': 'ATT_NAME', # noqa: E501 } def __init__(self, small_camel=None, capital_camel=None, small_snake=None, capital_snake=None, sca_eth_flow_points=None, att_name=None): # noqa: E501 - """Capitalization - a model defined in OpenAPI""" # noqa: E501 + """Capitalization - a model defined in OpenAPI + + + + Keyword Args: + small_camel (str): [optional] # noqa: E501 + capital_camel (str): [optional] # noqa: E501 + small_snake (str): [optional] # noqa: E501 + capital_snake (str): [optional] # noqa: E501 + sca_eth_flow_points (str): [optional] # noqa: E501 + att_name (str): Name of the pet . [optional] # noqa: E501 + """ self._small_camel = None self._capital_camel = None @@ -60,17 +71,17 @@ class Capitalization(object): self.discriminator = None if small_camel is not None: - self.small_camel = small_camel + self.small_camel = small_camel # noqa: E501 if capital_camel is not None: - self.capital_camel = capital_camel + self.capital_camel = capital_camel # noqa: E501 if small_snake is not None: - self.small_snake = small_snake + self.small_snake = small_snake # noqa: E501 if capital_snake is not None: - self.capital_snake = capital_snake + self.capital_snake = capital_snake # noqa: E501 if sca_eth_flow_points is not None: - self.sca_eth_flow_points = sca_eth_flow_points + self.sca_eth_flow_points = sca_eth_flow_points # noqa: E501 if att_name is not None: - self.att_name = att_name + self.att_name = att_name # noqa: E501 @property def small_camel(self): @@ -83,7 +94,9 @@ class Capitalization(object): return self._small_camel @small_camel.setter - def small_camel(self, small_camel): + def small_camel( + self, + small_camel): """Sets the small_camel of this Capitalization. @@ -91,7 +104,8 @@ class Capitalization(object): :type: str """ - self._small_camel = small_camel + self._small_camel = ( + small_camel) @property def capital_camel(self): @@ -104,7 +118,9 @@ class Capitalization(object): return self._capital_camel @capital_camel.setter - def capital_camel(self, capital_camel): + def capital_camel( + self, + capital_camel): """Sets the capital_camel of this Capitalization. @@ -112,7 +128,8 @@ class Capitalization(object): :type: str """ - self._capital_camel = capital_camel + self._capital_camel = ( + capital_camel) @property def small_snake(self): @@ -125,7 +142,9 @@ class Capitalization(object): return self._small_snake @small_snake.setter - def small_snake(self, small_snake): + def small_snake( + self, + small_snake): """Sets the small_snake of this Capitalization. @@ -133,7 +152,8 @@ class Capitalization(object): :type: str """ - self._small_snake = small_snake + self._small_snake = ( + small_snake) @property def capital_snake(self): @@ -146,7 +166,9 @@ class Capitalization(object): return self._capital_snake @capital_snake.setter - def capital_snake(self, capital_snake): + def capital_snake( + self, + capital_snake): """Sets the capital_snake of this Capitalization. @@ -154,7 +176,8 @@ class Capitalization(object): :type: str """ - self._capital_snake = capital_snake + self._capital_snake = ( + capital_snake) @property def sca_eth_flow_points(self): @@ -167,7 +190,9 @@ class Capitalization(object): return self._sca_eth_flow_points @sca_eth_flow_points.setter - def sca_eth_flow_points(self, sca_eth_flow_points): + def sca_eth_flow_points( + self, + sca_eth_flow_points): """Sets the sca_eth_flow_points of this Capitalization. @@ -175,7 +200,8 @@ class Capitalization(object): :type: str """ - self._sca_eth_flow_points = sca_eth_flow_points + self._sca_eth_flow_points = ( + sca_eth_flow_points) @property def att_name(self): @@ -189,7 +215,9 @@ class Capitalization(object): return self._att_name @att_name.setter - def att_name(self, att_name): + def att_name( + self, + att_name): """Sets the att_name of this Capitalization. Name of the pet # noqa: E501 @@ -198,7 +226,8 @@ class Capitalization(object): :type: str """ - self._att_name = att_name + self._att_name = ( + att_name) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/cat.py b/samples/client/petstore/python-experimental/petstore_api/models/cat.py index 216e5123538..2a19eddd5ed 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/cat.py @@ -31,21 +31,33 @@ class Cat(object): and the value is json key in definition. """ openapi_types = { - 'declawed': 'bool' + 'class_name': 'str', + 'declawed': 'bool', + 'color': 'str', } attribute_map = { - 'declawed': 'declawed' + 'class_name': 'className', # noqa: E501 + 'declawed': 'declawed', # noqa: E501 + 'color': 'color', # noqa: E501 } - def __init__(self, declawed=None): # noqa: E501 - """Cat - a model defined in OpenAPI""" # noqa: E501 + def __init__(self, class_name, declawed=None, color=None): # noqa: E501 + """Cat - a model defined in OpenAPI + + Args: + class_name (str): + + Keyword Args: # noqa: E501 + declawed (bool): [optional] # noqa: E501 + color (str): [optional] if omitted the server will use the default value of 'red' # noqa: E501 + """ self._declawed = None self.discriminator = None if declawed is not None: - self.declawed = declawed + self.declawed = declawed # noqa: E501 @property def declawed(self): @@ -58,7 +70,9 @@ class Cat(object): return self._declawed @declawed.setter - def declawed(self, declawed): + def declawed( + self, + declawed): """Sets the declawed of this Cat. @@ -66,7 +80,8 @@ class Cat(object): :type: bool """ - self._declawed = declawed + self._declawed = ( + declawed) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/cat_all_of.py b/samples/client/petstore/python-experimental/petstore_api/models/cat_all_of.py index 3c90df84ec3..88260a5e3d9 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/cat_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/cat_all_of.py @@ -31,21 +31,27 @@ class CatAllOf(object): and the value is json key in definition. """ openapi_types = { - 'declawed': 'bool' + 'declawed': 'bool', } attribute_map = { - 'declawed': 'declawed' + 'declawed': 'declawed', # noqa: E501 } def __init__(self, declawed=None): # noqa: E501 - """CatAllOf - a model defined in OpenAPI""" # noqa: E501 + """CatAllOf - a model defined in OpenAPI + + + + Keyword Args: + declawed (bool): [optional] # noqa: E501 + """ self._declawed = None self.discriminator = None if declawed is not None: - self.declawed = declawed + self.declawed = declawed # noqa: E501 @property def declawed(self): @@ -58,7 +64,9 @@ class CatAllOf(object): return self._declawed @declawed.setter - def declawed(self, declawed): + def declawed( + self, + declawed): """Sets the declawed of this CatAllOf. @@ -66,7 +74,8 @@ class CatAllOf(object): :type: bool """ - self._declawed = declawed + self._declawed = ( + declawed) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/category.py b/samples/client/petstore/python-experimental/petstore_api/models/category.py index 0e23c409e50..347ed14927e 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/category.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/category.py @@ -31,24 +31,31 @@ class Category(object): and the value is json key in definition. """ openapi_types = { + 'name': 'str', 'id': 'int', - 'name': 'str' } attribute_map = { - 'id': 'id', - 'name': 'name' + 'name': 'name', # noqa: E501 + 'id': 'id', # noqa: E501 } - def __init__(self, id=None, name='default-name'): # noqa: E501 - """Category - a model defined in OpenAPI""" # noqa: E501 + def __init__(self, name='default-name', id=None): # noqa: E501 + """Category - a model defined in OpenAPI + + Args: + + Keyword Args: + name (str): defaults to 'default-name', must be one of ['default-name'] # noqa: E501 + id (int): [optional] # noqa: E501 + """ self._id = None self._name = None self.discriminator = None if id is not None: - self.id = id + self.id = id # noqa: E501 self.name = name @property @@ -62,7 +69,9 @@ class Category(object): return self._id @id.setter - def id(self, id): + def id( + self, + id): """Sets the id of this Category. @@ -70,7 +79,8 @@ class Category(object): :type: int """ - self._id = id + self._id = ( + id) @property def name(self): @@ -83,7 +93,9 @@ class Category(object): return self._name @name.setter - def name(self, name): + def name( + self, + name): """Sets the name of this Category. @@ -93,7 +105,8 @@ class Category(object): if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name + self._name = ( + name) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/class_model.py b/samples/client/petstore/python-experimental/petstore_api/models/class_model.py index 88562beff8b..bac11b0e138 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/class_model.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/class_model.py @@ -31,21 +31,27 @@ class ClassModel(object): and the value is json key in definition. """ openapi_types = { - '_class': 'str' + '_class': 'str', } attribute_map = { - '_class': '_class' + '_class': '_class', # noqa: E501 } def __init__(self, _class=None): # noqa: E501 - """ClassModel - a model defined in OpenAPI""" # noqa: E501 + """ClassModel - a model defined in OpenAPI + + + + Keyword Args: + _class (str): [optional] # noqa: E501 + """ self.__class = None self.discriminator = None if _class is not None: - self._class = _class + self._class = _class # noqa: E501 @property def _class(self): @@ -58,7 +64,9 @@ class ClassModel(object): return self.__class @_class.setter - def _class(self, _class): + def _class( + self, + _class): """Sets the _class of this ClassModel. @@ -66,7 +74,8 @@ class ClassModel(object): :type: str """ - self.__class = _class + self.__class = ( + _class) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/client.py b/samples/client/petstore/python-experimental/petstore_api/models/client.py index b7083fd9bd7..4cde17963c5 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/client.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/client.py @@ -31,21 +31,27 @@ class Client(object): and the value is json key in definition. """ openapi_types = { - 'client': 'str' + 'client': 'str', } attribute_map = { - 'client': 'client' + 'client': 'client', # noqa: E501 } def __init__(self, client=None): # noqa: E501 - """Client - a model defined in OpenAPI""" # noqa: E501 + """Client - a model defined in OpenAPI + + + + Keyword Args: + client (str): [optional] # noqa: E501 + """ self._client = None self.discriminator = None if client is not None: - self.client = client + self.client = client # noqa: E501 @property def client(self): @@ -58,7 +64,9 @@ class Client(object): return self._client @client.setter - def client(self, client): + def client( + self, + client): """Sets the client of this Client. @@ -66,7 +74,8 @@ class Client(object): :type: str """ - self._client = client + self._client = ( + client) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/dog.py b/samples/client/petstore/python-experimental/petstore_api/models/dog.py index c325cb252c3..14c4eedcc59 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/dog.py @@ -31,21 +31,33 @@ class Dog(object): and the value is json key in definition. """ openapi_types = { - 'breed': 'str' + 'class_name': 'str', + 'breed': 'str', + 'color': 'str', } attribute_map = { - 'breed': 'breed' + 'class_name': 'className', # noqa: E501 + 'breed': 'breed', # noqa: E501 + 'color': 'color', # noqa: E501 } - def __init__(self, breed=None): # noqa: E501 - """Dog - a model defined in OpenAPI""" # noqa: E501 + def __init__(self, class_name, breed=None, color=None): # noqa: E501 + """Dog - a model defined in OpenAPI + + Args: + class_name (str): + + Keyword Args: # noqa: E501 + breed (str): [optional] # noqa: E501 + color (str): [optional] if omitted the server will use the default value of 'red' # noqa: E501 + """ self._breed = None self.discriminator = None if breed is not None: - self.breed = breed + self.breed = breed # noqa: E501 @property def breed(self): @@ -58,7 +70,9 @@ class Dog(object): return self._breed @breed.setter - def breed(self, breed): + def breed( + self, + breed): """Sets the breed of this Dog. @@ -66,7 +80,8 @@ class Dog(object): :type: str """ - self._breed = breed + self._breed = ( + breed) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/dog_all_of.py b/samples/client/petstore/python-experimental/petstore_api/models/dog_all_of.py index b6328b05589..7940637ce5e 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/dog_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/dog_all_of.py @@ -31,21 +31,27 @@ class DogAllOf(object): and the value is json key in definition. """ openapi_types = { - 'breed': 'str' + 'breed': 'str', } attribute_map = { - 'breed': 'breed' + 'breed': 'breed', # noqa: E501 } def __init__(self, breed=None): # noqa: E501 - """DogAllOf - a model defined in OpenAPI""" # noqa: E501 + """DogAllOf - a model defined in OpenAPI + + + + Keyword Args: + breed (str): [optional] # noqa: E501 + """ self._breed = None self.discriminator = None if breed is not None: - self.breed = breed + self.breed = breed # noqa: E501 @property def breed(self): @@ -58,7 +64,9 @@ class DogAllOf(object): return self._breed @breed.setter - def breed(self, breed): + def breed( + self, + breed): """Sets the breed of this DogAllOf. @@ -66,7 +74,8 @@ class DogAllOf(object): :type: str """ - self._breed = breed + self._breed = ( + breed) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/enum_arrays.py b/samples/client/petstore/python-experimental/petstore_api/models/enum_arrays.py index 00aa21d04da..ad0e8c3d9b6 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/enum_arrays.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/enum_arrays.py @@ -32,25 +32,32 @@ class EnumArrays(object): """ openapi_types = { 'just_symbol': 'str', - 'array_enum': 'list[str]' + 'array_enum': 'list[str]', } attribute_map = { - 'just_symbol': 'just_symbol', - 'array_enum': 'array_enum' + 'just_symbol': 'just_symbol', # noqa: E501 + 'array_enum': 'array_enum', # noqa: E501 } def __init__(self, just_symbol=None, array_enum=None): # noqa: E501 - """EnumArrays - a model defined in OpenAPI""" # noqa: E501 + """EnumArrays - a model defined in OpenAPI + + + + Keyword Args: + just_symbol (str): [optional] # noqa: E501 + array_enum (list[str]): [optional] # noqa: E501 + """ self._just_symbol = None self._array_enum = None self.discriminator = None if just_symbol is not None: - self.just_symbol = just_symbol + self.just_symbol = just_symbol # noqa: E501 if array_enum is not None: - self.array_enum = array_enum + self.array_enum = array_enum # noqa: E501 @property def just_symbol(self): @@ -63,7 +70,9 @@ class EnumArrays(object): return self._just_symbol @just_symbol.setter - def just_symbol(self, just_symbol): + def just_symbol( + self, + just_symbol): """Sets the just_symbol of this EnumArrays. @@ -77,7 +86,8 @@ class EnumArrays(object): .format(just_symbol, allowed_values) ) - self._just_symbol = just_symbol + self._just_symbol = ( + just_symbol) @property def array_enum(self): @@ -90,7 +100,9 @@ class EnumArrays(object): return self._array_enum @array_enum.setter - def array_enum(self, array_enum): + def array_enum( + self, + array_enum): """Sets the array_enum of this EnumArrays. @@ -105,7 +117,8 @@ class EnumArrays(object): ", ".join(map(str, allowed_values))) ) - self._array_enum = array_enum + self._array_enum = ( + array_enum) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/enum_class.py b/samples/client/petstore/python-experimental/petstore_api/models/enum_class.py index 3c1aa279755..a2f3a3e4a78 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/enum_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/enum_class.py @@ -44,7 +44,12 @@ class EnumClass(object): } def __init__(self): # noqa: E501 - """EnumClass - a model defined in OpenAPI""" # noqa: E501 + """EnumClass - a model defined in OpenAPI + + + + Keyword Args: + """ self.discriminator = None def to_dict(self): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py b/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py index 11e5020363e..4ea9e777f68 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py @@ -31,23 +31,33 @@ class EnumTest(object): and the value is json key in definition. """ openapi_types = { - 'enum_string': 'str', 'enum_string_required': 'str', + 'enum_string': 'str', 'enum_integer': 'int', 'enum_number': 'float', - 'outer_enum': 'OuterEnum' + 'outer_enum': 'OuterEnum', } attribute_map = { - 'enum_string': 'enum_string', - 'enum_string_required': 'enum_string_required', - 'enum_integer': 'enum_integer', - 'enum_number': 'enum_number', - 'outer_enum': 'outerEnum' + 'enum_string_required': 'enum_string_required', # noqa: E501 + 'enum_string': 'enum_string', # noqa: E501 + 'enum_integer': 'enum_integer', # noqa: E501 + 'enum_number': 'enum_number', # noqa: E501 + 'outer_enum': 'outerEnum', # noqa: E501 } - def __init__(self, enum_string=None, enum_string_required=None, enum_integer=None, enum_number=None, outer_enum=None): # noqa: E501 - """EnumTest - a model defined in OpenAPI""" # noqa: E501 + def __init__(self, enum_string_required, enum_string=None, enum_integer=None, enum_number=None, outer_enum=None): # noqa: E501 + """EnumTest - a model defined in OpenAPI + + Args: + enum_string_required (str): + + Keyword Args: # noqa: E501 + enum_string (str): [optional] # noqa: E501 + enum_integer (int): [optional] # noqa: E501 + enum_number (float): [optional] # noqa: E501 + outer_enum (OuterEnum): [optional] # noqa: E501 + """ self._enum_string = None self._enum_string_required = None @@ -57,14 +67,14 @@ class EnumTest(object): self.discriminator = None if enum_string is not None: - self.enum_string = enum_string + self.enum_string = enum_string # noqa: E501 self.enum_string_required = enum_string_required if enum_integer is not None: - self.enum_integer = enum_integer + self.enum_integer = enum_integer # noqa: E501 if enum_number is not None: - self.enum_number = enum_number + self.enum_number = enum_number # noqa: E501 if outer_enum is not None: - self.outer_enum = outer_enum + self.outer_enum = outer_enum # noqa: E501 @property def enum_string(self): @@ -77,7 +87,9 @@ class EnumTest(object): return self._enum_string @enum_string.setter - def enum_string(self, enum_string): + def enum_string( + self, + enum_string): """Sets the enum_string of this EnumTest. @@ -91,7 +103,8 @@ class EnumTest(object): .format(enum_string, allowed_values) ) - self._enum_string = enum_string + self._enum_string = ( + enum_string) @property def enum_string_required(self): @@ -104,7 +117,9 @@ class EnumTest(object): return self._enum_string_required @enum_string_required.setter - def enum_string_required(self, enum_string_required): + def enum_string_required( + self, + enum_string_required): """Sets the enum_string_required of this EnumTest. @@ -120,7 +135,8 @@ class EnumTest(object): .format(enum_string_required, allowed_values) ) - self._enum_string_required = enum_string_required + self._enum_string_required = ( + enum_string_required) @property def enum_integer(self): @@ -133,7 +149,9 @@ class EnumTest(object): return self._enum_integer @enum_integer.setter - def enum_integer(self, enum_integer): + def enum_integer( + self, + enum_integer): """Sets the enum_integer of this EnumTest. @@ -147,7 +165,8 @@ class EnumTest(object): .format(enum_integer, allowed_values) ) - self._enum_integer = enum_integer + self._enum_integer = ( + enum_integer) @property def enum_number(self): @@ -160,7 +179,9 @@ class EnumTest(object): return self._enum_number @enum_number.setter - def enum_number(self, enum_number): + def enum_number( + self, + enum_number): """Sets the enum_number of this EnumTest. @@ -174,7 +195,8 @@ class EnumTest(object): .format(enum_number, allowed_values) ) - self._enum_number = enum_number + self._enum_number = ( + enum_number) @property def outer_enum(self): @@ -187,7 +209,9 @@ class EnumTest(object): return self._outer_enum @outer_enum.setter - def outer_enum(self, outer_enum): + def outer_enum( + self, + outer_enum): """Sets the outer_enum of this EnumTest. @@ -195,7 +219,8 @@ class EnumTest(object): :type: OuterEnum """ - self._outer_enum = outer_enum + self._outer_enum = ( + outer_enum) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/file.py b/samples/client/petstore/python-experimental/petstore_api/models/file.py index 475f86b799f..70e1611a237 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/file.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/file.py @@ -31,21 +31,27 @@ class File(object): and the value is json key in definition. """ openapi_types = { - 'source_uri': 'str' + 'source_uri': 'str', } attribute_map = { - 'source_uri': 'sourceURI' + 'source_uri': 'sourceURI', # noqa: E501 } def __init__(self, source_uri=None): # noqa: E501 - """File - a model defined in OpenAPI""" # noqa: E501 + """File - a model defined in OpenAPI + + + + Keyword Args: + source_uri (str): Test capitalization. [optional] # noqa: E501 + """ self._source_uri = None self.discriminator = None if source_uri is not None: - self.source_uri = source_uri + self.source_uri = source_uri # noqa: E501 @property def source_uri(self): @@ -59,7 +65,9 @@ class File(object): return self._source_uri @source_uri.setter - def source_uri(self, source_uri): + def source_uri( + self, + source_uri): """Sets the source_uri of this File. Test capitalization # noqa: E501 @@ -68,7 +76,8 @@ class File(object): :type: str """ - self._source_uri = source_uri + self._source_uri = ( + source_uri) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py b/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py index 9f3b5bdc179..86e926ca153 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py @@ -32,25 +32,32 @@ class FileSchemaTestClass(object): """ openapi_types = { 'file': 'File', - 'files': 'list[File]' + 'files': 'list[File]', } attribute_map = { - 'file': 'file', - 'files': 'files' + 'file': 'file', # noqa: E501 + 'files': 'files', # noqa: E501 } def __init__(self, file=None, files=None): # noqa: E501 - """FileSchemaTestClass - a model defined in OpenAPI""" # noqa: E501 + """FileSchemaTestClass - a model defined in OpenAPI + + + + Keyword Args: + file (File): [optional] # noqa: E501 + files (list[File]): [optional] # noqa: E501 + """ self._file = None self._files = None self.discriminator = None if file is not None: - self.file = file + self.file = file # noqa: E501 if files is not None: - self.files = files + self.files = files # noqa: E501 @property def file(self): @@ -63,7 +70,9 @@ class FileSchemaTestClass(object): return self._file @file.setter - def file(self, file): + def file( + self, + file): """Sets the file of this FileSchemaTestClass. @@ -71,7 +80,8 @@ class FileSchemaTestClass(object): :type: File """ - self._file = file + self._file = ( + file) @property def files(self): @@ -84,7 +94,9 @@ class FileSchemaTestClass(object): return self._files @files.setter - def files(self, files): + def files( + self, + files): """Sets the files of this FileSchemaTestClass. @@ -92,7 +104,8 @@ class FileSchemaTestClass(object): :type: list[File] """ - self._files = files + self._files = ( + files) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/format_test.py b/samples/client/petstore/python-experimental/petstore_api/models/format_test.py index c27d6394dbe..a7936dc37ec 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/format_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/format_test.py @@ -31,39 +31,57 @@ class FormatTest(object): and the value is json key in definition. """ openapi_types = { + 'number': 'float', + 'byte': 'str', + 'date': 'date', + 'password': 'str', 'integer': 'int', 'int32': 'int', 'int64': 'int', - 'number': 'float', 'float': 'float', 'double': 'float', 'string': 'str', - 'byte': 'str', 'binary': 'file', - 'date': 'date', 'date_time': 'datetime', 'uuid': 'str', - 'password': 'str' } attribute_map = { - 'integer': 'integer', - 'int32': 'int32', - 'int64': 'int64', - 'number': 'number', - 'float': 'float', - 'double': 'double', - 'string': 'string', - 'byte': 'byte', - 'binary': 'binary', - 'date': 'date', - 'date_time': 'dateTime', - 'uuid': 'uuid', - 'password': 'password' + 'number': 'number', # noqa: E501 + 'byte': 'byte', # noqa: E501 + 'date': 'date', # noqa: E501 + 'password': 'password', # noqa: E501 + 'integer': 'integer', # noqa: E501 + 'int32': 'int32', # noqa: E501 + 'int64': 'int64', # noqa: E501 + 'float': 'float', # noqa: E501 + 'double': 'double', # noqa: E501 + 'string': 'string', # noqa: E501 + 'binary': 'binary', # noqa: E501 + 'date_time': 'dateTime', # noqa: E501 + 'uuid': 'uuid', # noqa: E501 } - def __init__(self, integer=None, int32=None, int64=None, number=None, float=None, double=None, string=None, byte=None, binary=None, date=None, date_time=None, uuid=None, password=None): # noqa: E501 - """FormatTest - a model defined in OpenAPI""" # noqa: E501 + def __init__(self, number, byte, date, password, integer=None, int32=None, int64=None, float=None, double=None, string=None, binary=None, date_time=None, uuid=None): # noqa: E501 + """FormatTest - a model defined in OpenAPI + + Args: + number (float): + byte (str): + date (date): + password (str): + + Keyword Args: # noqa: E501 # noqa: E501 # noqa: E501 # noqa: E501 + integer (int): [optional] # noqa: E501 + int32 (int): [optional] # noqa: E501 + int64 (int): [optional] # noqa: E501 + float (float): [optional] # noqa: E501 + double (float): [optional] # noqa: E501 + string (str): [optional] # noqa: E501 + binary (file): [optional] # noqa: E501 + date_time (datetime): [optional] # noqa: E501 + uuid (str): [optional] # noqa: E501 + """ self._integer = None self._int32 = None @@ -81,26 +99,26 @@ class FormatTest(object): self.discriminator = None if integer is not None: - self.integer = integer + self.integer = integer # noqa: E501 if int32 is not None: - self.int32 = int32 + self.int32 = int32 # noqa: E501 if int64 is not None: - self.int64 = int64 + self.int64 = int64 # noqa: E501 self.number = number if float is not None: - self.float = float + self.float = float # noqa: E501 if double is not None: - self.double = double + self.double = double # noqa: E501 if string is not None: - self.string = string + self.string = string # noqa: E501 self.byte = byte if binary is not None: - self.binary = binary + self.binary = binary # noqa: E501 self.date = date if date_time is not None: - self.date_time = date_time + self.date_time = date_time # noqa: E501 if uuid is not None: - self.uuid = uuid + self.uuid = uuid # noqa: E501 self.password = password @property @@ -114,7 +132,9 @@ class FormatTest(object): return self._integer @integer.setter - def integer(self, integer): + def integer( + self, + integer): """Sets the integer of this FormatTest. @@ -126,7 +146,8 @@ class FormatTest(object): if integer is not None and integer < 10: # noqa: E501 raise ValueError("Invalid value for `integer`, must be a value greater than or equal to `10`") # noqa: E501 - self._integer = integer + self._integer = ( + integer) @property def int32(self): @@ -139,7 +160,9 @@ class FormatTest(object): return self._int32 @int32.setter - def int32(self, int32): + def int32( + self, + int32): """Sets the int32 of this FormatTest. @@ -151,7 +174,8 @@ class FormatTest(object): if int32 is not None and int32 < 20: # noqa: E501 raise ValueError("Invalid value for `int32`, must be a value greater than or equal to `20`") # noqa: E501 - self._int32 = int32 + self._int32 = ( + int32) @property def int64(self): @@ -164,7 +188,9 @@ class FormatTest(object): return self._int64 @int64.setter - def int64(self, int64): + def int64( + self, + int64): """Sets the int64 of this FormatTest. @@ -172,7 +198,8 @@ class FormatTest(object): :type: int """ - self._int64 = int64 + self._int64 = ( + int64) @property def number(self): @@ -185,7 +212,9 @@ class FormatTest(object): return self._number @number.setter - def number(self, number): + def number( + self, + number): """Sets the number of this FormatTest. @@ -199,7 +228,8 @@ class FormatTest(object): if number is not None and number < 32.1: # noqa: E501 raise ValueError("Invalid value for `number`, must be a value greater than or equal to `32.1`") # noqa: E501 - self._number = number + self._number = ( + number) @property def float(self): @@ -212,7 +242,9 @@ class FormatTest(object): return self._float @float.setter - def float(self, float): + def float( + self, + float): """Sets the float of this FormatTest. @@ -224,7 +256,8 @@ class FormatTest(object): if float is not None and float < 54.3: # noqa: E501 raise ValueError("Invalid value for `float`, must be a value greater than or equal to `54.3`") # noqa: E501 - self._float = float + self._float = ( + float) @property def double(self): @@ -237,7 +270,9 @@ class FormatTest(object): return self._double @double.setter - def double(self, double): + def double( + self, + double): """Sets the double of this FormatTest. @@ -249,7 +284,8 @@ class FormatTest(object): if double is not None and double < 67.8: # noqa: E501 raise ValueError("Invalid value for `double`, must be a value greater than or equal to `67.8`") # noqa: E501 - self._double = double + self._double = ( + double) @property def string(self): @@ -262,7 +298,9 @@ class FormatTest(object): return self._string @string.setter - def string(self, string): + def string( + self, + string): """Sets the string of this FormatTest. @@ -272,7 +310,8 @@ class FormatTest(object): if string is not None and not re.search(r'[a-z]', string, flags=re.IGNORECASE): # noqa: E501 raise ValueError(r"Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") # noqa: E501 - self._string = string + self._string = ( + string) @property def byte(self): @@ -285,7 +324,9 @@ class FormatTest(object): return self._byte @byte.setter - def byte(self, byte): + def byte( + self, + byte): """Sets the byte of this FormatTest. @@ -297,7 +338,8 @@ class FormatTest(object): if byte is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', byte): # noqa: E501 raise ValueError(r"Invalid value for `byte`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") # noqa: E501 - self._byte = byte + self._byte = ( + byte) @property def binary(self): @@ -310,7 +352,9 @@ class FormatTest(object): return self._binary @binary.setter - def binary(self, binary): + def binary( + self, + binary): """Sets the binary of this FormatTest. @@ -318,7 +362,8 @@ class FormatTest(object): :type: file """ - self._binary = binary + self._binary = ( + binary) @property def date(self): @@ -331,7 +376,9 @@ class FormatTest(object): return self._date @date.setter - def date(self, date): + def date( + self, + date): """Sets the date of this FormatTest. @@ -341,7 +388,8 @@ class FormatTest(object): if date is None: raise ValueError("Invalid value for `date`, must not be `None`") # noqa: E501 - self._date = date + self._date = ( + date) @property def date_time(self): @@ -354,7 +402,9 @@ class FormatTest(object): return self._date_time @date_time.setter - def date_time(self, date_time): + def date_time( + self, + date_time): """Sets the date_time of this FormatTest. @@ -362,7 +412,8 @@ class FormatTest(object): :type: datetime """ - self._date_time = date_time + self._date_time = ( + date_time) @property def uuid(self): @@ -375,7 +426,9 @@ class FormatTest(object): return self._uuid @uuid.setter - def uuid(self, uuid): + def uuid( + self, + uuid): """Sets the uuid of this FormatTest. @@ -383,7 +436,8 @@ class FormatTest(object): :type: str """ - self._uuid = uuid + self._uuid = ( + uuid) @property def password(self): @@ -396,7 +450,9 @@ class FormatTest(object): return self._password @password.setter - def password(self, password): + def password( + self, + password): """Sets the password of this FormatTest. @@ -410,7 +466,8 @@ class FormatTest(object): if password is not None and len(password) < 10: raise ValueError("Invalid value for `password`, length must be greater than or equal to `10`") # noqa: E501 - self._password = password + self._password = ( + password) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py b/samples/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py index 7c8d921a2d8..8744de38344 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py @@ -32,25 +32,32 @@ class HasOnlyReadOnly(object): """ openapi_types = { 'bar': 'str', - 'foo': 'str' + 'foo': 'str', } attribute_map = { - 'bar': 'bar', - 'foo': 'foo' + 'bar': 'bar', # noqa: E501 + 'foo': 'foo', # noqa: E501 } def __init__(self, bar=None, foo=None): # noqa: E501 - """HasOnlyReadOnly - a model defined in OpenAPI""" # noqa: E501 + """HasOnlyReadOnly - a model defined in OpenAPI + + + + Keyword Args: + bar (str): [optional] # noqa: E501 + foo (str): [optional] # noqa: E501 + """ self._bar = None self._foo = None self.discriminator = None if bar is not None: - self.bar = bar + self.bar = bar # noqa: E501 if foo is not None: - self.foo = foo + self.foo = foo # noqa: E501 @property def bar(self): @@ -63,7 +70,9 @@ class HasOnlyReadOnly(object): return self._bar @bar.setter - def bar(self, bar): + def bar( + self, + bar): """Sets the bar of this HasOnlyReadOnly. @@ -71,7 +80,8 @@ class HasOnlyReadOnly(object): :type: str """ - self._bar = bar + self._bar = ( + bar) @property def foo(self): @@ -84,7 +94,9 @@ class HasOnlyReadOnly(object): return self._foo @foo.setter - def foo(self, foo): + def foo( + self, + foo): """Sets the foo of this HasOnlyReadOnly. @@ -92,7 +104,8 @@ class HasOnlyReadOnly(object): :type: str """ - self._foo = foo + self._foo = ( + foo) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/list.py b/samples/client/petstore/python-experimental/petstore_api/models/list.py index 74fc3719aa0..14b9a656175 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/list.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/list.py @@ -31,21 +31,27 @@ class List(object): and the value is json key in definition. """ openapi_types = { - '_123_list': 'str' + '_123_list': 'str', } attribute_map = { - '_123_list': '123-list' + '_123_list': '123-list', # noqa: E501 } def __init__(self, _123_list=None): # noqa: E501 - """List - a model defined in OpenAPI""" # noqa: E501 + """List - a model defined in OpenAPI + + + + Keyword Args: + _123_list (str): [optional] # noqa: E501 + """ self.__123_list = None self.discriminator = None if _123_list is not None: - self._123_list = _123_list + self._123_list = _123_list # noqa: E501 @property def _123_list(self): @@ -58,7 +64,9 @@ class List(object): return self.__123_list @_123_list.setter - def _123_list(self, _123_list): + def _123_list( + self, + _123_list): """Sets the _123_list of this List. @@ -66,7 +74,8 @@ class List(object): :type: str """ - self.__123_list = _123_list + self.__123_list = ( + _123_list) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/map_test.py b/samples/client/petstore/python-experimental/petstore_api/models/map_test.py index cdfb9365297..d6d975f16e6 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/map_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/map_test.py @@ -34,18 +34,27 @@ class MapTest(object): 'map_map_of_string': 'dict(str, dict(str, str))', 'map_of_enum_string': 'dict(str, str)', 'direct_map': 'dict(str, bool)', - 'indirect_map': 'dict(str, bool)' + 'indirect_map': 'dict(str, bool)', } attribute_map = { - 'map_map_of_string': 'map_map_of_string', - 'map_of_enum_string': 'map_of_enum_string', - 'direct_map': 'direct_map', - 'indirect_map': 'indirect_map' + 'map_map_of_string': 'map_map_of_string', # noqa: E501 + 'map_of_enum_string': 'map_of_enum_string', # noqa: E501 + 'direct_map': 'direct_map', # noqa: E501 + 'indirect_map': 'indirect_map', # noqa: E501 } def __init__(self, map_map_of_string=None, map_of_enum_string=None, direct_map=None, indirect_map=None): # noqa: E501 - """MapTest - a model defined in OpenAPI""" # noqa: E501 + """MapTest - a model defined in OpenAPI + + + + Keyword Args: + map_map_of_string (dict(str, dict(str, str))): [optional] # noqa: E501 + map_of_enum_string (dict(str, str)): [optional] # noqa: E501 + direct_map (dict(str, bool)): [optional] # noqa: E501 + indirect_map (dict(str, bool)): [optional] # noqa: E501 + """ self._map_map_of_string = None self._map_of_enum_string = None @@ -54,13 +63,13 @@ class MapTest(object): self.discriminator = None if map_map_of_string is not None: - self.map_map_of_string = map_map_of_string + self.map_map_of_string = map_map_of_string # noqa: E501 if map_of_enum_string is not None: - self.map_of_enum_string = map_of_enum_string + self.map_of_enum_string = map_of_enum_string # noqa: E501 if direct_map is not None: - self.direct_map = direct_map + self.direct_map = direct_map # noqa: E501 if indirect_map is not None: - self.indirect_map = indirect_map + self.indirect_map = indirect_map # noqa: E501 @property def map_map_of_string(self): @@ -73,7 +82,9 @@ class MapTest(object): return self._map_map_of_string @map_map_of_string.setter - def map_map_of_string(self, map_map_of_string): + def map_map_of_string( + self, + map_map_of_string): """Sets the map_map_of_string of this MapTest. @@ -81,7 +92,8 @@ class MapTest(object): :type: dict(str, dict(str, str)) """ - self._map_map_of_string = map_map_of_string + self._map_map_of_string = ( + map_map_of_string) @property def map_of_enum_string(self): @@ -94,7 +106,9 @@ class MapTest(object): return self._map_of_enum_string @map_of_enum_string.setter - def map_of_enum_string(self, map_of_enum_string): + def map_of_enum_string( + self, + map_of_enum_string): """Sets the map_of_enum_string of this MapTest. @@ -109,7 +123,8 @@ class MapTest(object): ", ".join(map(str, allowed_values))) ) - self._map_of_enum_string = map_of_enum_string + self._map_of_enum_string = ( + map_of_enum_string) @property def direct_map(self): @@ -122,7 +137,9 @@ class MapTest(object): return self._direct_map @direct_map.setter - def direct_map(self, direct_map): + def direct_map( + self, + direct_map): """Sets the direct_map of this MapTest. @@ -130,7 +147,8 @@ class MapTest(object): :type: dict(str, bool) """ - self._direct_map = direct_map + self._direct_map = ( + direct_map) @property def indirect_map(self): @@ -143,7 +161,9 @@ class MapTest(object): return self._indirect_map @indirect_map.setter - def indirect_map(self, indirect_map): + def indirect_map( + self, + indirect_map): """Sets the indirect_map of this MapTest. @@ -151,7 +171,8 @@ class MapTest(object): :type: dict(str, bool) """ - self._indirect_map = indirect_map + self._indirect_map = ( + indirect_map) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py index 41a916eac10..ac8d5626fbf 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -33,17 +33,25 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): openapi_types = { 'uuid': 'str', 'date_time': 'datetime', - 'map': 'dict(str, Animal)' + 'map': 'dict(str, Animal)', } attribute_map = { - 'uuid': 'uuid', - 'date_time': 'dateTime', - 'map': 'map' + 'uuid': 'uuid', # noqa: E501 + 'date_time': 'dateTime', # noqa: E501 + 'map': 'map', # noqa: E501 } def __init__(self, uuid=None, date_time=None, map=None): # noqa: E501 - """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI""" # noqa: E501 + """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI + + + + Keyword Args: + uuid (str): [optional] # noqa: E501 + date_time (datetime): [optional] # noqa: E501 + map (dict(str, Animal)): [optional] # noqa: E501 + """ self._uuid = None self._date_time = None @@ -51,11 +59,11 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): self.discriminator = None if uuid is not None: - self.uuid = uuid + self.uuid = uuid # noqa: E501 if date_time is not None: - self.date_time = date_time + self.date_time = date_time # noqa: E501 if map is not None: - self.map = map + self.map = map # noqa: E501 @property def uuid(self): @@ -68,7 +76,9 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): return self._uuid @uuid.setter - def uuid(self, uuid): + def uuid( + self, + uuid): """Sets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. @@ -76,7 +86,8 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): :type: str """ - self._uuid = uuid + self._uuid = ( + uuid) @property def date_time(self): @@ -89,7 +100,9 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): return self._date_time @date_time.setter - def date_time(self, date_time): + def date_time( + self, + date_time): """Sets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. @@ -97,7 +110,8 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): :type: datetime """ - self._date_time = date_time + self._date_time = ( + date_time) @property def map(self): @@ -110,7 +124,9 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): return self._map @map.setter - def map(self, map): + def map( + self, + map): """Sets the map of this MixedPropertiesAndAdditionalPropertiesClass. @@ -118,7 +134,8 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): :type: dict(str, Animal) """ - self._map = map + self._map = ( + map) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/model200_response.py b/samples/client/petstore/python-experimental/petstore_api/models/model200_response.py index 563b82b5939..cec843833ad 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/model200_response.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/model200_response.py @@ -32,25 +32,32 @@ class Model200Response(object): """ openapi_types = { 'name': 'int', - '_class': 'str' + '_class': 'str', } attribute_map = { - 'name': 'name', - '_class': 'class' + 'name': 'name', # noqa: E501 + '_class': 'class', # noqa: E501 } def __init__(self, name=None, _class=None): # noqa: E501 - """Model200Response - a model defined in OpenAPI""" # noqa: E501 + """Model200Response - a model defined in OpenAPI + + + + Keyword Args: + name (int): [optional] # noqa: E501 + _class (str): [optional] # noqa: E501 + """ self._name = None self.__class = None self.discriminator = None if name is not None: - self.name = name + self.name = name # noqa: E501 if _class is not None: - self._class = _class + self._class = _class # noqa: E501 @property def name(self): @@ -63,7 +70,9 @@ class Model200Response(object): return self._name @name.setter - def name(self, name): + def name( + self, + name): """Sets the name of this Model200Response. @@ -71,7 +80,8 @@ class Model200Response(object): :type: int """ - self._name = name + self._name = ( + name) @property def _class(self): @@ -84,7 +94,9 @@ class Model200Response(object): return self.__class @_class.setter - def _class(self, _class): + def _class( + self, + _class): """Sets the _class of this Model200Response. @@ -92,7 +104,8 @@ class Model200Response(object): :type: str """ - self.__class = _class + self.__class = ( + _class) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/model_return.py b/samples/client/petstore/python-experimental/petstore_api/models/model_return.py index 09801201598..3c8096b7c45 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/model_return.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/model_return.py @@ -31,21 +31,27 @@ class ModelReturn(object): and the value is json key in definition. """ openapi_types = { - '_return': 'int' + '_return': 'int', } attribute_map = { - '_return': 'return' + '_return': 'return', # noqa: E501 } def __init__(self, _return=None): # noqa: E501 - """ModelReturn - a model defined in OpenAPI""" # noqa: E501 + """ModelReturn - a model defined in OpenAPI + + + + Keyword Args: + _return (int): [optional] # noqa: E501 + """ self.__return = None self.discriminator = None if _return is not None: - self._return = _return + self._return = _return # noqa: E501 @property def _return(self): @@ -58,7 +64,9 @@ class ModelReturn(object): return self.__return @_return.setter - def _return(self, _return): + def _return( + self, + _return): """Sets the _return of this ModelReturn. @@ -66,7 +74,8 @@ class ModelReturn(object): :type: int """ - self.__return = _return + self.__return = ( + _return) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/name.py b/samples/client/petstore/python-experimental/petstore_api/models/name.py index 43014d0fb64..9d1814c670f 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/name.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/name.py @@ -34,18 +34,27 @@ class Name(object): 'name': 'int', 'snake_case': 'int', '_property': 'str', - '_123_number': 'int' + '_123_number': 'int', } attribute_map = { - 'name': 'name', - 'snake_case': 'snake_case', - '_property': 'property', - '_123_number': '123Number' + 'name': 'name', # noqa: E501 + 'snake_case': 'snake_case', # noqa: E501 + '_property': 'property', # noqa: E501 + '_123_number': '123Number', # noqa: E501 } - def __init__(self, name=None, snake_case=None, _property=None, _123_number=None): # noqa: E501 - """Name - a model defined in OpenAPI""" # noqa: E501 + def __init__(self, name, snake_case=None, _property=None, _123_number=None): # noqa: E501 + """Name - a model defined in OpenAPI + + Args: + name (int): + + Keyword Args: # noqa: E501 + snake_case (int): [optional] # noqa: E501 + _property (str): [optional] # noqa: E501 + _123_number (int): [optional] # noqa: E501 + """ self._name = None self._snake_case = None @@ -55,11 +64,11 @@ class Name(object): self.name = name if snake_case is not None: - self.snake_case = snake_case + self.snake_case = snake_case # noqa: E501 if _property is not None: - self._property = _property + self._property = _property # noqa: E501 if _123_number is not None: - self._123_number = _123_number + self._123_number = _123_number # noqa: E501 @property def name(self): @@ -72,7 +81,9 @@ class Name(object): return self._name @name.setter - def name(self, name): + def name( + self, + name): """Sets the name of this Name. @@ -82,7 +93,8 @@ class Name(object): if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name + self._name = ( + name) @property def snake_case(self): @@ -95,7 +107,9 @@ class Name(object): return self._snake_case @snake_case.setter - def snake_case(self, snake_case): + def snake_case( + self, + snake_case): """Sets the snake_case of this Name. @@ -103,7 +117,8 @@ class Name(object): :type: int """ - self._snake_case = snake_case + self._snake_case = ( + snake_case) @property def _property(self): @@ -116,7 +131,9 @@ class Name(object): return self.__property @_property.setter - def _property(self, _property): + def _property( + self, + _property): """Sets the _property of this Name. @@ -124,7 +141,8 @@ class Name(object): :type: str """ - self.__property = _property + self.__property = ( + _property) @property def _123_number(self): @@ -137,7 +155,9 @@ class Name(object): return self.__123_number @_123_number.setter - def _123_number(self, _123_number): + def _123_number( + self, + _123_number): """Sets the _123_number of this Name. @@ -145,7 +165,8 @@ class Name(object): :type: int """ - self.__123_number = _123_number + self.__123_number = ( + _123_number) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/number_only.py b/samples/client/petstore/python-experimental/petstore_api/models/number_only.py index b6f3d1c1b65..70741767c49 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/number_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/number_only.py @@ -31,21 +31,27 @@ class NumberOnly(object): and the value is json key in definition. """ openapi_types = { - 'just_number': 'float' + 'just_number': 'float', } attribute_map = { - 'just_number': 'JustNumber' + 'just_number': 'JustNumber', # noqa: E501 } def __init__(self, just_number=None): # noqa: E501 - """NumberOnly - a model defined in OpenAPI""" # noqa: E501 + """NumberOnly - a model defined in OpenAPI + + + + Keyword Args: + just_number (float): [optional] # noqa: E501 + """ self._just_number = None self.discriminator = None if just_number is not None: - self.just_number = just_number + self.just_number = just_number # noqa: E501 @property def just_number(self): @@ -58,7 +64,9 @@ class NumberOnly(object): return self._just_number @just_number.setter - def just_number(self, just_number): + def just_number( + self, + just_number): """Sets the just_number of this NumberOnly. @@ -66,7 +74,8 @@ class NumberOnly(object): :type: float """ - self._just_number = just_number + self._just_number = ( + just_number) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/order.py b/samples/client/petstore/python-experimental/petstore_api/models/order.py index 8b64e3a3583..f1c8220033c 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/order.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/order.py @@ -36,20 +36,31 @@ class Order(object): 'quantity': 'int', 'ship_date': 'datetime', 'status': 'str', - 'complete': 'bool' + 'complete': 'bool', } attribute_map = { - 'id': 'id', - 'pet_id': 'petId', - 'quantity': 'quantity', - 'ship_date': 'shipDate', - 'status': 'status', - 'complete': 'complete' + 'id': 'id', # noqa: E501 + 'pet_id': 'petId', # noqa: E501 + 'quantity': 'quantity', # noqa: E501 + 'ship_date': 'shipDate', # noqa: E501 + 'status': 'status', # noqa: E501 + 'complete': 'complete', # noqa: E501 } - def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=False): # noqa: E501 - """Order - a model defined in OpenAPI""" # noqa: E501 + def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=None): # noqa: E501 + """Order - a model defined in OpenAPI + + + + Keyword Args: + id (int): [optional] # noqa: E501 + pet_id (int): [optional] # noqa: E501 + quantity (int): [optional] # noqa: E501 + ship_date (datetime): [optional] # noqa: E501 + status (str): Order Status. [optional] # noqa: E501 + complete (bool): [optional] if omitted the server will use the default value of False # noqa: E501 + """ self._id = None self._pet_id = None @@ -60,17 +71,17 @@ class Order(object): self.discriminator = None if id is not None: - self.id = id + self.id = id # noqa: E501 if pet_id is not None: - self.pet_id = pet_id + self.pet_id = pet_id # noqa: E501 if quantity is not None: - self.quantity = quantity + self.quantity = quantity # noqa: E501 if ship_date is not None: - self.ship_date = ship_date + self.ship_date = ship_date # noqa: E501 if status is not None: - self.status = status + self.status = status # noqa: E501 if complete is not None: - self.complete = complete + self.complete = complete # noqa: E501 @property def id(self): @@ -83,7 +94,9 @@ class Order(object): return self._id @id.setter - def id(self, id): + def id( + self, + id): """Sets the id of this Order. @@ -91,7 +104,8 @@ class Order(object): :type: int """ - self._id = id + self._id = ( + id) @property def pet_id(self): @@ -104,7 +118,9 @@ class Order(object): return self._pet_id @pet_id.setter - def pet_id(self, pet_id): + def pet_id( + self, + pet_id): """Sets the pet_id of this Order. @@ -112,7 +128,8 @@ class Order(object): :type: int """ - self._pet_id = pet_id + self._pet_id = ( + pet_id) @property def quantity(self): @@ -125,7 +142,9 @@ class Order(object): return self._quantity @quantity.setter - def quantity(self, quantity): + def quantity( + self, + quantity): """Sets the quantity of this Order. @@ -133,7 +152,8 @@ class Order(object): :type: int """ - self._quantity = quantity + self._quantity = ( + quantity) @property def ship_date(self): @@ -146,7 +166,9 @@ class Order(object): return self._ship_date @ship_date.setter - def ship_date(self, ship_date): + def ship_date( + self, + ship_date): """Sets the ship_date of this Order. @@ -154,7 +176,8 @@ class Order(object): :type: datetime """ - self._ship_date = ship_date + self._ship_date = ( + ship_date) @property def status(self): @@ -168,7 +191,9 @@ class Order(object): return self._status @status.setter - def status(self, status): + def status( + self, + status): """Sets the status of this Order. Order Status # noqa: E501 @@ -183,7 +208,8 @@ class Order(object): .format(status, allowed_values) ) - self._status = status + self._status = ( + status) @property def complete(self): @@ -196,7 +222,9 @@ class Order(object): return self._complete @complete.setter - def complete(self, complete): + def complete( + self, + complete): """Sets the complete of this Order. @@ -204,7 +232,8 @@ class Order(object): :type: bool """ - self._complete = complete + self._complete = ( + complete) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py b/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py index dccd67055be..f3887c8a326 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py @@ -33,17 +33,25 @@ class OuterComposite(object): openapi_types = { 'my_number': 'float', 'my_string': 'str', - 'my_boolean': 'bool' + 'my_boolean': 'bool', } attribute_map = { - 'my_number': 'my_number', - 'my_string': 'my_string', - 'my_boolean': 'my_boolean' + 'my_number': 'my_number', # noqa: E501 + 'my_string': 'my_string', # noqa: E501 + 'my_boolean': 'my_boolean', # noqa: E501 } def __init__(self, my_number=None, my_string=None, my_boolean=None): # noqa: E501 - """OuterComposite - a model defined in OpenAPI""" # noqa: E501 + """OuterComposite - a model defined in OpenAPI + + + + Keyword Args: + my_number (float): [optional] # noqa: E501 + my_string (str): [optional] # noqa: E501 + my_boolean (bool): [optional] # noqa: E501 + """ self._my_number = None self._my_string = None @@ -51,11 +59,11 @@ class OuterComposite(object): self.discriminator = None if my_number is not None: - self.my_number = my_number + self.my_number = my_number # noqa: E501 if my_string is not None: - self.my_string = my_string + self.my_string = my_string # noqa: E501 if my_boolean is not None: - self.my_boolean = my_boolean + self.my_boolean = my_boolean # noqa: E501 @property def my_number(self): @@ -68,7 +76,9 @@ class OuterComposite(object): return self._my_number @my_number.setter - def my_number(self, my_number): + def my_number( + self, + my_number): """Sets the my_number of this OuterComposite. @@ -76,7 +86,8 @@ class OuterComposite(object): :type: float """ - self._my_number = my_number + self._my_number = ( + my_number) @property def my_string(self): @@ -89,7 +100,9 @@ class OuterComposite(object): return self._my_string @my_string.setter - def my_string(self, my_string): + def my_string( + self, + my_string): """Sets the my_string of this OuterComposite. @@ -97,7 +110,8 @@ class OuterComposite(object): :type: str """ - self._my_string = my_string + self._my_string = ( + my_string) @property def my_boolean(self): @@ -110,7 +124,9 @@ class OuterComposite(object): return self._my_boolean @my_boolean.setter - def my_boolean(self, my_boolean): + def my_boolean( + self, + my_boolean): """Sets the my_boolean of this OuterComposite. @@ -118,7 +134,8 @@ class OuterComposite(object): :type: bool """ - self._my_boolean = my_boolean + self._my_boolean = ( + my_boolean) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/outer_enum.py b/samples/client/petstore/python-experimental/petstore_api/models/outer_enum.py index a6697a0b152..d042dbe3ceb 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/outer_enum.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/outer_enum.py @@ -44,7 +44,12 @@ class OuterEnum(object): } def __init__(self): # noqa: E501 - """OuterEnum - a model defined in OpenAPI""" # noqa: E501 + """OuterEnum - a model defined in OpenAPI + + + + Keyword Args: + """ self.discriminator = None def to_dict(self): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/pet.py b/samples/client/petstore/python-experimental/petstore_api/models/pet.py index 870608e17ac..a3b12d20c6c 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/pet.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/pet.py @@ -31,25 +31,36 @@ class Pet(object): and the value is json key in definition. """ openapi_types = { - 'id': 'int', - 'category': 'Category', 'name': 'str', 'photo_urls': 'list[str]', + 'id': 'int', + 'category': 'Category', 'tags': 'list[Tag]', - 'status': 'str' + 'status': 'str', } attribute_map = { - 'id': 'id', - 'category': 'category', - 'name': 'name', - 'photo_urls': 'photoUrls', - 'tags': 'tags', - 'status': 'status' + 'name': 'name', # noqa: E501 + 'photo_urls': 'photoUrls', # noqa: E501 + 'id': 'id', # noqa: E501 + 'category': 'category', # noqa: E501 + 'tags': 'tags', # noqa: E501 + 'status': 'status', # noqa: E501 } - def __init__(self, id=None, category=None, name=None, photo_urls=None, tags=None, status=None): # noqa: E501 - """Pet - a model defined in OpenAPI""" # noqa: E501 + def __init__(self, name, photo_urls, id=None, category=None, tags=None, status=None): # noqa: E501 + """Pet - a model defined in OpenAPI + + Args: + name (str): + photo_urls (list[str]): + + Keyword Args: # noqa: E501 # noqa: E501 + id (int): [optional] # noqa: E501 + category (Category): [optional] # noqa: E501 + tags (list[Tag]): [optional] # noqa: E501 + status (str): pet status in the store. [optional] # noqa: E501 + """ self._id = None self._category = None @@ -60,15 +71,15 @@ class Pet(object): self.discriminator = None if id is not None: - self.id = id + self.id = id # noqa: E501 if category is not None: - self.category = category + self.category = category # noqa: E501 self.name = name self.photo_urls = photo_urls if tags is not None: - self.tags = tags + self.tags = tags # noqa: E501 if status is not None: - self.status = status + self.status = status # noqa: E501 @property def id(self): @@ -81,7 +92,9 @@ class Pet(object): return self._id @id.setter - def id(self, id): + def id( + self, + id): """Sets the id of this Pet. @@ -89,7 +102,8 @@ class Pet(object): :type: int """ - self._id = id + self._id = ( + id) @property def category(self): @@ -102,7 +116,9 @@ class Pet(object): return self._category @category.setter - def category(self, category): + def category( + self, + category): """Sets the category of this Pet. @@ -110,7 +126,8 @@ class Pet(object): :type: Category """ - self._category = category + self._category = ( + category) @property def name(self): @@ -123,7 +140,9 @@ class Pet(object): return self._name @name.setter - def name(self, name): + def name( + self, + name): """Sets the name of this Pet. @@ -133,7 +152,8 @@ class Pet(object): if name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - self._name = name + self._name = ( + name) @property def photo_urls(self): @@ -146,7 +166,9 @@ class Pet(object): return self._photo_urls @photo_urls.setter - def photo_urls(self, photo_urls): + def photo_urls( + self, + photo_urls): """Sets the photo_urls of this Pet. @@ -156,7 +178,8 @@ class Pet(object): if photo_urls is None: raise ValueError("Invalid value for `photo_urls`, must not be `None`") # noqa: E501 - self._photo_urls = photo_urls + self._photo_urls = ( + photo_urls) @property def tags(self): @@ -169,7 +192,9 @@ class Pet(object): return self._tags @tags.setter - def tags(self, tags): + def tags( + self, + tags): """Sets the tags of this Pet. @@ -177,7 +202,8 @@ class Pet(object): :type: list[Tag] """ - self._tags = tags + self._tags = ( + tags) @property def status(self): @@ -191,7 +217,9 @@ class Pet(object): return self._status @status.setter - def status(self, status): + def status( + self, + status): """Sets the status of this Pet. pet status in the store # noqa: E501 @@ -206,7 +234,8 @@ class Pet(object): .format(status, allowed_values) ) - self._status = status + self._status = ( + status) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/read_only_first.py b/samples/client/petstore/python-experimental/petstore_api/models/read_only_first.py index 3dfb7c7f626..93f2be29861 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/read_only_first.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/read_only_first.py @@ -32,25 +32,32 @@ class ReadOnlyFirst(object): """ openapi_types = { 'bar': 'str', - 'baz': 'str' + 'baz': 'str', } attribute_map = { - 'bar': 'bar', - 'baz': 'baz' + 'bar': 'bar', # noqa: E501 + 'baz': 'baz', # noqa: E501 } def __init__(self, bar=None, baz=None): # noqa: E501 - """ReadOnlyFirst - a model defined in OpenAPI""" # noqa: E501 + """ReadOnlyFirst - a model defined in OpenAPI + + + + Keyword Args: + bar (str): [optional] # noqa: E501 + baz (str): [optional] # noqa: E501 + """ self._bar = None self._baz = None self.discriminator = None if bar is not None: - self.bar = bar + self.bar = bar # noqa: E501 if baz is not None: - self.baz = baz + self.baz = baz # noqa: E501 @property def bar(self): @@ -63,7 +70,9 @@ class ReadOnlyFirst(object): return self._bar @bar.setter - def bar(self, bar): + def bar( + self, + bar): """Sets the bar of this ReadOnlyFirst. @@ -71,7 +80,8 @@ class ReadOnlyFirst(object): :type: str """ - self._bar = bar + self._bar = ( + bar) @property def baz(self): @@ -84,7 +94,9 @@ class ReadOnlyFirst(object): return self._baz @baz.setter - def baz(self, baz): + def baz( + self, + baz): """Sets the baz of this ReadOnlyFirst. @@ -92,7 +104,8 @@ class ReadOnlyFirst(object): :type: str """ - self._baz = baz + self._baz = ( + baz) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/special_model_name.py b/samples/client/petstore/python-experimental/petstore_api/models/special_model_name.py index 2fd6378fcdc..9eb9757a1d2 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/special_model_name.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/special_model_name.py @@ -31,21 +31,27 @@ class SpecialModelName(object): and the value is json key in definition. """ openapi_types = { - 'special_property_name': 'int' + 'special_property_name': 'int', } attribute_map = { - 'special_property_name': '$special[property.name]' + 'special_property_name': '$special[property.name]', # noqa: E501 } def __init__(self, special_property_name=None): # noqa: E501 - """SpecialModelName - a model defined in OpenAPI""" # noqa: E501 + """SpecialModelName - a model defined in OpenAPI + + + + Keyword Args: + special_property_name (int): [optional] # noqa: E501 + """ self._special_property_name = None self.discriminator = None if special_property_name is not None: - self.special_property_name = special_property_name + self.special_property_name = special_property_name # noqa: E501 @property def special_property_name(self): @@ -58,7 +64,9 @@ class SpecialModelName(object): return self._special_property_name @special_property_name.setter - def special_property_name(self, special_property_name): + def special_property_name( + self, + special_property_name): """Sets the special_property_name of this SpecialModelName. @@ -66,7 +74,8 @@ class SpecialModelName(object): :type: int """ - self._special_property_name = special_property_name + self._special_property_name = ( + special_property_name) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/tag.py b/samples/client/petstore/python-experimental/petstore_api/models/tag.py index cb9c22d9f53..2fbb5adb76b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/tag.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/tag.py @@ -32,25 +32,32 @@ class Tag(object): """ openapi_types = { 'id': 'int', - 'name': 'str' + 'name': 'str', } attribute_map = { - 'id': 'id', - 'name': 'name' + 'id': 'id', # noqa: E501 + 'name': 'name', # noqa: E501 } def __init__(self, id=None, name=None): # noqa: E501 - """Tag - a model defined in OpenAPI""" # noqa: E501 + """Tag - a model defined in OpenAPI + + + + Keyword Args: + id (int): [optional] # noqa: E501 + name (str): [optional] # noqa: E501 + """ self._id = None self._name = None self.discriminator = None if id is not None: - self.id = id + self.id = id # noqa: E501 if name is not None: - self.name = name + self.name = name # noqa: E501 @property def id(self): @@ -63,7 +70,9 @@ class Tag(object): return self._id @id.setter - def id(self, id): + def id( + self, + id): """Sets the id of this Tag. @@ -71,7 +80,8 @@ class Tag(object): :type: int """ - self._id = id + self._id = ( + id) @property def name(self): @@ -84,7 +94,9 @@ class Tag(object): return self._name @name.setter - def name(self, name): + def name( + self, + name): """Sets the name of this Tag. @@ -92,7 +104,8 @@ class Tag(object): :type: str """ - self._name = name + self._name = ( + name) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/type_holder_default.py b/samples/client/petstore/python-experimental/petstore_api/models/type_holder_default.py index d7c207cb5f6..08d1ac6432b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/type_holder_default.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/type_holder_default.py @@ -35,24 +35,42 @@ class TypeHolderDefault(object): 'number_item': 'float', 'integer_item': 'int', 'bool_item': 'bool', - 'array_item': 'list[int]' + 'array_item': 'list[int]', + 'date_item': 'date', + 'datetime_item': 'datetime', } attribute_map = { - 'string_item': 'string_item', - 'number_item': 'number_item', - 'integer_item': 'integer_item', - 'bool_item': 'bool_item', - 'array_item': 'array_item' + 'string_item': 'string_item', # noqa: E501 + 'number_item': 'number_item', # noqa: E501 + 'integer_item': 'integer_item', # noqa: E501 + 'bool_item': 'bool_item', # noqa: E501 + 'array_item': 'array_item', # noqa: E501 + 'date_item': 'date_item', # noqa: E501 + 'datetime_item': 'datetime_item', # noqa: E501 } - def __init__(self, string_item='what', number_item=None, integer_item=None, bool_item=True, array_item=None): # noqa: E501 - """TypeHolderDefault - a model defined in OpenAPI""" # noqa: E501 + def __init__(self, array_item, string_item='what', number_item=1.234, integer_item=-2, bool_item=True, date_item=None, datetime_item=None): # noqa: E501 + """TypeHolderDefault - a model defined in OpenAPI + + Args: + array_item (list[int]): + + Keyword Args: + string_item (str): defaults to 'what', must be one of ['what'] # noqa: E501 + number_item (float): defaults to 1.234, must be one of [1.234] # noqa: E501 + integer_item (int): defaults to -2, must be one of [-2] # noqa: E501 + bool_item (bool): defaults to True, must be one of [True] # noqa: E501 # noqa: E501 + date_item (date): [optional] # noqa: E501 + datetime_item (datetime): [optional] # noqa: E501 + """ self._string_item = None self._number_item = None self._integer_item = None self._bool_item = None + self._date_item = None + self._datetime_item = None self._array_item = None self.discriminator = None @@ -60,6 +78,10 @@ class TypeHolderDefault(object): self.number_item = number_item self.integer_item = integer_item self.bool_item = bool_item + if date_item is not None: + self.date_item = date_item # noqa: E501 + if datetime_item is not None: + self.datetime_item = datetime_item # noqa: E501 self.array_item = array_item @property @@ -73,7 +95,9 @@ class TypeHolderDefault(object): return self._string_item @string_item.setter - def string_item(self, string_item): + def string_item( + self, + string_item): """Sets the string_item of this TypeHolderDefault. @@ -83,7 +107,8 @@ class TypeHolderDefault(object): if string_item is None: raise ValueError("Invalid value for `string_item`, must not be `None`") # noqa: E501 - self._string_item = string_item + self._string_item = ( + string_item) @property def number_item(self): @@ -96,7 +121,9 @@ class TypeHolderDefault(object): return self._number_item @number_item.setter - def number_item(self, number_item): + def number_item( + self, + number_item): """Sets the number_item of this TypeHolderDefault. @@ -106,7 +133,8 @@ class TypeHolderDefault(object): if number_item is None: raise ValueError("Invalid value for `number_item`, must not be `None`") # noqa: E501 - self._number_item = number_item + self._number_item = ( + number_item) @property def integer_item(self): @@ -119,7 +147,9 @@ class TypeHolderDefault(object): return self._integer_item @integer_item.setter - def integer_item(self, integer_item): + def integer_item( + self, + integer_item): """Sets the integer_item of this TypeHolderDefault. @@ -129,7 +159,8 @@ class TypeHolderDefault(object): if integer_item is None: raise ValueError("Invalid value for `integer_item`, must not be `None`") # noqa: E501 - self._integer_item = integer_item + self._integer_item = ( + integer_item) @property def bool_item(self): @@ -142,7 +173,9 @@ class TypeHolderDefault(object): return self._bool_item @bool_item.setter - def bool_item(self, bool_item): + def bool_item( + self, + bool_item): """Sets the bool_item of this TypeHolderDefault. @@ -152,7 +185,56 @@ class TypeHolderDefault(object): if bool_item is None: raise ValueError("Invalid value for `bool_item`, must not be `None`") # noqa: E501 - self._bool_item = bool_item + self._bool_item = ( + bool_item) + + @property + def date_item(self): + """Gets the date_item of this TypeHolderDefault. # noqa: E501 + + + :return: The date_item of this TypeHolderDefault. # noqa: E501 + :rtype: date + """ + return self._date_item + + @date_item.setter + def date_item( + self, + date_item): + """Sets the date_item of this TypeHolderDefault. + + + :param date_item: The date_item of this TypeHolderDefault. # noqa: E501 + :type: date + """ + + self._date_item = ( + date_item) + + @property + def datetime_item(self): + """Gets the datetime_item of this TypeHolderDefault. # noqa: E501 + + + :return: The datetime_item of this TypeHolderDefault. # noqa: E501 + :rtype: datetime + """ + return self._datetime_item + + @datetime_item.setter + def datetime_item( + self, + datetime_item): + """Sets the datetime_item of this TypeHolderDefault. + + + :param datetime_item: The datetime_item of this TypeHolderDefault. # noqa: E501 + :type: datetime + """ + + self._datetime_item = ( + datetime_item) @property def array_item(self): @@ -165,7 +247,9 @@ class TypeHolderDefault(object): return self._array_item @array_item.setter - def array_item(self, array_item): + def array_item( + self, + array_item): """Sets the array_item of this TypeHolderDefault. @@ -175,7 +259,8 @@ class TypeHolderDefault(object): if array_item is None: raise ValueError("Invalid value for `array_item`, must not be `None`") # noqa: E501 - self._array_item = array_item + self._array_item = ( + array_item) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/type_holder_example.py b/samples/client/petstore/python-experimental/petstore_api/models/type_holder_example.py index 8f2b5d6b7d3..96620b8b549 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/type_holder_example.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/type_holder_example.py @@ -35,19 +35,29 @@ class TypeHolderExample(object): 'number_item': 'float', 'integer_item': 'int', 'bool_item': 'bool', - 'array_item': 'list[int]' + 'array_item': 'list[int]', } attribute_map = { - 'string_item': 'string_item', - 'number_item': 'number_item', - 'integer_item': 'integer_item', - 'bool_item': 'bool_item', - 'array_item': 'array_item' + 'string_item': 'string_item', # noqa: E501 + 'number_item': 'number_item', # noqa: E501 + 'integer_item': 'integer_item', # noqa: E501 + 'bool_item': 'bool_item', # noqa: E501 + 'array_item': 'array_item', # noqa: E501 } - def __init__(self, string_item=None, number_item=None, integer_item=None, bool_item=None, array_item=None): # noqa: E501 - """TypeHolderExample - a model defined in OpenAPI""" # noqa: E501 + def __init__(self, bool_item, array_item, string_item='what', number_item=1.234, integer_item=-2): # noqa: E501 + """TypeHolderExample - a model defined in OpenAPI + + Args: + bool_item (bool): + array_item (list[int]): + + Keyword Args: + string_item (str): defaults to 'what', must be one of ['what'] # noqa: E501 + number_item (float): defaults to 1.234, must be one of [1.234] # noqa: E501 + integer_item (int): defaults to -2, must be one of [-2] # noqa: E501 # noqa: E501 # noqa: E501 + """ self._string_item = None self._number_item = None @@ -73,7 +83,9 @@ class TypeHolderExample(object): return self._string_item @string_item.setter - def string_item(self, string_item): + def string_item( + self, + string_item): """Sets the string_item of this TypeHolderExample. @@ -82,8 +94,15 @@ class TypeHolderExample(object): """ if string_item is None: raise ValueError("Invalid value for `string_item`, must not be `None`") # noqa: E501 + allowed_values = ["what"] # noqa: E501 + if string_item not in allowed_values: + raise ValueError( + "Invalid value for `string_item` ({0}), must be one of {1}" # noqa: E501 + .format(string_item, allowed_values) + ) - self._string_item = string_item + self._string_item = ( + string_item) @property def number_item(self): @@ -96,7 +115,9 @@ class TypeHolderExample(object): return self._number_item @number_item.setter - def number_item(self, number_item): + def number_item( + self, + number_item): """Sets the number_item of this TypeHolderExample. @@ -105,8 +126,15 @@ class TypeHolderExample(object): """ if number_item is None: raise ValueError("Invalid value for `number_item`, must not be `None`") # noqa: E501 + allowed_values = [1.234] # noqa: E501 + if number_item not in allowed_values: + raise ValueError( + "Invalid value for `number_item` ({0}), must be one of {1}" # noqa: E501 + .format(number_item, allowed_values) + ) - self._number_item = number_item + self._number_item = ( + number_item) @property def integer_item(self): @@ -119,7 +147,9 @@ class TypeHolderExample(object): return self._integer_item @integer_item.setter - def integer_item(self, integer_item): + def integer_item( + self, + integer_item): """Sets the integer_item of this TypeHolderExample. @@ -128,8 +158,15 @@ class TypeHolderExample(object): """ if integer_item is None: raise ValueError("Invalid value for `integer_item`, must not be `None`") # noqa: E501 + allowed_values = [-2] # noqa: E501 + if integer_item not in allowed_values: + raise ValueError( + "Invalid value for `integer_item` ({0}), must be one of {1}" # noqa: E501 + .format(integer_item, allowed_values) + ) - self._integer_item = integer_item + self._integer_item = ( + integer_item) @property def bool_item(self): @@ -142,7 +179,9 @@ class TypeHolderExample(object): return self._bool_item @bool_item.setter - def bool_item(self, bool_item): + def bool_item( + self, + bool_item): """Sets the bool_item of this TypeHolderExample. @@ -152,7 +191,8 @@ class TypeHolderExample(object): if bool_item is None: raise ValueError("Invalid value for `bool_item`, must not be `None`") # noqa: E501 - self._bool_item = bool_item + self._bool_item = ( + bool_item) @property def array_item(self): @@ -165,7 +205,9 @@ class TypeHolderExample(object): return self._array_item @array_item.setter - def array_item(self, array_item): + def array_item( + self, + array_item): """Sets the array_item of this TypeHolderExample. @@ -175,7 +217,8 @@ class TypeHolderExample(object): if array_item is None: raise ValueError("Invalid value for `array_item`, must not be `None`") # noqa: E501 - self._array_item = array_item + self._array_item = ( + array_item) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/user.py b/samples/client/petstore/python-experimental/petstore_api/models/user.py index f46f5165dfd..382f0cc5fc5 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/user.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/user.py @@ -38,22 +38,35 @@ class User(object): 'email': 'str', 'password': 'str', 'phone': 'str', - 'user_status': 'int' + 'user_status': 'int', } attribute_map = { - 'id': 'id', - 'username': 'username', - 'first_name': 'firstName', - 'last_name': 'lastName', - 'email': 'email', - 'password': 'password', - 'phone': 'phone', - 'user_status': 'userStatus' + 'id': 'id', # noqa: E501 + 'username': 'username', # noqa: E501 + 'first_name': 'firstName', # noqa: E501 + 'last_name': 'lastName', # noqa: E501 + 'email': 'email', # noqa: E501 + 'password': 'password', # noqa: E501 + 'phone': 'phone', # noqa: E501 + 'user_status': 'userStatus', # noqa: E501 } def __init__(self, id=None, username=None, first_name=None, last_name=None, email=None, password=None, phone=None, user_status=None): # noqa: E501 - """User - a model defined in OpenAPI""" # noqa: E501 + """User - a model defined in OpenAPI + + + + Keyword Args: + id (int): [optional] # noqa: E501 + username (str): [optional] # noqa: E501 + first_name (str): [optional] # noqa: E501 + last_name (str): [optional] # noqa: E501 + email (str): [optional] # noqa: E501 + password (str): [optional] # noqa: E501 + phone (str): [optional] # noqa: E501 + user_status (int): User Status. [optional] # noqa: E501 + """ self._id = None self._username = None @@ -66,21 +79,21 @@ class User(object): self.discriminator = None if id is not None: - self.id = id + self.id = id # noqa: E501 if username is not None: - self.username = username + self.username = username # noqa: E501 if first_name is not None: - self.first_name = first_name + self.first_name = first_name # noqa: E501 if last_name is not None: - self.last_name = last_name + self.last_name = last_name # noqa: E501 if email is not None: - self.email = email + self.email = email # noqa: E501 if password is not None: - self.password = password + self.password = password # noqa: E501 if phone is not None: - self.phone = phone + self.phone = phone # noqa: E501 if user_status is not None: - self.user_status = user_status + self.user_status = user_status # noqa: E501 @property def id(self): @@ -93,7 +106,9 @@ class User(object): return self._id @id.setter - def id(self, id): + def id( + self, + id): """Sets the id of this User. @@ -101,7 +116,8 @@ class User(object): :type: int """ - self._id = id + self._id = ( + id) @property def username(self): @@ -114,7 +130,9 @@ class User(object): return self._username @username.setter - def username(self, username): + def username( + self, + username): """Sets the username of this User. @@ -122,7 +140,8 @@ class User(object): :type: str """ - self._username = username + self._username = ( + username) @property def first_name(self): @@ -135,7 +154,9 @@ class User(object): return self._first_name @first_name.setter - def first_name(self, first_name): + def first_name( + self, + first_name): """Sets the first_name of this User. @@ -143,7 +164,8 @@ class User(object): :type: str """ - self._first_name = first_name + self._first_name = ( + first_name) @property def last_name(self): @@ -156,7 +178,9 @@ class User(object): return self._last_name @last_name.setter - def last_name(self, last_name): + def last_name( + self, + last_name): """Sets the last_name of this User. @@ -164,7 +188,8 @@ class User(object): :type: str """ - self._last_name = last_name + self._last_name = ( + last_name) @property def email(self): @@ -177,7 +202,9 @@ class User(object): return self._email @email.setter - def email(self, email): + def email( + self, + email): """Sets the email of this User. @@ -185,7 +212,8 @@ class User(object): :type: str """ - self._email = email + self._email = ( + email) @property def password(self): @@ -198,7 +226,9 @@ class User(object): return self._password @password.setter - def password(self, password): + def password( + self, + password): """Sets the password of this User. @@ -206,7 +236,8 @@ class User(object): :type: str """ - self._password = password + self._password = ( + password) @property def phone(self): @@ -219,7 +250,9 @@ class User(object): return self._phone @phone.setter - def phone(self, phone): + def phone( + self, + phone): """Sets the phone of this User. @@ -227,7 +260,8 @@ class User(object): :type: str """ - self._phone = phone + self._phone = ( + phone) @property def user_status(self): @@ -241,7 +275,9 @@ class User(object): return self._user_status @user_status.setter - def user_status(self, user_status): + def user_status( + self, + user_status): """Sets the user_status of this User. User Status # noqa: E501 @@ -250,7 +286,8 @@ class User(object): :type: int """ - self._user_status = user_status + self._user_status = ( + user_status) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/petstore_api/models/xml_item.py b/samples/client/petstore/python-experimental/petstore_api/models/xml_item.py index eaceeb5ef45..4d9c57350be 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/xml_item.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/xml_item.py @@ -59,43 +59,77 @@ class XmlItem(object): 'prefix_ns_integer': 'int', 'prefix_ns_boolean': 'bool', 'prefix_ns_array': 'list[int]', - 'prefix_ns_wrapped_array': 'list[int]' + 'prefix_ns_wrapped_array': 'list[int]', } 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' + 'attribute_string': 'attribute_string', # noqa: E501 + 'attribute_number': 'attribute_number', # noqa: E501 + 'attribute_integer': 'attribute_integer', # noqa: E501 + 'attribute_boolean': 'attribute_boolean', # noqa: E501 + 'wrapped_array': 'wrapped_array', # noqa: E501 + 'name_string': 'name_string', # noqa: E501 + 'name_number': 'name_number', # noqa: E501 + 'name_integer': 'name_integer', # noqa: E501 + 'name_boolean': 'name_boolean', # noqa: E501 + 'name_array': 'name_array', # noqa: E501 + 'name_wrapped_array': 'name_wrapped_array', # noqa: E501 + 'prefix_string': 'prefix_string', # noqa: E501 + 'prefix_number': 'prefix_number', # noqa: E501 + 'prefix_integer': 'prefix_integer', # noqa: E501 + 'prefix_boolean': 'prefix_boolean', # noqa: E501 + 'prefix_array': 'prefix_array', # noqa: E501 + 'prefix_wrapped_array': 'prefix_wrapped_array', # noqa: E501 + 'namespace_string': 'namespace_string', # noqa: E501 + 'namespace_number': 'namespace_number', # noqa: E501 + 'namespace_integer': 'namespace_integer', # noqa: E501 + 'namespace_boolean': 'namespace_boolean', # noqa: E501 + 'namespace_array': 'namespace_array', # noqa: E501 + 'namespace_wrapped_array': 'namespace_wrapped_array', # noqa: E501 + 'prefix_ns_string': 'prefix_ns_string', # noqa: E501 + 'prefix_ns_number': 'prefix_ns_number', # noqa: E501 + 'prefix_ns_integer': 'prefix_ns_integer', # noqa: E501 + 'prefix_ns_boolean': 'prefix_ns_boolean', # noqa: E501 + 'prefix_ns_array': 'prefix_ns_array', # noqa: E501 + 'prefix_ns_wrapped_array': 'prefix_ns_wrapped_array', # noqa: E501 } def __init__(self, attribute_string=None, attribute_number=None, attribute_integer=None, attribute_boolean=None, wrapped_array=None, name_string=None, name_number=None, name_integer=None, name_boolean=None, name_array=None, name_wrapped_array=None, prefix_string=None, prefix_number=None, prefix_integer=None, prefix_boolean=None, prefix_array=None, prefix_wrapped_array=None, namespace_string=None, namespace_number=None, namespace_integer=None, namespace_boolean=None, namespace_array=None, namespace_wrapped_array=None, prefix_ns_string=None, prefix_ns_number=None, prefix_ns_integer=None, prefix_ns_boolean=None, prefix_ns_array=None, prefix_ns_wrapped_array=None): # noqa: E501 - """XmlItem - a model defined in OpenAPI""" # noqa: E501 + """XmlItem - a model defined in OpenAPI + + + + Keyword Args: + attribute_string (str): [optional] # noqa: E501 + attribute_number (float): [optional] # noqa: E501 + attribute_integer (int): [optional] # noqa: E501 + attribute_boolean (bool): [optional] # noqa: E501 + wrapped_array (list[int]): [optional] # noqa: E501 + name_string (str): [optional] # noqa: E501 + name_number (float): [optional] # noqa: E501 + name_integer (int): [optional] # noqa: E501 + name_boolean (bool): [optional] # noqa: E501 + name_array (list[int]): [optional] # noqa: E501 + name_wrapped_array (list[int]): [optional] # noqa: E501 + prefix_string (str): [optional] # noqa: E501 + prefix_number (float): [optional] # noqa: E501 + prefix_integer (int): [optional] # noqa: E501 + prefix_boolean (bool): [optional] # noqa: E501 + prefix_array (list[int]): [optional] # noqa: E501 + prefix_wrapped_array (list[int]): [optional] # noqa: E501 + namespace_string (str): [optional] # noqa: E501 + namespace_number (float): [optional] # noqa: E501 + namespace_integer (int): [optional] # noqa: E501 + namespace_boolean (bool): [optional] # noqa: E501 + namespace_array (list[int]): [optional] # noqa: E501 + namespace_wrapped_array (list[int]): [optional] # noqa: E501 + prefix_ns_string (str): [optional] # noqa: E501 + prefix_ns_number (float): [optional] # noqa: E501 + prefix_ns_integer (int): [optional] # noqa: E501 + prefix_ns_boolean (bool): [optional] # noqa: E501 + prefix_ns_array (list[int]): [optional] # noqa: E501 + prefix_ns_wrapped_array (list[int]): [optional] # noqa: E501 + """ self._attribute_string = None self._attribute_number = None @@ -129,63 +163,63 @@ class XmlItem(object): self.discriminator = None if attribute_string is not None: - self.attribute_string = attribute_string + self.attribute_string = attribute_string # noqa: E501 if attribute_number is not None: - self.attribute_number = attribute_number + self.attribute_number = attribute_number # noqa: E501 if attribute_integer is not None: - self.attribute_integer = attribute_integer + self.attribute_integer = attribute_integer # noqa: E501 if attribute_boolean is not None: - self.attribute_boolean = attribute_boolean + self.attribute_boolean = attribute_boolean # noqa: E501 if wrapped_array is not None: - self.wrapped_array = wrapped_array + self.wrapped_array = wrapped_array # noqa: E501 if name_string is not None: - self.name_string = name_string + self.name_string = name_string # noqa: E501 if name_number is not None: - self.name_number = name_number + self.name_number = name_number # noqa: E501 if name_integer is not None: - self.name_integer = name_integer + self.name_integer = name_integer # noqa: E501 if name_boolean is not None: - self.name_boolean = name_boolean + self.name_boolean = name_boolean # noqa: E501 if name_array is not None: - self.name_array = name_array + self.name_array = name_array # noqa: E501 if name_wrapped_array is not None: - self.name_wrapped_array = name_wrapped_array + self.name_wrapped_array = name_wrapped_array # noqa: E501 if prefix_string is not None: - self.prefix_string = prefix_string + self.prefix_string = prefix_string # noqa: E501 if prefix_number is not None: - self.prefix_number = prefix_number + self.prefix_number = prefix_number # noqa: E501 if prefix_integer is not None: - self.prefix_integer = prefix_integer + self.prefix_integer = prefix_integer # noqa: E501 if prefix_boolean is not None: - self.prefix_boolean = prefix_boolean + self.prefix_boolean = prefix_boolean # noqa: E501 if prefix_array is not None: - self.prefix_array = prefix_array + self.prefix_array = prefix_array # noqa: E501 if prefix_wrapped_array is not None: - self.prefix_wrapped_array = prefix_wrapped_array + self.prefix_wrapped_array = prefix_wrapped_array # noqa: E501 if namespace_string is not None: - self.namespace_string = namespace_string + self.namespace_string = namespace_string # noqa: E501 if namespace_number is not None: - self.namespace_number = namespace_number + self.namespace_number = namespace_number # noqa: E501 if namespace_integer is not None: - self.namespace_integer = namespace_integer + self.namespace_integer = namespace_integer # noqa: E501 if namespace_boolean is not None: - self.namespace_boolean = namespace_boolean + self.namespace_boolean = namespace_boolean # noqa: E501 if namespace_array is not None: - self.namespace_array = namespace_array + self.namespace_array = namespace_array # noqa: E501 if namespace_wrapped_array is not None: - self.namespace_wrapped_array = namespace_wrapped_array + self.namespace_wrapped_array = namespace_wrapped_array # noqa: E501 if prefix_ns_string is not None: - self.prefix_ns_string = prefix_ns_string + self.prefix_ns_string = prefix_ns_string # noqa: E501 if prefix_ns_number is not None: - self.prefix_ns_number = prefix_ns_number + self.prefix_ns_number = prefix_ns_number # noqa: E501 if prefix_ns_integer is not None: - self.prefix_ns_integer = prefix_ns_integer + self.prefix_ns_integer = prefix_ns_integer # noqa: E501 if prefix_ns_boolean is not None: - self.prefix_ns_boolean = prefix_ns_boolean + self.prefix_ns_boolean = prefix_ns_boolean # noqa: E501 if prefix_ns_array is not None: - self.prefix_ns_array = prefix_ns_array + self.prefix_ns_array = prefix_ns_array # noqa: E501 if prefix_ns_wrapped_array is not None: - self.prefix_ns_wrapped_array = prefix_ns_wrapped_array + self.prefix_ns_wrapped_array = prefix_ns_wrapped_array # noqa: E501 @property def attribute_string(self): @@ -198,7 +232,9 @@ class XmlItem(object): return self._attribute_string @attribute_string.setter - def attribute_string(self, attribute_string): + def attribute_string( + self, + attribute_string): """Sets the attribute_string of this XmlItem. @@ -206,7 +242,8 @@ class XmlItem(object): :type: str """ - self._attribute_string = attribute_string + self._attribute_string = ( + attribute_string) @property def attribute_number(self): @@ -219,7 +256,9 @@ class XmlItem(object): return self._attribute_number @attribute_number.setter - def attribute_number(self, attribute_number): + def attribute_number( + self, + attribute_number): """Sets the attribute_number of this XmlItem. @@ -227,7 +266,8 @@ class XmlItem(object): :type: float """ - self._attribute_number = attribute_number + self._attribute_number = ( + attribute_number) @property def attribute_integer(self): @@ -240,7 +280,9 @@ class XmlItem(object): return self._attribute_integer @attribute_integer.setter - def attribute_integer(self, attribute_integer): + def attribute_integer( + self, + attribute_integer): """Sets the attribute_integer of this XmlItem. @@ -248,7 +290,8 @@ class XmlItem(object): :type: int """ - self._attribute_integer = attribute_integer + self._attribute_integer = ( + attribute_integer) @property def attribute_boolean(self): @@ -261,7 +304,9 @@ class XmlItem(object): return self._attribute_boolean @attribute_boolean.setter - def attribute_boolean(self, attribute_boolean): + def attribute_boolean( + self, + attribute_boolean): """Sets the attribute_boolean of this XmlItem. @@ -269,7 +314,8 @@ class XmlItem(object): :type: bool """ - self._attribute_boolean = attribute_boolean + self._attribute_boolean = ( + attribute_boolean) @property def wrapped_array(self): @@ -282,7 +328,9 @@ class XmlItem(object): return self._wrapped_array @wrapped_array.setter - def wrapped_array(self, wrapped_array): + def wrapped_array( + self, + wrapped_array): """Sets the wrapped_array of this XmlItem. @@ -290,7 +338,8 @@ class XmlItem(object): :type: list[int] """ - self._wrapped_array = wrapped_array + self._wrapped_array = ( + wrapped_array) @property def name_string(self): @@ -303,7 +352,9 @@ class XmlItem(object): return self._name_string @name_string.setter - def name_string(self, name_string): + def name_string( + self, + name_string): """Sets the name_string of this XmlItem. @@ -311,7 +362,8 @@ class XmlItem(object): :type: str """ - self._name_string = name_string + self._name_string = ( + name_string) @property def name_number(self): @@ -324,7 +376,9 @@ class XmlItem(object): return self._name_number @name_number.setter - def name_number(self, name_number): + def name_number( + self, + name_number): """Sets the name_number of this XmlItem. @@ -332,7 +386,8 @@ class XmlItem(object): :type: float """ - self._name_number = name_number + self._name_number = ( + name_number) @property def name_integer(self): @@ -345,7 +400,9 @@ class XmlItem(object): return self._name_integer @name_integer.setter - def name_integer(self, name_integer): + def name_integer( + self, + name_integer): """Sets the name_integer of this XmlItem. @@ -353,7 +410,8 @@ class XmlItem(object): :type: int """ - self._name_integer = name_integer + self._name_integer = ( + name_integer) @property def name_boolean(self): @@ -366,7 +424,9 @@ class XmlItem(object): return self._name_boolean @name_boolean.setter - def name_boolean(self, name_boolean): + def name_boolean( + self, + name_boolean): """Sets the name_boolean of this XmlItem. @@ -374,7 +434,8 @@ class XmlItem(object): :type: bool """ - self._name_boolean = name_boolean + self._name_boolean = ( + name_boolean) @property def name_array(self): @@ -387,7 +448,9 @@ class XmlItem(object): return self._name_array @name_array.setter - def name_array(self, name_array): + def name_array( + self, + name_array): """Sets the name_array of this XmlItem. @@ -395,7 +458,8 @@ class XmlItem(object): :type: list[int] """ - self._name_array = name_array + self._name_array = ( + name_array) @property def name_wrapped_array(self): @@ -408,7 +472,9 @@ class XmlItem(object): return self._name_wrapped_array @name_wrapped_array.setter - def name_wrapped_array(self, name_wrapped_array): + def name_wrapped_array( + self, + name_wrapped_array): """Sets the name_wrapped_array of this XmlItem. @@ -416,7 +482,8 @@ class XmlItem(object): :type: list[int] """ - self._name_wrapped_array = name_wrapped_array + self._name_wrapped_array = ( + name_wrapped_array) @property def prefix_string(self): @@ -429,7 +496,9 @@ class XmlItem(object): return self._prefix_string @prefix_string.setter - def prefix_string(self, prefix_string): + def prefix_string( + self, + prefix_string): """Sets the prefix_string of this XmlItem. @@ -437,7 +506,8 @@ class XmlItem(object): :type: str """ - self._prefix_string = prefix_string + self._prefix_string = ( + prefix_string) @property def prefix_number(self): @@ -450,7 +520,9 @@ class XmlItem(object): return self._prefix_number @prefix_number.setter - def prefix_number(self, prefix_number): + def prefix_number( + self, + prefix_number): """Sets the prefix_number of this XmlItem. @@ -458,7 +530,8 @@ class XmlItem(object): :type: float """ - self._prefix_number = prefix_number + self._prefix_number = ( + prefix_number) @property def prefix_integer(self): @@ -471,7 +544,9 @@ class XmlItem(object): return self._prefix_integer @prefix_integer.setter - def prefix_integer(self, prefix_integer): + def prefix_integer( + self, + prefix_integer): """Sets the prefix_integer of this XmlItem. @@ -479,7 +554,8 @@ class XmlItem(object): :type: int """ - self._prefix_integer = prefix_integer + self._prefix_integer = ( + prefix_integer) @property def prefix_boolean(self): @@ -492,7 +568,9 @@ class XmlItem(object): return self._prefix_boolean @prefix_boolean.setter - def prefix_boolean(self, prefix_boolean): + def prefix_boolean( + self, + prefix_boolean): """Sets the prefix_boolean of this XmlItem. @@ -500,7 +578,8 @@ class XmlItem(object): :type: bool """ - self._prefix_boolean = prefix_boolean + self._prefix_boolean = ( + prefix_boolean) @property def prefix_array(self): @@ -513,7 +592,9 @@ class XmlItem(object): return self._prefix_array @prefix_array.setter - def prefix_array(self, prefix_array): + def prefix_array( + self, + prefix_array): """Sets the prefix_array of this XmlItem. @@ -521,7 +602,8 @@ class XmlItem(object): :type: list[int] """ - self._prefix_array = prefix_array + self._prefix_array = ( + prefix_array) @property def prefix_wrapped_array(self): @@ -534,7 +616,9 @@ class XmlItem(object): return self._prefix_wrapped_array @prefix_wrapped_array.setter - def prefix_wrapped_array(self, prefix_wrapped_array): + def prefix_wrapped_array( + self, + prefix_wrapped_array): """Sets the prefix_wrapped_array of this XmlItem. @@ -542,7 +626,8 @@ class XmlItem(object): :type: list[int] """ - self._prefix_wrapped_array = prefix_wrapped_array + self._prefix_wrapped_array = ( + prefix_wrapped_array) @property def namespace_string(self): @@ -555,7 +640,9 @@ class XmlItem(object): return self._namespace_string @namespace_string.setter - def namespace_string(self, namespace_string): + def namespace_string( + self, + namespace_string): """Sets the namespace_string of this XmlItem. @@ -563,7 +650,8 @@ class XmlItem(object): :type: str """ - self._namespace_string = namespace_string + self._namespace_string = ( + namespace_string) @property def namespace_number(self): @@ -576,7 +664,9 @@ class XmlItem(object): return self._namespace_number @namespace_number.setter - def namespace_number(self, namespace_number): + def namespace_number( + self, + namespace_number): """Sets the namespace_number of this XmlItem. @@ -584,7 +674,8 @@ class XmlItem(object): :type: float """ - self._namespace_number = namespace_number + self._namespace_number = ( + namespace_number) @property def namespace_integer(self): @@ -597,7 +688,9 @@ class XmlItem(object): return self._namespace_integer @namespace_integer.setter - def namespace_integer(self, namespace_integer): + def namespace_integer( + self, + namespace_integer): """Sets the namespace_integer of this XmlItem. @@ -605,7 +698,8 @@ class XmlItem(object): :type: int """ - self._namespace_integer = namespace_integer + self._namespace_integer = ( + namespace_integer) @property def namespace_boolean(self): @@ -618,7 +712,9 @@ class XmlItem(object): return self._namespace_boolean @namespace_boolean.setter - def namespace_boolean(self, namespace_boolean): + def namespace_boolean( + self, + namespace_boolean): """Sets the namespace_boolean of this XmlItem. @@ -626,7 +722,8 @@ class XmlItem(object): :type: bool """ - self._namespace_boolean = namespace_boolean + self._namespace_boolean = ( + namespace_boolean) @property def namespace_array(self): @@ -639,7 +736,9 @@ class XmlItem(object): return self._namespace_array @namespace_array.setter - def namespace_array(self, namespace_array): + def namespace_array( + self, + namespace_array): """Sets the namespace_array of this XmlItem. @@ -647,7 +746,8 @@ class XmlItem(object): :type: list[int] """ - self._namespace_array = namespace_array + self._namespace_array = ( + namespace_array) @property def namespace_wrapped_array(self): @@ -660,7 +760,9 @@ class XmlItem(object): return self._namespace_wrapped_array @namespace_wrapped_array.setter - def namespace_wrapped_array(self, namespace_wrapped_array): + def namespace_wrapped_array( + self, + namespace_wrapped_array): """Sets the namespace_wrapped_array of this XmlItem. @@ -668,7 +770,8 @@ class XmlItem(object): :type: list[int] """ - self._namespace_wrapped_array = namespace_wrapped_array + self._namespace_wrapped_array = ( + namespace_wrapped_array) @property def prefix_ns_string(self): @@ -681,7 +784,9 @@ class XmlItem(object): return self._prefix_ns_string @prefix_ns_string.setter - def prefix_ns_string(self, prefix_ns_string): + def prefix_ns_string( + self, + prefix_ns_string): """Sets the prefix_ns_string of this XmlItem. @@ -689,7 +794,8 @@ class XmlItem(object): :type: str """ - self._prefix_ns_string = prefix_ns_string + self._prefix_ns_string = ( + prefix_ns_string) @property def prefix_ns_number(self): @@ -702,7 +808,9 @@ class XmlItem(object): return self._prefix_ns_number @prefix_ns_number.setter - def prefix_ns_number(self, prefix_ns_number): + def prefix_ns_number( + self, + prefix_ns_number): """Sets the prefix_ns_number of this XmlItem. @@ -710,7 +818,8 @@ class XmlItem(object): :type: float """ - self._prefix_ns_number = prefix_ns_number + self._prefix_ns_number = ( + prefix_ns_number) @property def prefix_ns_integer(self): @@ -723,7 +832,9 @@ class XmlItem(object): return self._prefix_ns_integer @prefix_ns_integer.setter - def prefix_ns_integer(self, prefix_ns_integer): + def prefix_ns_integer( + self, + prefix_ns_integer): """Sets the prefix_ns_integer of this XmlItem. @@ -731,7 +842,8 @@ class XmlItem(object): :type: int """ - self._prefix_ns_integer = prefix_ns_integer + self._prefix_ns_integer = ( + prefix_ns_integer) @property def prefix_ns_boolean(self): @@ -744,7 +856,9 @@ class XmlItem(object): return self._prefix_ns_boolean @prefix_ns_boolean.setter - def prefix_ns_boolean(self, prefix_ns_boolean): + def prefix_ns_boolean( + self, + prefix_ns_boolean): """Sets the prefix_ns_boolean of this XmlItem. @@ -752,7 +866,8 @@ class XmlItem(object): :type: bool """ - self._prefix_ns_boolean = prefix_ns_boolean + self._prefix_ns_boolean = ( + prefix_ns_boolean) @property def prefix_ns_array(self): @@ -765,7 +880,9 @@ class XmlItem(object): return self._prefix_ns_array @prefix_ns_array.setter - def prefix_ns_array(self, prefix_ns_array): + def prefix_ns_array( + self, + prefix_ns_array): """Sets the prefix_ns_array of this XmlItem. @@ -773,7 +890,8 @@ class XmlItem(object): :type: list[int] """ - self._prefix_ns_array = prefix_ns_array + self._prefix_ns_array = ( + prefix_ns_array) @property def prefix_ns_wrapped_array(self): @@ -786,7 +904,9 @@ class XmlItem(object): return self._prefix_ns_wrapped_array @prefix_ns_wrapped_array.setter - def prefix_ns_wrapped_array(self, prefix_ns_wrapped_array): + def prefix_ns_wrapped_array( + self, + prefix_ns_wrapped_array): """Sets the prefix_ns_wrapped_array of this XmlItem. @@ -794,7 +914,8 @@ class XmlItem(object): :type: list[int] """ - self._prefix_ns_wrapped_array = prefix_ns_wrapped_array + self._prefix_ns_wrapped_array = ( + prefix_ns_wrapped_array) def to_dict(self): """Returns the model properties as a dict""" diff --git a/samples/client/petstore/python-experimental/test/test_type_holder_default.py b/samples/client/petstore/python-experimental/test/test_type_holder_default.py index e23ab2a32fc..4cb90d0ed92 100644 --- a/samples/client/petstore/python-experimental/test/test_type_holder_default.py +++ b/samples/client/petstore/python-experimental/test/test_type_holder_default.py @@ -32,15 +32,10 @@ class TestTypeHolderDefault(unittest.TestCase): """Test TypeHolderDefault""" # required_vars are set to None now until swagger-parser/swagger-core fixes # https://github.com/swagger-api/swagger-parser/issues/971 - required_vars = ['number_item', 'integer_item', 'array_item'] - sample_values = [5.67, 4, [-5, 2, -6]] - assigned_variables = {} - for index, required_var in enumerate(required_vars): - with self.assertRaises(ValueError): - model = TypeHolderDefault(**assigned_variables) - assigned_variables[required_var] = sample_values[index] - # assigned_variables is fully set, all required variables passed in - model = TypeHolderDefault(**assigned_variables) + with self.assertRaises(TypeError): + model = TypeHolderDefault() + array_item = [1, 2, 3] + model = TypeHolderDefault(array_item) self.assertEqual(model.string_item, 'what') self.assertEqual(model.bool_item, True) From 8b054e6f8ee05348cb662ff11fbc131949d5071a Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 1 Aug 2019 00:31:58 +0800 Subject: [PATCH 22/75] update spring samples --- samples/client/petstore/spring-cloud-async/pom.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/samples/client/petstore/spring-cloud-async/pom.xml b/samples/client/petstore/spring-cloud-async/pom.xml index 1ee79c2f74d..b14446583fb 100644 --- a/samples/client/petstore/spring-cloud-async/pom.xml +++ b/samples/client/petstore/spring-cloud-async/pom.xml @@ -38,6 +38,12 @@ swagger-annotations ${swagger-core-version} + + + com.google.code.findbugs + jsr305 + 3.0.2 + org.springframework.cloud spring-cloud-starter-openfeign From 0e621dcc29bb3ec79d394ddb9363a8e64a227ee2 Mon Sep 17 00:00:00 2001 From: Erik Seliger Date: Wed, 31 Jul 2019 21:16:49 +0200 Subject: [PATCH 23/75] feat(typescript-angular): add flag for using string enums (#3464) * feat(typescript): add flag for using string enums * fix: adjust templates * fix: repair logic * fix: remove sample * fix: add to v7 sample * fix: remove unneeded lines --- ...etstore-not-provided-in-root-with-npm.json | 5 +++-- docs/generators/typescript-angular.md | 1 + .../AbstractTypeScriptClientCodegen.java | 10 +++++---- .../TypeScriptAngularClientCodegen.java | 21 +++++++++++++++++++ .../typescript-angular/modelEnum.mustache | 13 +++++++++++- .../modelGenericEnums.mustache | 16 +++++++++++++- ...ypeScriptAngularClientOptionsProvider.java | 2 ++ .../TypeScriptAngularClientOptionsTest.java | 2 ++ .../default/model/order.ts | 1 + .../default/model/pet.ts | 1 + .../typescript-angular-v2/npm/model/order.ts | 1 + .../typescript-angular-v2/npm/model/pet.ts | 1 + .../with-interfaces/model/order.ts | 1 + .../with-interfaces/model/pet.ts | 1 + .../npm/model/order.ts | 1 + .../typescript-angular-v4.3/npm/model/pet.ts | 1 + .../typescript-angular-v4/npm/model/order.ts | 1 + .../typescript-angular-v4/npm/model/pet.ts | 1 + .../builds/default/model/order.ts | 1 + .../builds/default/model/pet.ts | 1 + .../builds/with-npm/model/order.ts | 1 + .../builds/with-npm/model/pet.ts | 1 + .../builds/default/model/order.ts | 1 + .../builds/default/model/pet.ts | 1 + .../builds/with-npm/model/order.ts | 1 + .../builds/with-npm/model/pet.ts | 1 + .../builds/default/model/order.ts | 1 + .../builds/default/model/pet.ts | 1 + .../builds/with-npm/model/order.ts | 17 +++++++-------- .../builds/with-npm/model/pet.ts | 17 +++++++-------- .../builds/default/model/order.ts | 1 + .../builds/default/model/pet.ts | 1 + .../builds/with-npm/model/order.ts | 1 + .../builds/with-npm/model/pet.ts | 1 + 34 files changed, 102 insertions(+), 26 deletions(-) diff --git a/bin/typescript-angular-v7-petstore-not-provided-in-root-with-npm.json b/bin/typescript-angular-v7-petstore-not-provided-in-root-with-npm.json index 535bffbd45e..9c939c67ae4 100644 --- a/bin/typescript-angular-v7-petstore-not-provided-in-root-with-npm.json +++ b/bin/typescript-angular-v7-petstore-not-provided-in-root-with-npm.json @@ -1,6 +1,7 @@ { "npmName": "@openapitools/typescript-angular-petstore", "npmVersion": "1.0.0", - "npmRepository" : "https://skimdb.npmjs.com/registry", - "snapshot" : false + "stringEnums": true, + "npmRepository": "https://skimdb.npmjs.com/registry", + "snapshot": false } diff --git a/docs/generators/typescript-angular.md b/docs/generators/typescript-angular.md index 0090d5472bc..c9b6786ea87 100644 --- a/docs/generators/typescript-angular.md +++ b/docs/generators/typescript-angular.md @@ -26,3 +26,4 @@ sidebar_label: typescript-angular |modelSuffix|The suffix of the generated model.| |null| |modelFileSuffix|The suffix of the file of the generated model (model<suffix>.ts).| |null| |fileNaming|Naming convention for the output files: 'camelCase', 'kebab-case'.| |camelCase| +|stringEnums|Generate string enums instead of objects for enum values.| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java index 3646427b27d..b022f73c5f7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java @@ -55,6 +55,9 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp protected String npmName = null; protected String npmVersion = "1.0.0"; + protected String enumSuffix = "Enum"; + protected String classEnumSeparator = "."; + public AbstractTypeScriptClientCodegen() { super(); @@ -551,8 +554,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp @Override public String toEnumName(CodegenProperty property) { - String enumName = toModelName(property.name) + "Enum"; - + String enumName = toModelName(property.name) + enumSuffix; if (enumName.matches("\\d.*")) { // starts with number return "_" + enumName; } else { @@ -571,14 +573,14 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp // name enum with model name, e.g. StatusEnum => Pet.StatusEnum for (CodegenProperty var : cm.vars) { if (Boolean.TRUE.equals(var.isEnum)) { - var.datatypeWithEnum = var.datatypeWithEnum.replace(var.enumName, cm.classname + "." + var.enumName); + var.datatypeWithEnum = var.datatypeWithEnum.replace(var.enumName, cm.classname + classEnumSeparator + var.enumName); } } if (cm.parent != null) { for (CodegenProperty var : cm.allVars) { if (Boolean.TRUE.equals(var.isEnum)) { var.datatypeWithEnum = var.datatypeWithEnum - .replace(var.enumName, cm.classname + "." + var.enumName); + .replace(var.enumName, cm.classname + classEnumSeparator + var.enumName); } } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java index 922628e2438..31c5091b88a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java @@ -49,6 +49,8 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode public static final String MODEL_SUFFIX = "modelSuffix"; public static final String MODEL_FILE_SUFFIX = "modelFileSuffix"; public static final String FILE_NAMING = "fileNaming"; + public static final String STRING_ENUMS = "stringEnums"; + public static final String STRING_ENUMS_DESC = "Generate string enums instead of objects for enum values."; protected String ngVersion = "7.0.0"; protected String npmRepository = null; @@ -57,6 +59,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode protected String modelSuffix = ""; protected String modelFileSuffix = ""; protected String fileNaming = "camelCase"; + protected Boolean stringEnums = false; private boolean taggedUnions = false; @@ -89,6 +92,7 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode this.cliOptions.add(new CliOption(MODEL_SUFFIX, "The suffix of the generated model.")); this.cliOptions.add(new CliOption(MODEL_FILE_SUFFIX, "The suffix of the file of the generated model (model.ts).")); this.cliOptions.add(new CliOption(FILE_NAMING, "Naming convention for the output files: 'camelCase', 'kebab-case'.").defaultValue(this.fileNaming)); + this.cliOptions.add(new CliOption(STRING_ENUMS, STRING_ENUMS_DESC).defaultValue(String.valueOf(this.stringEnums))); } @Override @@ -137,6 +141,15 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode addNpmPackageGeneration(ngVersion); } + if (additionalProperties.containsKey(STRING_ENUMS)) { + setStringEnums(Boolean.valueOf(additionalProperties.get(STRING_ENUMS).toString())); + additionalProperties.put("stringEnums", getStringEnums()); + if (getStringEnums()) { + enumSuffix = ""; + classEnumSeparator = ""; + } + } + if (additionalProperties.containsKey(WITH_INTERFACES)) { boolean withInterfaces = Boolean.parseBoolean(additionalProperties.get(WITH_INTERFACES).toString()); if (withInterfaces) { @@ -272,6 +285,14 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode return indexPackage.replace('.', File.separatorChar); } + public void setStringEnums(boolean value) { + stringEnums = value; + } + + public Boolean getStringEnums() { + return stringEnums; + } + @Override public boolean isDataTypeFile(final String dataType) { return dataType != null && dataType.equals("Blob"); diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/modelEnum.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/modelEnum.mustache index 7ad77ac62a2..4695a611e79 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/modelEnum.mustache @@ -1,3 +1,13 @@ +{{#stringEnums}} +export enum {{classname}} { +{{#allowableValues}} +{{#enumVars}} + {{name}} = {{{value}}}{{^-last}},{{/-last}} +{{/enumVars}} +{{/allowableValues}} +}; +{{/stringEnums}} +{{^stringEnums}} export type {{classname}} = {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}} | {{/-last}}{{/enumVars}}{{/allowableValues}}; export const {{classname}} = { @@ -6,4 +16,5 @@ export const {{classname}} = { {{name}}: {{{value}}} as {{classname}}{{^-last}},{{/-last}} {{/enumVars}} {{/allowableValues}} -}; \ No newline at end of file +}; +{{/stringEnums}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/modelGenericEnums.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/modelGenericEnums.mustache index eb450b57fcc..a824e55ec53 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/modelGenericEnums.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/modelGenericEnums.mustache @@ -1,8 +1,20 @@ {{#hasEnums}} +{{^stringEnums}} export namespace {{classname}} { +{{/stringEnums}} {{#vars}} {{#isEnum}} +{{#stringEnums}} +export enum {{classname}}{{enumName}} { +{{#allowableValues}} +{{#enumVars}} + {{name}} = {{{value}}}{{^-last}},{{/-last}} +{{/enumVars}} +{{/allowableValues}} +}; +{{/stringEnums}} +{{^stringEnums}} export type {{enumName}} = {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}} | {{/-last}}{{/enumVars}}{{/allowableValues}}; export const {{enumName}} = { {{#allowableValues}} @@ -11,6 +23,8 @@ export namespace {{classname}} { {{/enumVars}} {{/allowableValues}} }; +{{/stringEnums}} {{/isEnum}} {{/vars}} -}{{/hasEnums}} \ No newline at end of file +{{^stringEnums}}}{{/stringEnums}} +{{/hasEnums}} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java index 6100c2d4692..d464a532a0e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java @@ -25,6 +25,7 @@ import java.util.Map; public class TypeScriptAngularClientOptionsProvider implements OptionsProvider { public static final String SUPPORTS_ES6_VALUE = "false"; + public static final String STRING_ENUMS_VALUE = "false"; public static final String SORT_PARAMS_VALUE = "false"; public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true"; public static final String MODEL_PROPERTY_NAMING_VALUE = "camelCase"; @@ -52,6 +53,7 @@ public class TypeScriptAngularClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE) .put(CodegenConstants.MODEL_PROPERTY_NAMING, MODEL_PROPERTY_NAMING_VALUE) .put(CodegenConstants.SUPPORTS_ES6, SUPPORTS_ES6_VALUE) + .put(TypeScriptAngularClientCodegen.STRING_ENUMS, STRING_ENUMS_VALUE) .put(TypeScriptAngularClientCodegen.NPM_NAME, NMP_NAME) .put(TypeScriptAngularClientCodegen.NPM_VERSION, NMP_VERSION) .put(TypeScriptAngularClientCodegen.SNAPSHOT, Boolean.FALSE.toString()) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientOptionsTest.java index 91f24924159..e7ab479a537 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientOptionsTest.java @@ -48,6 +48,8 @@ public class TypeScriptAngularClientOptionsTest extends AbstractOptionsTest { times = 1; clientCodegen.setSupportsES6(Boolean.valueOf(TypeScriptAngularClientOptionsProvider.SUPPORTS_ES6_VALUE)); times = 1; + clientCodegen.setStringEnums(Boolean.valueOf(TypeScriptAngularClientOptionsProvider.STRING_ENUMS_VALUE)); + times = 1; clientCodegen.setPrependFormOrBodyParameters(Boolean.valueOf(TypeScriptAngularClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); times = 1; }}; diff --git a/samples/client/petstore/typescript-angular-v2/default/model/order.ts b/samples/client/petstore/typescript-angular-v2/default/model/order.ts index 5a3ccc36e72..c8d8a5e55c0 100644 --- a/samples/client/petstore/typescript-angular-v2/default/model/order.ts +++ b/samples/client/petstore/typescript-angular-v2/default/model/order.ts @@ -34,3 +34,4 @@ export namespace Order { }; } + diff --git a/samples/client/petstore/typescript-angular-v2/default/model/pet.ts b/samples/client/petstore/typescript-angular-v2/default/model/pet.ts index 09db26bf182..e0404395f91 100644 --- a/samples/client/petstore/typescript-angular-v2/default/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v2/default/model/pet.ts @@ -36,3 +36,4 @@ export namespace Pet { }; } + diff --git a/samples/client/petstore/typescript-angular-v2/npm/model/order.ts b/samples/client/petstore/typescript-angular-v2/npm/model/order.ts index 5a3ccc36e72..c8d8a5e55c0 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/model/order.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/model/order.ts @@ -34,3 +34,4 @@ export namespace Order { }; } + diff --git a/samples/client/petstore/typescript-angular-v2/npm/model/pet.ts b/samples/client/petstore/typescript-angular-v2/npm/model/pet.ts index 09db26bf182..e0404395f91 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/model/pet.ts @@ -36,3 +36,4 @@ export namespace Pet { }; } + diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/model/order.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/model/order.ts index 5a3ccc36e72..c8d8a5e55c0 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/model/order.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/model/order.ts @@ -34,3 +34,4 @@ export namespace Order { }; } + diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/model/pet.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/model/pet.ts index 09db26bf182..e0404395f91 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/model/pet.ts @@ -36,3 +36,4 @@ export namespace Pet { }; } + diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/model/order.ts b/samples/client/petstore/typescript-angular-v4.3/npm/model/order.ts index 5a3ccc36e72..c8d8a5e55c0 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/model/order.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/model/order.ts @@ -34,3 +34,4 @@ export namespace Order { }; } + diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/model/pet.ts b/samples/client/petstore/typescript-angular-v4.3/npm/model/pet.ts index 09db26bf182..e0404395f91 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/model/pet.ts @@ -36,3 +36,4 @@ export namespace Pet { }; } + diff --git a/samples/client/petstore/typescript-angular-v4/npm/model/order.ts b/samples/client/petstore/typescript-angular-v4/npm/model/order.ts index 5a3ccc36e72..c8d8a5e55c0 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/model/order.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/model/order.ts @@ -34,3 +34,4 @@ export namespace Order { }; } + diff --git a/samples/client/petstore/typescript-angular-v4/npm/model/pet.ts b/samples/client/petstore/typescript-angular-v4/npm/model/pet.ts index 09db26bf182..e0404395f91 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/model/pet.ts @@ -36,3 +36,4 @@ export namespace Pet { }; } + diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/model/order.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/model/order.ts index 5a3ccc36e72..c8d8a5e55c0 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/model/order.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/model/order.ts @@ -34,3 +34,4 @@ export namespace Order { }; } + diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/model/pet.ts index 09db26bf182..e0404395f91 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/model/pet.ts @@ -36,3 +36,4 @@ export namespace Pet { }; } + diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/model/order.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/model/order.ts index 5a3ccc36e72..c8d8a5e55c0 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/model/order.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/model/order.ts @@ -34,3 +34,4 @@ export namespace Order { }; } + diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/model/pet.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/model/pet.ts index 09db26bf182..e0404395f91 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/model/pet.ts @@ -36,3 +36,4 @@ export namespace Pet { }; } + diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/model/order.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/model/order.ts index 5a3ccc36e72..c8d8a5e55c0 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/model/order.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/model/order.ts @@ -34,3 +34,4 @@ export namespace Order { }; } + diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/model/pet.ts index 09db26bf182..e0404395f91 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/model/pet.ts @@ -36,3 +36,4 @@ export namespace Pet { }; } + diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/model/order.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/model/order.ts index 5a3ccc36e72..c8d8a5e55c0 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/model/order.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/model/order.ts @@ -34,3 +34,4 @@ export namespace Order { }; } + diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/model/pet.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/model/pet.ts index 09db26bf182..e0404395f91 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/model/pet.ts @@ -36,3 +36,4 @@ export namespace Pet { }; } + diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/model/order.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/model/order.ts index 5a3ccc36e72..c8d8a5e55c0 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/model/order.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/model/order.ts @@ -34,3 +34,4 @@ export namespace Order { }; } + diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/model/pet.ts index 09db26bf182..e0404395f91 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/model/pet.ts @@ -36,3 +36,4 @@ export namespace Pet { }; } + diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/model/order.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/model/order.ts index 5a3ccc36e72..1d7860172c6 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/model/order.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/model/order.ts @@ -22,15 +22,14 @@ export interface Order { /** * Order Status */ - status?: Order.StatusEnum; + status?: OrderStatus; complete?: boolean; } -export namespace Order { - export type StatusEnum = 'placed' | 'approved' | 'delivered'; - export const StatusEnum = { - Placed: 'placed' as StatusEnum, - Approved: 'approved' as StatusEnum, - Delivered: 'delivered' as StatusEnum - }; -} +export enum OrderStatus { + Placed = 'placed', + Approved = 'approved', + Delivered = 'delivered' +}; + + diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/model/pet.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/model/pet.ts index 09db26bf182..12e3d9b7591 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/model/pet.ts @@ -25,14 +25,13 @@ export interface Pet { /** * pet status in the store */ - status?: Pet.StatusEnum; -} -export namespace Pet { - export type StatusEnum = 'available' | 'pending' | 'sold'; - export const StatusEnum = { - Available: 'available' as StatusEnum, - Pending: 'pending' as StatusEnum, - Sold: 'sold' as StatusEnum - }; + status?: PetStatus; } +export enum PetStatus { + Available = 'available', + Pending = 'pending', + Sold = 'sold' +}; + + diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/model/order.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/model/order.ts index 5a3ccc36e72..c8d8a5e55c0 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/model/order.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/model/order.ts @@ -34,3 +34,4 @@ export namespace Order { }; } + diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/model/pet.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/model/pet.ts index 09db26bf182..e0404395f91 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/model/pet.ts @@ -36,3 +36,4 @@ export namespace Pet { }; } + diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/model/order.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/model/order.ts index 5a3ccc36e72..c8d8a5e55c0 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/model/order.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/model/order.ts @@ -34,3 +34,4 @@ export namespace Order { }; } + diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/model/pet.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/model/pet.ts index 09db26bf182..e0404395f91 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/model/pet.ts @@ -36,3 +36,4 @@ export namespace Pet { }; } + From f90f2141211b9a5c71b05ffdf41379ebecb156c1 Mon Sep 17 00:00:00 2001 From: Erik Seliger Date: Wed, 31 Jul 2019 22:24:02 +0200 Subject: [PATCH 24/75] fix(typescript-angular): improve small template issues (#3466) * fix(typescript-angular): improve small template issues * fix: template adjustments * fix: repair hasSomeFormParamsLogic * Update modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java Co-Authored-By: Esteban Gehring --- .../TypeScriptAngularClientCodegen.java | 6 ++++ .../typescript-angular/api.service.mustache | 19 +++++++++++ .../typescript-angular/encoder.mustache | 14 ++++---- .../default/api/pet.service.ts | 19 ++--------- .../default/api/store.service.ts | 24 +------------ .../default/api/user.service.ts | 34 +++---------------- .../typescript-angular-v2/default/encoder.ts | 8 ++--- .../npm/api/pet.service.ts | 19 ++--------- .../npm/api/store.service.ts | 24 +------------ .../npm/api/user.service.ts | 34 +++---------------- .../typescript-angular-v2/npm/encoder.ts | 8 ++--- .../with-interfaces/api/pet.service.ts | 19 ++--------- .../with-interfaces/api/store.service.ts | 24 +------------ .../with-interfaces/api/user.service.ts | 34 +++---------------- .../with-interfaces/encoder.ts | 8 ++--- .../npm/api/pet.service.ts | 19 ++--------- .../npm/api/store.service.ts | 24 +------------ .../npm/api/user.service.ts | 34 +++---------------- .../typescript-angular-v4.3/npm/encoder.ts | 6 ++-- .../npm/api/pet.service.ts | 19 ++--------- .../npm/api/store.service.ts | 24 +------------ .../npm/api/user.service.ts | 34 +++---------------- .../typescript-angular-v4/npm/encoder.ts | 8 ++--- .../builds/default/api/pet.service.ts | 19 ++--------- .../builds/default/api/store.service.ts | 24 +------------ .../builds/default/api/user.service.ts | 34 +++---------------- .../builds/default/encoder.ts | 6 ++-- .../builds/with-npm/api/pet.service.ts | 19 ++--------- .../builds/with-npm/api/store.service.ts | 24 +------------ .../builds/with-npm/api/user.service.ts | 34 +++---------------- .../builds/with-npm/encoder.ts | 6 ++-- .../builds/default/api/pet.service.ts | 19 ++--------- .../builds/default/api/store.service.ts | 24 +------------ .../builds/default/api/user.service.ts | 34 +++---------------- .../builds/default/encoder.ts | 6 ++-- .../builds/with-npm/api/pet.service.ts | 19 ++--------- .../builds/with-npm/api/store.service.ts | 24 +------------ .../builds/with-npm/api/user.service.ts | 34 +++---------------- .../builds/with-npm/encoder.ts | 6 ++-- .../builds/default/api/pet.service.ts | 19 ++--------- .../builds/default/api/store.service.ts | 24 +------------ .../builds/default/api/user.service.ts | 34 +++---------------- .../builds/default/encoder.ts | 6 ++-- .../builds/with-npm/api/pet.service.ts | 19 ++--------- .../builds/with-npm/api/store.service.ts | 24 +------------ .../builds/with-npm/api/user.service.ts | 34 +++---------------- .../builds/with-npm/encoder.ts | 6 ++-- .../builds/default/api/pet.service.ts | 19 ++--------- .../builds/default/api/store.service.ts | 24 +------------ .../builds/default/api/user.service.ts | 34 +++---------------- .../builds/default/encoder.ts | 6 ++-- .../builds/with-npm/api/pet.service.ts | 19 ++--------- .../builds/with-npm/api/store.service.ts | 24 +------------ .../builds/with-npm/api/user.service.ts | 34 +++---------------- .../builds/with-npm/encoder.ts | 6 ++-- 55 files changed, 166 insertions(+), 960 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java index 31c5091b88a..8fe22b430cc 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java @@ -352,7 +352,11 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode objs.put("apiFilename", getApiFilenameFromClassname(objs.get("classname").toString())); List ops = (List) objs.get("operation"); + boolean hasSomeFormParams = false; for (CodegenOperation op : ops) { + if (op.getHasFormParams()) { + hasSomeFormParams = true; + } if ((boolean) additionalProperties.get("useHttpClient")) { op.httpMethod = op.httpMethod.toLowerCase(Locale.ENGLISH); } else { @@ -428,6 +432,8 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode op.path = pathBuffer.toString(); } + operations.put("hasSomeFormParams", hasSomeFormParams); + // Add additional filename information for model imports in the services List> imports = (List>) operations.get("imports"); for (Map im : imports) { diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache index 85573aa8b13..96c92290b4e 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache @@ -82,6 +82,7 @@ export class {{classname}} { {{/useHttpClient}} } +{{#hasSomeFormParams}} /** * @param consumes string[] mime-types * @return true: consumes contains 'multipart/form-data', false: otherwise @@ -95,6 +96,7 @@ export class {{classname}} { } return false; } +{{/hasSomeFormParams}} {{^useHttpClient}} {{! Before HttpClient implementation or method overloading we relied on 2 functions, 1 to return the straight body as json @@ -129,8 +131,12 @@ export class {{classname}} { {{#operation}} /** +{{#summary}} * {{summary}} +{{/summary}} +{{#notes}} * {{notes}} +{{/notes}} {{#allParams}}* @param {{paramName}} {{description}} {{/allParams}}{{#useHttpClient}}* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress.{{/useHttpClient}} @@ -256,12 +262,25 @@ export class {{classname}} { {{/useHttpClient}} } +{{#bodyParam}} +{{- duplicated below, don't forget to change}} // to determine the Content-Type header const consumes: string[] = [ {{#consumes}} '{{{mediaType}}}'{{#hasMore}},{{/hasMore}} {{/consumes}} ]; +{{/bodyParam}} +{{#hasFormParams}} +{{^bodyParam}} + // to determine the Content-Type header + const consumes: string[] = [ + {{#consumes}} + '{{{mediaType}}}'{{#hasMore}},{{/hasMore}} + {{/consumes}} + ]; +{{/bodyParam}} +{{/hasFormParams}} {{#bodyParam}} const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/encoder.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/encoder.mustache index b3685b0bd92..c7e5f3cc8da 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/encoder.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/encoder.mustache @@ -7,9 +7,9 @@ import { QueryEncoder } from '@angular/http'; {{#useHttpClient}} /** -* Custom HttpParameterCodec -* Workaround for https://github.com/angular/angular/issues/18261 -*/ + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ export class CustomHttpParameterCodec implements HttpParameterCodec { encodeKey(k: string): string { return encodeURIComponent(k); @@ -27,10 +27,10 @@ export class CustomHttpParameterCodec implements HttpParameterCodec { {{/useHttpClient}} {{^useHttpClient}} /** -* Custom QueryEncoder -* Fix plus sign (+) not encoding, so sent as blank space -* See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 -*/ + * Custom QueryEncoder + * Fix plus sign (+) not encoding, so sent as blank space + * See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 + */ export class CustomQueryEncoderHelper extends QueryEncoder { encodeKey(k: string): string { k = super.encodeKey(k); diff --git a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts index ff2ed68baa6..62bfcb0f689 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts @@ -196,7 +196,6 @@ export class PetService { /** * Add a new pet to the store - * * @param body Pet object that needs to be added to the store */ @@ -223,6 +222,7 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -249,7 +249,6 @@ export class PetService { /** * Deletes a pet - * * @param petId Pet id to delete * @param apiKey @@ -280,9 +279,6 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -333,9 +329,6 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -387,9 +380,6 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -433,9 +423,6 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -452,7 +439,6 @@ export class PetService { /** * Update an existing pet - * * @param body Pet object that needs to be added to the store */ @@ -479,6 +465,7 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -505,7 +492,6 @@ export class PetService { /** * Updates a pet in the store with form data - * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -577,7 +563,6 @@ export class PetService { /** * uploads an image - * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload diff --git a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts index e774b1f93ac..31b3c704691 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts @@ -45,19 +45,6 @@ export class StoreService { this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -144,9 +131,6 @@ export class StoreService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -184,9 +168,6 @@ export class StoreService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -224,9 +205,6 @@ export class StoreService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -243,7 +221,6 @@ export class StoreService { /** * Place an order for a pet - * * @param body order placed for purchasing the pet */ @@ -264,6 +241,7 @@ export class StoreService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts index a1ab3ad5952..42bac67fac3 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts @@ -45,19 +45,6 @@ export class UserService { this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** * This can only be done by the logged in user. @@ -210,6 +197,7 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -234,7 +222,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object */ @@ -253,6 +240,7 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -277,7 +265,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object */ @@ -296,6 +283,7 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -339,9 +327,6 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -358,7 +343,6 @@ export class UserService { /** * Get user by user name - * * @param username The name that needs to be fetched. Use user1 for testing. */ @@ -379,9 +363,6 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -398,7 +379,6 @@ export class UserService { /** * Logs user into the system - * * @param username The user name for login * @param password The password for login in clear text @@ -431,9 +411,6 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -451,7 +428,6 @@ export class UserService { /** * Logs out current logged in user session - * */ public logoutUserWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -466,9 +442,6 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -508,6 +481,7 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v2/default/encoder.ts b/samples/client/petstore/typescript-angular-v2/default/encoder.ts index 2a26942bee0..a0221503f9c 100644 --- a/samples/client/petstore/typescript-angular-v2/default/encoder.ts +++ b/samples/client/petstore/typescript-angular-v2/default/encoder.ts @@ -1,10 +1,10 @@ import { QueryEncoder } from '@angular/http'; /** -* Custom QueryEncoder -* Fix plus sign (+) not encoding, so sent as blank space -* See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 -*/ + * Custom QueryEncoder + * Fix plus sign (+) not encoding, so sent as blank space + * See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 + */ export class CustomQueryEncoderHelper extends QueryEncoder { encodeKey(k: string): string { k = super.encodeKey(k); diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts index ff2ed68baa6..62bfcb0f689 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts @@ -196,7 +196,6 @@ export class PetService { /** * Add a new pet to the store - * * @param body Pet object that needs to be added to the store */ @@ -223,6 +222,7 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -249,7 +249,6 @@ export class PetService { /** * Deletes a pet - * * @param petId Pet id to delete * @param apiKey @@ -280,9 +279,6 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -333,9 +329,6 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -387,9 +380,6 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -433,9 +423,6 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -452,7 +439,6 @@ export class PetService { /** * Update an existing pet - * * @param body Pet object that needs to be added to the store */ @@ -479,6 +465,7 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -505,7 +492,6 @@ export class PetService { /** * Updates a pet in the store with form data - * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -577,7 +563,6 @@ export class PetService { /** * uploads an image - * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts index e774b1f93ac..31b3c704691 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts @@ -45,19 +45,6 @@ export class StoreService { this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -144,9 +131,6 @@ export class StoreService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -184,9 +168,6 @@ export class StoreService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -224,9 +205,6 @@ export class StoreService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -243,7 +221,6 @@ export class StoreService { /** * Place an order for a pet - * * @param body order placed for purchasing the pet */ @@ -264,6 +241,7 @@ export class StoreService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts index a1ab3ad5952..42bac67fac3 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts @@ -45,19 +45,6 @@ export class UserService { this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** * This can only be done by the logged in user. @@ -210,6 +197,7 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -234,7 +222,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object */ @@ -253,6 +240,7 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -277,7 +265,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object */ @@ -296,6 +283,7 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -339,9 +327,6 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -358,7 +343,6 @@ export class UserService { /** * Get user by user name - * * @param username The name that needs to be fetched. Use user1 for testing. */ @@ -379,9 +363,6 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -398,7 +379,6 @@ export class UserService { /** * Logs user into the system - * * @param username The user name for login * @param password The password for login in clear text @@ -431,9 +411,6 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -451,7 +428,6 @@ export class UserService { /** * Logs out current logged in user session - * */ public logoutUserWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -466,9 +442,6 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -508,6 +481,7 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v2/npm/encoder.ts b/samples/client/petstore/typescript-angular-v2/npm/encoder.ts index 2a26942bee0..a0221503f9c 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/encoder.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/encoder.ts @@ -1,10 +1,10 @@ import { QueryEncoder } from '@angular/http'; /** -* Custom QueryEncoder -* Fix plus sign (+) not encoding, so sent as blank space -* See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 -*/ + * Custom QueryEncoder + * Fix plus sign (+) not encoding, so sent as blank space + * See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 + */ export class CustomQueryEncoderHelper extends QueryEncoder { encodeKey(k: string): string { k = super.encodeKey(k); diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts index 5f26d9ad2b8..7aebfe5fef4 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts @@ -197,7 +197,6 @@ export class PetService implements PetServiceInterface { /** * Add a new pet to the store - * * @param body Pet object that needs to be added to the store */ @@ -224,6 +223,7 @@ export class PetService implements PetServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -250,7 +250,6 @@ export class PetService implements PetServiceInterface { /** * Deletes a pet - * * @param petId Pet id to delete * @param apiKey @@ -281,9 +280,6 @@ export class PetService implements PetServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -334,9 +330,6 @@ export class PetService implements PetServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -388,9 +381,6 @@ export class PetService implements PetServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -434,9 +424,6 @@ export class PetService implements PetServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -453,7 +440,6 @@ export class PetService implements PetServiceInterface { /** * Update an existing pet - * * @param body Pet object that needs to be added to the store */ @@ -480,6 +466,7 @@ export class PetService implements PetServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -506,7 +493,6 @@ export class PetService implements PetServiceInterface { /** * Updates a pet in the store with form data - * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -578,7 +564,6 @@ export class PetService implements PetServiceInterface { /** * uploads an image - * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts index f048d9575ec..7fdd6d03883 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts @@ -46,19 +46,6 @@ export class StoreService implements StoreServiceInterface { this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -145,9 +132,6 @@ export class StoreService implements StoreServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -185,9 +169,6 @@ export class StoreService implements StoreServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -225,9 +206,6 @@ export class StoreService implements StoreServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -244,7 +222,6 @@ export class StoreService implements StoreServiceInterface { /** * Place an order for a pet - * * @param body order placed for purchasing the pet */ @@ -265,6 +242,7 @@ export class StoreService implements StoreServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts index d89810de1ea..d852fae20a1 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts @@ -46,19 +46,6 @@ export class UserService implements UserServiceInterface { this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** * This can only be done by the logged in user. @@ -211,6 +198,7 @@ export class UserService implements UserServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -235,7 +223,6 @@ export class UserService implements UserServiceInterface { /** * Creates list of users with given input array - * * @param body List of user object */ @@ -254,6 +241,7 @@ export class UserService implements UserServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -278,7 +266,6 @@ export class UserService implements UserServiceInterface { /** * Creates list of users with given input array - * * @param body List of user object */ @@ -297,6 +284,7 @@ export class UserService implements UserServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -340,9 +328,6 @@ export class UserService implements UserServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -359,7 +344,6 @@ export class UserService implements UserServiceInterface { /** * Get user by user name - * * @param username The name that needs to be fetched. Use user1 for testing. */ @@ -380,9 +364,6 @@ export class UserService implements UserServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -399,7 +380,6 @@ export class UserService implements UserServiceInterface { /** * Logs user into the system - * * @param username The user name for login * @param password The password for login in clear text @@ -432,9 +412,6 @@ export class UserService implements UserServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -452,7 +429,6 @@ export class UserService implements UserServiceInterface { /** * Logs out current logged in user session - * */ public logoutUserWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -467,9 +443,6 @@ export class UserService implements UserServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -509,6 +482,7 @@ export class UserService implements UserServiceInterface { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/encoder.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/encoder.ts index 2a26942bee0..a0221503f9c 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/encoder.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/encoder.ts @@ -1,10 +1,10 @@ import { QueryEncoder } from '@angular/http'; /** -* Custom QueryEncoder -* Fix plus sign (+) not encoding, so sent as blank space -* See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 -*/ + * Custom QueryEncoder + * Fix plus sign (+) not encoding, so sent as blank space + * See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 + */ export class CustomQueryEncoderHelper extends QueryEncoder { encodeKey(k: string): string { k = super.encodeKey(k); diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts index 5cd7568a7b0..52f9e5ee8d9 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts @@ -61,7 +61,6 @@ export class PetService { /** * Add a new pet to the store - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -92,6 +91,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -115,7 +115,6 @@ export class PetService { /** * Deletes a pet - * * @param petId Pet id to delete * @param apiKey * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -150,9 +149,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -204,9 +200,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, { @@ -259,9 +252,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, { @@ -306,9 +296,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -322,7 +309,6 @@ export class PetService { /** * Update an existing pet - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -353,6 +339,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -376,7 +363,6 @@ export class PetService { /** * Updates a pet in the store with form data - * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -445,7 +431,6 @@ export class PetService { /** * uploads an image - * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts index 7f97217dc14..d853a0f4c88 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts @@ -43,19 +43,6 @@ export class StoreService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -83,9 +70,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -124,9 +108,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, { @@ -165,9 +146,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -181,7 +159,6 @@ export class StoreService { /** * Place an order for a pet - * * @param body order placed for purchasing the pet * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -206,6 +183,7 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts index 34379e25ae6..b8f2a9f32d9 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts @@ -43,19 +43,6 @@ export class UserService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -83,6 +70,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -104,7 +92,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -127,6 +114,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -148,7 +136,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -171,6 +158,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -215,9 +203,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -231,7 +216,6 @@ export class UserService { /** * Get user by user name - * * @param username The name that needs to be fetched. Use user1 for testing. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -256,9 +240,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -272,7 +253,6 @@ export class UserService { /** * Logs user into the system - * * @param username The user name for login * @param password The password for login in clear text * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -309,9 +289,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/login`, { @@ -326,7 +303,6 @@ export class UserService { /** * Logs out current logged in user session - * * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ @@ -345,9 +321,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/logout`, { @@ -388,6 +361,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/encoder.ts b/samples/client/petstore/typescript-angular-v4.3/npm/encoder.ts index f3e504196f0..cbefb4a6dd9 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/encoder.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/encoder.ts @@ -1,9 +1,9 @@ import { HttpParameterCodec } from '@angular/common/http'; /** -* Custom HttpParameterCodec -* Workaround for https://github.com/angular/angular/issues/18261 -*/ + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ export class CustomHttpParameterCodec implements HttpParameterCodec { encodeKey(k: string): string { return encodeURIComponent(k); diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts index ff2ed68baa6..62bfcb0f689 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts @@ -196,7 +196,6 @@ export class PetService { /** * Add a new pet to the store - * * @param body Pet object that needs to be added to the store */ @@ -223,6 +222,7 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -249,7 +249,6 @@ export class PetService { /** * Deletes a pet - * * @param petId Pet id to delete * @param apiKey @@ -280,9 +279,6 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -333,9 +329,6 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -387,9 +380,6 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -433,9 +423,6 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -452,7 +439,6 @@ export class PetService { /** * Update an existing pet - * * @param body Pet object that needs to be added to the store */ @@ -479,6 +465,7 @@ export class PetService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -505,7 +492,6 @@ export class PetService { /** * Updates a pet in the store with form data - * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -577,7 +563,6 @@ export class PetService { /** * uploads an image - * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts index e774b1f93ac..31b3c704691 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts @@ -45,19 +45,6 @@ export class StoreService { this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -144,9 +131,6 @@ export class StoreService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -184,9 +168,6 @@ export class StoreService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -224,9 +205,6 @@ export class StoreService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -243,7 +221,6 @@ export class StoreService { /** * Place an order for a pet - * * @param body order placed for purchasing the pet */ @@ -264,6 +241,7 @@ export class StoreService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts index a1ab3ad5952..42bac67fac3 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts @@ -45,19 +45,6 @@ export class UserService { this.encoder = this.configuration.encoder || new CustomQueryEncoderHelper(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** * This can only be done by the logged in user. @@ -210,6 +197,7 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -234,7 +222,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object */ @@ -253,6 +240,7 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -277,7 +265,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object */ @@ -296,6 +283,7 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -339,9 +327,6 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Delete, @@ -358,7 +343,6 @@ export class UserService { /** * Get user by user name - * * @param username The name that needs to be fetched. Use user1 for testing. */ @@ -379,9 +363,6 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -398,7 +379,6 @@ export class UserService { /** * Logs user into the system - * * @param username The user name for login * @param password The password for login in clear text @@ -431,9 +411,6 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -451,7 +428,6 @@ export class UserService { /** * Logs out current logged in user session - * */ public logoutUserWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable { @@ -466,9 +442,6 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; let requestOptions: RequestOptionsArgs = new RequestOptions({ method: RequestMethod.Get, @@ -508,6 +481,7 @@ export class UserService { headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v4/npm/encoder.ts b/samples/client/petstore/typescript-angular-v4/npm/encoder.ts index 2a26942bee0..a0221503f9c 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/encoder.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/encoder.ts @@ -1,10 +1,10 @@ import { QueryEncoder } from '@angular/http'; /** -* Custom QueryEncoder -* Fix plus sign (+) not encoding, so sent as blank space -* See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 -*/ + * Custom QueryEncoder + * Fix plus sign (+) not encoding, so sent as blank space + * See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 + */ export class CustomQueryEncoderHelper extends QueryEncoder { encodeKey(k: string): string { k = super.encodeKey(k); diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts index d7085113ed4..989d91b5c02 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts @@ -61,7 +61,6 @@ export class PetService { /** * Add a new pet to the store - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -92,6 +91,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -115,7 +115,6 @@ export class PetService { /** * Deletes a pet - * * @param petId Pet id to delete * @param apiKey * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -150,9 +149,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -204,9 +200,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, { @@ -259,9 +252,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, { @@ -306,9 +296,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -322,7 +309,6 @@ export class PetService { /** * Update an existing pet - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -353,6 +339,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -376,7 +363,6 @@ export class PetService { /** * Updates a pet in the store with form data - * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -445,7 +431,6 @@ export class PetService { /** * uploads an image - * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts index 04d518a1495..97392be5f22 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts @@ -43,19 +43,6 @@ export class StoreService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -83,9 +70,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -124,9 +108,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, { @@ -165,9 +146,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -181,7 +159,6 @@ export class StoreService { /** * Place an order for a pet - * * @param body order placed for purchasing the pet * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -206,6 +183,7 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts index 446f5c51c27..5357ddadaa8 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts @@ -43,19 +43,6 @@ export class UserService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -83,6 +70,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -104,7 +92,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -127,6 +114,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -148,7 +136,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -171,6 +158,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -215,9 +203,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -231,7 +216,6 @@ export class UserService { /** * Get user by user name - * * @param username The name that needs to be fetched. Use user1 for testing. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -256,9 +240,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -272,7 +253,6 @@ export class UserService { /** * Logs user into the system - * * @param username The user name for login * @param password The password for login in clear text * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -309,9 +289,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/login`, { @@ -326,7 +303,6 @@ export class UserService { /** * Logs out current logged in user session - * * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ @@ -345,9 +321,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/logout`, { @@ -388,6 +361,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/encoder.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/encoder.ts index f3e504196f0..cbefb4a6dd9 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/encoder.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/encoder.ts @@ -1,9 +1,9 @@ import { HttpParameterCodec } from '@angular/common/http'; /** -* Custom HttpParameterCodec -* Workaround for https://github.com/angular/angular/issues/18261 -*/ + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ export class CustomHttpParameterCodec implements HttpParameterCodec { encodeKey(k: string): string { return encodeURIComponent(k); diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts index d7085113ed4..989d91b5c02 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -61,7 +61,6 @@ export class PetService { /** * Add a new pet to the store - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -92,6 +91,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -115,7 +115,6 @@ export class PetService { /** * Deletes a pet - * * @param petId Pet id to delete * @param apiKey * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -150,9 +149,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -204,9 +200,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, { @@ -259,9 +252,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, { @@ -306,9 +296,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -322,7 +309,6 @@ export class PetService { /** * Update an existing pet - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -353,6 +339,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -376,7 +363,6 @@ export class PetService { /** * Updates a pet in the store with form data - * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -445,7 +431,6 @@ export class PetService { /** * uploads an image - * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts index 04d518a1495..97392be5f22 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts @@ -43,19 +43,6 @@ export class StoreService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -83,9 +70,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -124,9 +108,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, { @@ -165,9 +146,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -181,7 +159,6 @@ export class StoreService { /** * Place an order for a pet - * * @param body order placed for purchasing the pet * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -206,6 +183,7 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts index 446f5c51c27..5357ddadaa8 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts @@ -43,19 +43,6 @@ export class UserService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -83,6 +70,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -104,7 +92,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -127,6 +114,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -148,7 +136,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -171,6 +158,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -215,9 +203,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -231,7 +216,6 @@ export class UserService { /** * Get user by user name - * * @param username The name that needs to be fetched. Use user1 for testing. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -256,9 +240,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -272,7 +253,6 @@ export class UserService { /** * Logs user into the system - * * @param username The user name for login * @param password The password for login in clear text * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -309,9 +289,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/login`, { @@ -326,7 +303,6 @@ export class UserService { /** * Logs out current logged in user session - * * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ @@ -345,9 +321,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/logout`, { @@ -388,6 +361,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/encoder.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/encoder.ts index f3e504196f0..cbefb4a6dd9 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/encoder.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/encoder.ts @@ -1,9 +1,9 @@ import { HttpParameterCodec } from '@angular/common/http'; /** -* Custom HttpParameterCodec -* Workaround for https://github.com/angular/angular/issues/18261 -*/ + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ export class CustomHttpParameterCodec implements HttpParameterCodec { encodeKey(k: string): string { return encodeURIComponent(k); diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts index de386b6ee40..a0df069e6a4 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts @@ -63,7 +63,6 @@ export class PetService { /** * Add a new pet to the store - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -94,6 +93,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -117,7 +117,6 @@ export class PetService { /** * Deletes a pet - * * @param petId Pet id to delete * @param apiKey * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -152,9 +151,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -206,9 +202,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, { @@ -261,9 +254,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, { @@ -308,9 +298,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -324,7 +311,6 @@ export class PetService { /** * Update an existing pet - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -355,6 +341,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -378,7 +365,6 @@ export class PetService { /** * Updates a pet in the store with form data - * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -447,7 +433,6 @@ export class PetService { /** * uploads an image - * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts index 2fa5e819b06..6264d975e00 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts @@ -45,19 +45,6 @@ export class StoreService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -85,9 +72,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -126,9 +110,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, { @@ -167,9 +148,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -183,7 +161,6 @@ export class StoreService { /** * Place an order for a pet - * * @param body order placed for purchasing the pet * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -208,6 +185,7 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts index c86088f8a6a..a85d8564995 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts @@ -45,19 +45,6 @@ export class UserService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -85,6 +72,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -106,7 +94,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -129,6 +116,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -150,7 +138,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -173,6 +160,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -217,9 +205,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -233,7 +218,6 @@ export class UserService { /** * Get user by user name - * * @param username The name that needs to be fetched. Use user1 for testing. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -258,9 +242,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -274,7 +255,6 @@ export class UserService { /** * Logs user into the system - * * @param username The user name for login * @param password The password for login in clear text * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -311,9 +291,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/login`, { @@ -328,7 +305,6 @@ export class UserService { /** * Logs out current logged in user session - * * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ @@ -347,9 +323,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/logout`, { @@ -390,6 +363,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/encoder.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/encoder.ts index f3e504196f0..cbefb4a6dd9 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/encoder.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/encoder.ts @@ -1,9 +1,9 @@ import { HttpParameterCodec } from '@angular/common/http'; /** -* Custom HttpParameterCodec -* Workaround for https://github.com/angular/angular/issues/18261 -*/ + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ export class CustomHttpParameterCodec implements HttpParameterCodec { encodeKey(k: string): string { return encodeURIComponent(k); diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts index de386b6ee40..a0df069e6a4 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts @@ -63,7 +63,6 @@ export class PetService { /** * Add a new pet to the store - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -94,6 +93,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -117,7 +117,6 @@ export class PetService { /** * Deletes a pet - * * @param petId Pet id to delete * @param apiKey * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -152,9 +151,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -206,9 +202,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, { @@ -261,9 +254,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, { @@ -308,9 +298,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -324,7 +311,6 @@ export class PetService { /** * Update an existing pet - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -355,6 +341,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -378,7 +365,6 @@ export class PetService { /** * Updates a pet in the store with form data - * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -447,7 +433,6 @@ export class PetService { /** * uploads an image - * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts index 2fa5e819b06..6264d975e00 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts @@ -45,19 +45,6 @@ export class StoreService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -85,9 +72,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -126,9 +110,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, { @@ -167,9 +148,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -183,7 +161,6 @@ export class StoreService { /** * Place an order for a pet - * * @param body order placed for purchasing the pet * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -208,6 +185,7 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts index c86088f8a6a..a85d8564995 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts @@ -45,19 +45,6 @@ export class UserService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -85,6 +72,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -106,7 +94,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -129,6 +116,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -150,7 +138,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -173,6 +160,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -217,9 +205,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -233,7 +218,6 @@ export class UserService { /** * Get user by user name - * * @param username The name that needs to be fetched. Use user1 for testing. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -258,9 +242,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -274,7 +255,6 @@ export class UserService { /** * Logs user into the system - * * @param username The user name for login * @param password The password for login in clear text * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -311,9 +291,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/login`, { @@ -328,7 +305,6 @@ export class UserService { /** * Logs out current logged in user session - * * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ @@ -347,9 +323,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/logout`, { @@ -390,6 +363,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/encoder.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/encoder.ts index f3e504196f0..cbefb4a6dd9 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/encoder.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/encoder.ts @@ -1,9 +1,9 @@ import { HttpParameterCodec } from '@angular/common/http'; /** -* Custom HttpParameterCodec -* Workaround for https://github.com/angular/angular/issues/18261 -*/ + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ export class CustomHttpParameterCodec implements HttpParameterCodec { encodeKey(k: string): string { return encodeURIComponent(k); diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts index d7085113ed4..989d91b5c02 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts @@ -61,7 +61,6 @@ export class PetService { /** * Add a new pet to the store - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -92,6 +91,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -115,7 +115,6 @@ export class PetService { /** * Deletes a pet - * * @param petId Pet id to delete * @param apiKey * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -150,9 +149,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -204,9 +200,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, { @@ -259,9 +252,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, { @@ -306,9 +296,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -322,7 +309,6 @@ export class PetService { /** * Update an existing pet - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -353,6 +339,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -376,7 +363,6 @@ export class PetService { /** * Updates a pet in the store with form data - * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -445,7 +431,6 @@ export class PetService { /** * uploads an image - * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts index 04d518a1495..97392be5f22 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts @@ -43,19 +43,6 @@ export class StoreService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -83,9 +70,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -124,9 +108,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, { @@ -165,9 +146,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -181,7 +159,6 @@ export class StoreService { /** * Place an order for a pet - * * @param body order placed for purchasing the pet * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -206,6 +183,7 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts index 446f5c51c27..5357ddadaa8 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts @@ -43,19 +43,6 @@ export class UserService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -83,6 +70,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -104,7 +92,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -127,6 +114,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -148,7 +136,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -171,6 +158,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -215,9 +203,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -231,7 +216,6 @@ export class UserService { /** * Get user by user name - * * @param username The name that needs to be fetched. Use user1 for testing. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -256,9 +240,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -272,7 +253,6 @@ export class UserService { /** * Logs user into the system - * * @param username The user name for login * @param password The password for login in clear text * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -309,9 +289,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/login`, { @@ -326,7 +303,6 @@ export class UserService { /** * Logs out current logged in user session - * * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ @@ -345,9 +321,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/logout`, { @@ -388,6 +361,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/encoder.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/encoder.ts index f3e504196f0..cbefb4a6dd9 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/encoder.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/encoder.ts @@ -1,9 +1,9 @@ import { HttpParameterCodec } from '@angular/common/http'; /** -* Custom HttpParameterCodec -* Workaround for https://github.com/angular/angular/issues/18261 -*/ + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ export class CustomHttpParameterCodec implements HttpParameterCodec { encodeKey(k: string): string { return encodeURIComponent(k); diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts index d7085113ed4..989d91b5c02 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -61,7 +61,6 @@ export class PetService { /** * Add a new pet to the store - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -92,6 +91,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -115,7 +115,6 @@ export class PetService { /** * Deletes a pet - * * @param petId Pet id to delete * @param apiKey * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -150,9 +149,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -204,9 +200,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, { @@ -259,9 +252,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, { @@ -306,9 +296,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -322,7 +309,6 @@ export class PetService { /** * Update an existing pet - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -353,6 +339,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -376,7 +363,6 @@ export class PetService { /** * Updates a pet in the store with form data - * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -445,7 +431,6 @@ export class PetService { /** * uploads an image - * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts index 04d518a1495..97392be5f22 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts @@ -43,19 +43,6 @@ export class StoreService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -83,9 +70,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -124,9 +108,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, { @@ -165,9 +146,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -181,7 +159,6 @@ export class StoreService { /** * Place an order for a pet - * * @param body order placed for purchasing the pet * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -206,6 +183,7 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts index 446f5c51c27..5357ddadaa8 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts @@ -43,19 +43,6 @@ export class UserService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -83,6 +70,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -104,7 +92,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -127,6 +114,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -148,7 +136,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -171,6 +158,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -215,9 +203,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -231,7 +216,6 @@ export class UserService { /** * Get user by user name - * * @param username The name that needs to be fetched. Use user1 for testing. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -256,9 +240,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -272,7 +253,6 @@ export class UserService { /** * Logs user into the system - * * @param username The user name for login * @param password The password for login in clear text * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -309,9 +289,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/login`, { @@ -326,7 +303,6 @@ export class UserService { /** * Logs out current logged in user session - * * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ @@ -345,9 +321,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/logout`, { @@ -388,6 +361,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/encoder.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/encoder.ts index f3e504196f0..cbefb4a6dd9 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/encoder.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/encoder.ts @@ -1,9 +1,9 @@ import { HttpParameterCodec } from '@angular/common/http'; /** -* Custom HttpParameterCodec -* Workaround for https://github.com/angular/angular/issues/18261 -*/ + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ export class CustomHttpParameterCodec implements HttpParameterCodec { encodeKey(k: string): string { return encodeURIComponent(k); diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts index de386b6ee40..a0df069e6a4 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts @@ -63,7 +63,6 @@ export class PetService { /** * Add a new pet to the store - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -94,6 +93,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -117,7 +117,6 @@ export class PetService { /** * Deletes a pet - * * @param petId Pet id to delete * @param apiKey * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -152,9 +151,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -206,9 +202,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, { @@ -261,9 +254,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, { @@ -308,9 +298,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -324,7 +311,6 @@ export class PetService { /** * Update an existing pet - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -355,6 +341,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -378,7 +365,6 @@ export class PetService { /** * Updates a pet in the store with form data - * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -447,7 +433,6 @@ export class PetService { /** * uploads an image - * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts index 2fa5e819b06..6264d975e00 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts @@ -45,19 +45,6 @@ export class StoreService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -85,9 +72,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -126,9 +110,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, { @@ -167,9 +148,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -183,7 +161,6 @@ export class StoreService { /** * Place an order for a pet - * * @param body order placed for purchasing the pet * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -208,6 +185,7 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts index c86088f8a6a..a85d8564995 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts @@ -45,19 +45,6 @@ export class UserService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -85,6 +72,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -106,7 +94,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -129,6 +116,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -150,7 +138,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -173,6 +160,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -217,9 +205,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -233,7 +218,6 @@ export class UserService { /** * Get user by user name - * * @param username The name that needs to be fetched. Use user1 for testing. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -258,9 +242,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -274,7 +255,6 @@ export class UserService { /** * Logs user into the system - * * @param username The user name for login * @param password The password for login in clear text * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -311,9 +291,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/login`, { @@ -328,7 +305,6 @@ export class UserService { /** * Logs out current logged in user session - * * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ @@ -347,9 +323,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/logout`, { @@ -390,6 +363,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/encoder.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/encoder.ts index f3e504196f0..cbefb4a6dd9 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/encoder.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/encoder.ts @@ -1,9 +1,9 @@ import { HttpParameterCodec } from '@angular/common/http'; /** -* Custom HttpParameterCodec -* Workaround for https://github.com/angular/angular/issues/18261 -*/ + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ export class CustomHttpParameterCodec implements HttpParameterCodec { encodeKey(k: string): string { return encodeURIComponent(k); diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts index de386b6ee40..a0df069e6a4 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts @@ -63,7 +63,6 @@ export class PetService { /** * Add a new pet to the store - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -94,6 +93,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -117,7 +117,6 @@ export class PetService { /** * Deletes a pet - * * @param petId Pet id to delete * @param apiKey * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -152,9 +151,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -206,9 +202,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, { @@ -261,9 +254,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, { @@ -308,9 +298,6 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, { @@ -324,7 +311,6 @@ export class PetService { /** * Update an existing pet - * * @param body Pet object that needs to be added to the store * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -355,6 +341,7 @@ export class PetService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ 'application/json', @@ -378,7 +365,6 @@ export class PetService { /** * Updates a pet in the store with form data - * * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet @@ -447,7 +433,6 @@ export class PetService { /** * uploads an image - * * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts index 2fa5e819b06..6264d975e00 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts @@ -45,19 +45,6 @@ export class StoreService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -85,9 +72,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -126,9 +110,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, { @@ -167,9 +148,6 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, { @@ -183,7 +161,6 @@ export class StoreService { /** * Place an order for a pet - * * @param body order placed for purchasing the pet * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -208,6 +185,7 @@ export class StoreService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts index c86088f8a6a..a85d8564995 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts @@ -45,19 +45,6 @@ export class UserService { this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } /** @@ -85,6 +72,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -106,7 +94,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -129,6 +116,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -150,7 +138,6 @@ export class UserService { /** * Creates list of users with given input array - * * @param body List of user object * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -173,6 +160,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; @@ -217,9 +205,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -233,7 +218,6 @@ export class UserService { /** * Get user by user name - * * @param username The name that needs to be fetched. Use user1 for testing. * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. @@ -258,9 +242,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, { @@ -274,7 +255,6 @@ export class UserService { /** * Logs user into the system - * * @param username The user name for login * @param password The password for login in clear text * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. @@ -311,9 +291,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/login`, { @@ -328,7 +305,6 @@ export class UserService { /** * Logs out current logged in user session - * * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ @@ -347,9 +323,6 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = [ - ]; return this.httpClient.get(`${this.configuration.basePath}/user/logout`, { @@ -390,6 +363,7 @@ export class UserService { headers = headers.set('Accept', httpHeaderAcceptSelected); } + // to determine the Content-Type header const consumes: string[] = [ ]; diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/encoder.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/encoder.ts index f3e504196f0..cbefb4a6dd9 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/encoder.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/encoder.ts @@ -1,9 +1,9 @@ import { HttpParameterCodec } from '@angular/common/http'; /** -* Custom HttpParameterCodec -* Workaround for https://github.com/angular/angular/issues/18261 -*/ + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ export class CustomHttpParameterCodec implements HttpParameterCodec { encodeKey(k: string): string { return encodeURIComponent(k); From bcc3a9ecf79ab3082526bda0ddc5d3900f707cf2 Mon Sep 17 00:00:00 2001 From: Dennis Kliban Date: Wed, 31 Jul 2019 23:08:34 -0400 Subject: [PATCH 25/75] Ruby client faraday (#3405) * WIP: add faraday support to Ruby client * update samples * bin/console * https only * ruby-faraday: Add a gemspec template for faraday * Add a test for ruby-faraday client options * Remove Gemfile.lock from ruby-client-faraday * Implement faraday client * Problem: can't use Faraday library for ruby clients Solution: add support for Faraday library This patch builds on the work started by @meganemura * Problem: Faraday is set as default library Solution: Make Typhoeus default This patch also updates the api_client template for Faraday to include query params with requests. --- bin/ruby-client-petstore-faraday.sh | 32 + bin/ruby-petstore-faraday.json | 5 + bin/ruby-petstore.json | 1 + docs/generators/ruby.md | 3 + .../codegen/languages/RubyClientCodegen.java | 29 +- .../ruby-client/faraday_api_client.mustache | 393 +++++++++ .../ruby-client/faraday_gemspec.mustache | 38 + .../options/RubyClientOptionsProvider.java | 2 + .../client/petstore/ruby-faraday/.gitignore | 39 + .../ruby-faraday/.openapi-generator-ignore | 23 + .../ruby-faraday/.openapi-generator/VERSION | 1 + samples/client/petstore/ruby-faraday/.rspec | 2 + .../client/petstore/ruby-faraday/.rubocop.yml | 154 ++++ samples/client/petstore/ruby-faraday/Gemfile | 8 + .../client/petstore/ruby-faraday/README.md | 180 ++++ samples/client/petstore/ruby-faraday/Rakefile | 10 + .../client/petstore/ruby-faraday/bin/console | 17 + .../docs/AdditionalPropertiesClass.md | 9 + .../petstore/ruby-faraday/docs/Animal.md | 9 + .../petstore/ruby-faraday/docs/AnimalFarm.md | 7 + .../ruby-faraday/docs/AnotherFakeApi.md | 54 ++ .../petstore/ruby-faraday/docs/ApiResponse.md | 10 + .../docs/ArrayOfArrayOfNumberOnly.md | 8 + .../ruby-faraday/docs/ArrayOfNumberOnly.md | 8 + .../petstore/ruby-faraday/docs/ArrayTest.md | 10 + .../ruby-faraday/docs/Capitalization.md | 13 + .../client/petstore/ruby-faraday/docs/Cat.md | 10 + .../petstore/ruby-faraday/docs/Category.md | 9 + .../petstore/ruby-faraday/docs/ClassModel.md | 8 + .../petstore/ruby-faraday/docs/Client.md | 8 + .../client/petstore/ruby-faraday/docs/Dog.md | 10 + .../petstore/ruby-faraday/docs/EnumArrays.md | 9 + .../petstore/ruby-faraday/docs/EnumClass.md | 7 + .../petstore/ruby-faraday/docs/EnumTest.md | 12 + .../petstore/ruby-faraday/docs/FakeApi.md | 615 ++++++++++++++ .../docs/FakeClassnameTags123Api.md | 61 ++ .../client/petstore/ruby-faraday/docs/File.md | 8 + .../ruby-faraday/docs/FileSchemaTestClass.md | 9 + .../petstore/ruby-faraday/docs/FormatTest.md | 20 + .../ruby-faraday/docs/HasOnlyReadOnly.md | 9 + .../client/petstore/ruby-faraday/docs/List.md | 8 + .../petstore/ruby-faraday/docs/MapTest.md | 11 + ...dPropertiesAndAdditionalPropertiesClass.md | 10 + .../ruby-faraday/docs/Model200Response.md | 9 + .../petstore/ruby-faraday/docs/ModelReturn.md | 8 + .../client/petstore/ruby-faraday/docs/Name.md | 11 + .../petstore/ruby-faraday/docs/NumberOnly.md | 8 + .../petstore/ruby-faraday/docs/Order.md | 13 + .../ruby-faraday/docs/OuterComposite.md | 10 + .../petstore/ruby-faraday/docs/OuterEnum.md | 7 + .../client/petstore/ruby-faraday/docs/Pet.md | 13 + .../petstore/ruby-faraday/docs/PetApi.md | 475 +++++++++++ .../ruby-faraday/docs/ReadOnlyFirst.md | 9 + .../ruby-faraday/docs/SpecialModelName.md | 8 + .../petstore/ruby-faraday/docs/StoreApi.md | 192 +++++ .../ruby-faraday/docs/StringBooleanMap.md | 7 + .../client/petstore/ruby-faraday/docs/Tag.md | 9 + .../client/petstore/ruby-faraday/docs/User.md | 15 + .../petstore/ruby-faraday/docs/UserApi.md | 360 ++++++++ .../client/petstore/ruby-faraday/git_push.sh | 55 ++ .../petstore/ruby-faraday/lib/petstore.rb | 81 ++ .../lib/petstore/api/another_fake_api.rb | 78 ++ .../ruby-faraday/lib/petstore/api/fake_api.rb | 803 ++++++++++++++++++ .../api/fake_classname_tags123_api.rb | 78 ++ .../ruby-faraday/lib/petstore/api/pet_api.rb | 513 +++++++++++ .../lib/petstore/api/store_api.rb | 232 +++++ .../ruby-faraday/lib/petstore/api/user_api.rb | 427 ++++++++++ .../ruby-faraday/lib/petstore/api_client.rb | 204 +++++ .../ruby-faraday/lib/petstore/api_error.rb | 38 + .../lib/petstore/configuration.rb | 272 ++++++ .../models/additional_properties_class.rb | 196 +++++ .../lib/petstore/models/animal.rb | 199 +++++ .../lib/petstore/models/animal_farm.rb | 174 ++++ .../lib/petstore/models/api_response.rb | 201 +++++ .../models/array_of_array_of_number_only.rb | 185 ++++ .../petstore/models/array_of_number_only.rb | 185 ++++ .../lib/petstore/models/array_test.rb | 207 +++++ .../lib/petstore/models/capitalization.rb | 229 +++++ .../ruby-faraday/lib/petstore/models/cat.rb | 208 +++++ .../lib/petstore/models/category.rb | 199 +++++ .../lib/petstore/models/class_model.rb | 184 ++++ .../lib/petstore/models/client.rb | 183 ++++ .../ruby-faraday/lib/petstore/models/dog.rb | 208 +++++ .../lib/petstore/models/enum_arrays.rb | 228 +++++ .../lib/petstore/models/enum_class.rb | 31 + .../lib/petstore/models/enum_test.rb | 294 +++++++ .../ruby-faraday/lib/petstore/models/file.rb | 185 ++++ .../petstore/models/file_schema_test_class.rb | 194 +++++ .../lib/petstore/models/format_test.rb | 497 +++++++++++ .../lib/petstore/models/has_only_read_only.rb | 192 +++++ .../ruby-faraday/lib/petstore/models/list.rb | 183 ++++ .../lib/petstore/models/map_test.rb | 240 ++++++ ...perties_and_additional_properties_class.rb | 203 +++++ .../lib/petstore/models/model200_response.rb | 193 +++++ .../lib/petstore/models/model_return.rb | 184 ++++ .../ruby-faraday/lib/petstore/models/name.rb | 216 +++++ .../lib/petstore/models/number_only.rb | 183 ++++ .../ruby-faraday/lib/petstore/models/order.rb | 265 ++++++ .../lib/petstore/models/outer_composite.rb | 201 +++++ .../lib/petstore/models/outer_enum.rb | 31 + .../ruby-faraday/lib/petstore/models/pet.rb | 277 ++++++ .../lib/petstore/models/read_only_first.rb | 192 +++++ .../lib/petstore/models/special_model_name.rb | 183 ++++ .../lib/petstore/models/string_boolean_map.rb | 174 ++++ .../ruby-faraday/lib/petstore/models/tag.rb | 192 +++++ .../ruby-faraday/lib/petstore/models/user.rb | 247 ++++++ .../ruby-faraday/lib/petstore/version.rb | 15 + .../petstore/ruby-faraday/petstore.gemspec | 41 + .../spec/api/another_fake_api_spec.rb | 47 + .../ruby-faraday/spec/api/fake_api_spec.rb | 197 +++++ .../api/fake_classname_tags123_api_spec.rb | 47 + .../ruby-faraday/spec/api/pet_api_spec.rb | 144 ++++ .../ruby-faraday/spec/api/store_api_spec.rb | 81 ++ .../ruby-faraday/spec/api/user_api_spec.rb | 127 +++ .../ruby-faraday/spec/api_client_spec.rb | 226 +++++ .../ruby-faraday/spec/configuration_spec.rb | 42 + .../additional_properties_class_spec.rb | 47 + .../spec/models/animal_farm_spec.rb | 35 + .../ruby-faraday/spec/models/animal_spec.rb | 47 + .../spec/models/api_response_spec.rb | 53 ++ .../array_of_array_of_number_only_spec.rb | 41 + .../spec/models/array_of_number_only_spec.rb | 41 + .../spec/models/array_test_spec.rb | 53 ++ .../spec/models/capitalization_spec.rb | 71 ++ .../ruby-faraday/spec/models/cat_spec.rb | 53 ++ .../ruby-faraday/spec/models/category_spec.rb | 47 + .../spec/models/class_model_spec.rb | 41 + .../ruby-faraday/spec/models/client_spec.rb | 41 + .../ruby-faraday/spec/models/dog_spec.rb | 53 ++ .../spec/models/enum_arrays_spec.rb | 55 ++ .../spec/models/enum_class_spec.rb | 35 + .../spec/models/enum_test_spec.rb | 81 ++ .../models/file_schema_test_class_spec.rb | 47 + .../ruby-faraday/spec/models/file_spec.rb | 41 + .../spec/models/format_test_spec.rb | 113 +++ .../spec/models/has_only_read_only_spec.rb | 47 + .../ruby-faraday/spec/models/list_spec.rb | 41 + .../ruby-faraday/spec/models/map_test_spec.rb | 63 ++ ...es_and_additional_properties_class_spec.rb | 53 ++ .../spec/models/model200_response_spec.rb | 47 + .../spec/models/model_return_spec.rb | 41 + .../ruby-faraday/spec/models/name_spec.rb | 59 ++ .../spec/models/number_only_spec.rb | 41 + .../ruby-faraday/spec/models/order_spec.rb | 75 ++ .../spec/models/outer_composite_spec.rb | 53 ++ .../spec/models/outer_enum_spec.rb | 35 + .../ruby-faraday/spec/models/pet_spec.rb | 75 ++ .../spec/models/read_only_first_spec.rb | 47 + .../spec/models/special_model_name_spec.rb | 41 + .../spec/models/string_boolean_map_spec.rb | 35 + .../ruby-faraday/spec/models/tag_spec.rb | 47 + .../ruby-faraday/spec/models/user_spec.rb | 83 ++ .../petstore/ruby-faraday/spec/spec_helper.rb | 111 +++ 153 files changed, 16118 insertions(+), 5 deletions(-) create mode 100755 bin/ruby-client-petstore-faraday.sh create mode 100644 bin/ruby-petstore-faraday.json create mode 100644 modules/openapi-generator/src/main/resources/ruby-client/faraday_api_client.mustache create mode 100644 modules/openapi-generator/src/main/resources/ruby-client/faraday_gemspec.mustache create mode 100644 samples/client/petstore/ruby-faraday/.gitignore create mode 100644 samples/client/petstore/ruby-faraday/.openapi-generator-ignore create mode 100644 samples/client/petstore/ruby-faraday/.openapi-generator/VERSION create mode 100644 samples/client/petstore/ruby-faraday/.rspec create mode 100644 samples/client/petstore/ruby-faraday/.rubocop.yml create mode 100644 samples/client/petstore/ruby-faraday/Gemfile create mode 100644 samples/client/petstore/ruby-faraday/README.md create mode 100644 samples/client/petstore/ruby-faraday/Rakefile create mode 100755 samples/client/petstore/ruby-faraday/bin/console create mode 100644 samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesClass.md create mode 100644 samples/client/petstore/ruby-faraday/docs/Animal.md create mode 100644 samples/client/petstore/ruby-faraday/docs/AnimalFarm.md create mode 100644 samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/ruby-faraday/docs/ApiResponse.md create mode 100644 samples/client/petstore/ruby-faraday/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/client/petstore/ruby-faraday/docs/ArrayOfNumberOnly.md create mode 100644 samples/client/petstore/ruby-faraday/docs/ArrayTest.md create mode 100644 samples/client/petstore/ruby-faraday/docs/Capitalization.md create mode 100644 samples/client/petstore/ruby-faraday/docs/Cat.md create mode 100644 samples/client/petstore/ruby-faraday/docs/Category.md create mode 100644 samples/client/petstore/ruby-faraday/docs/ClassModel.md create mode 100644 samples/client/petstore/ruby-faraday/docs/Client.md create mode 100644 samples/client/petstore/ruby-faraday/docs/Dog.md create mode 100644 samples/client/petstore/ruby-faraday/docs/EnumArrays.md create mode 100644 samples/client/petstore/ruby-faraday/docs/EnumClass.md create mode 100644 samples/client/petstore/ruby-faraday/docs/EnumTest.md create mode 100644 samples/client/petstore/ruby-faraday/docs/FakeApi.md create mode 100644 samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md create mode 100644 samples/client/petstore/ruby-faraday/docs/File.md create mode 100644 samples/client/petstore/ruby-faraday/docs/FileSchemaTestClass.md create mode 100644 samples/client/petstore/ruby-faraday/docs/FormatTest.md create mode 100644 samples/client/petstore/ruby-faraday/docs/HasOnlyReadOnly.md create mode 100644 samples/client/petstore/ruby-faraday/docs/List.md create mode 100644 samples/client/petstore/ruby-faraday/docs/MapTest.md create mode 100644 samples/client/petstore/ruby-faraday/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/client/petstore/ruby-faraday/docs/Model200Response.md create mode 100644 samples/client/petstore/ruby-faraday/docs/ModelReturn.md create mode 100644 samples/client/petstore/ruby-faraday/docs/Name.md create mode 100644 samples/client/petstore/ruby-faraday/docs/NumberOnly.md create mode 100644 samples/client/petstore/ruby-faraday/docs/Order.md create mode 100644 samples/client/petstore/ruby-faraday/docs/OuterComposite.md create mode 100644 samples/client/petstore/ruby-faraday/docs/OuterEnum.md create mode 100644 samples/client/petstore/ruby-faraday/docs/Pet.md create mode 100644 samples/client/petstore/ruby-faraday/docs/PetApi.md create mode 100644 samples/client/petstore/ruby-faraday/docs/ReadOnlyFirst.md create mode 100644 samples/client/petstore/ruby-faraday/docs/SpecialModelName.md create mode 100644 samples/client/petstore/ruby-faraday/docs/StoreApi.md create mode 100644 samples/client/petstore/ruby-faraday/docs/StringBooleanMap.md create mode 100644 samples/client/petstore/ruby-faraday/docs/Tag.md create mode 100644 samples/client/petstore/ruby-faraday/docs/User.md create mode 100644 samples/client/petstore/ruby-faraday/docs/UserApi.md create mode 100644 samples/client/petstore/ruby-faraday/git_push.sh create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/animal_farm.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/string_boolean_map.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/version.rb create mode 100644 samples/client/petstore/ruby-faraday/petstore.gemspec create mode 100644 samples/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/api/store_api_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/api/user_api_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/api_client_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/configuration_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/animal_farm_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/animal_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/api_response_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/array_test_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/cat_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/category_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/class_model_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/client_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/dog_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/file_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/format_test_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/list_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/map_test_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/model_return_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/name_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/number_only_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/order_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/pet_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/string_boolean_map_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/tag_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/user_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/spec_helper.rb diff --git a/bin/ruby-client-petstore-faraday.sh b/bin/ruby-client-petstore-faraday.sh new file mode 100755 index 00000000000..6782f410e46 --- /dev/null +++ b/bin/ruby-client-petstore-faraday.sh @@ -0,0 +1,32 @@ +#!/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 -B clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore-faraday.json -o samples/client/petstore/ruby-faraday $@" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/ruby-petstore-faraday.json b/bin/ruby-petstore-faraday.json new file mode 100644 index 00000000000..ddb753471a1 --- /dev/null +++ b/bin/ruby-petstore-faraday.json @@ -0,0 +1,5 @@ +{ + "gemName": "petstore", + "moduleName": "Petstore", + "gemVersion": "1.0.0" +} diff --git a/bin/ruby-petstore.json b/bin/ruby-petstore.json index ddb753471a1..47842a6be7a 100644 --- a/bin/ruby-petstore.json +++ b/bin/ruby-petstore.json @@ -1,5 +1,6 @@ { "gemName": "petstore", + "library": "typhoeus", "moduleName": "Petstore", "gemVersion": "1.0.0" } diff --git a/docs/generators/ruby.md b/docs/generators/ruby.md index e8a5a56b227..3a9f8266cbf 100644 --- a/docs/generators/ruby.md +++ b/docs/generators/ruby.md @@ -22,3 +22,6 @@ sidebar_label: ruby |gemAuthor|gem author (only one is supported).| |null| |gemAuthorEmail|gem author email (only one is supported).| |null| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| +|faraday|Faraday (https://github.com/lostisland/faraday)| |false| +|typhoeus|Typhoeus (https://github.com/typhoeus/typhoeus)| |false| +|library|HTTP library template (sub-template) to use|
**faraday**
Faraday (https://github.com/lostisland/faraday)
**typhoeus**
Typhoeus >= 1.0.1 (https://github.com/typhoeus/typhoeus)
|faraday| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java index e7af53297f3..6ac5ee26800 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java @@ -46,6 +46,8 @@ public class RubyClientCodegen extends AbstractRubyCodegen { public static final String GEM_DESCRIPTION = "gemDescription"; public static final String GEM_AUTHOR = "gemAuthor"; public static final String GEM_AUTHOR_EMAIL = "gemAuthorEmail"; + public static final String FARADAY = "faraday"; + public static final String TYPHOEUS = "typhoeus"; protected String gemName; protected String moduleName; @@ -54,8 +56,8 @@ public class RubyClientCodegen extends AbstractRubyCodegen { protected String libFolder = "lib"; protected String gemLicense = "unlicense"; protected String gemRequiredRubyVersion = ">= 1.9"; - protected String gemHomepage = "http://org.openapitools"; - protected String gemSummary = "A ruby wrapper for the REST APIs"; + protected String gemHomepage = "https://openapitools.org"; + protected String gemSummary = "A Ruby SDK for the REST API"; protected String gemDescription = "This gem maps to a REST API"; protected String gemAuthor = ""; protected String gemAuthorEmail = ""; @@ -141,6 +143,15 @@ public class RubyClientCodegen extends AbstractRubyCodegen { cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP, CodegenConstants.HIDE_GENERATION_TIMESTAMP_DESC). defaultValue(Boolean.TRUE.toString())); + supportedLibraries.put(FARADAY, "Faraday (https://github.com/lostisland/faraday) (Beta support)"); + supportedLibraries.put(TYPHOEUS, "Typhoeus >= 1.0.1 (https://github.com/typhoeus/typhoeus)"); + + CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "HTTP library template (sub-template) to use"); + libraryOption.setEnum(supportedLibraries); + // set TYPHOEUS as the default + libraryOption.setDefault(TYPHOEUS); + cliOptions.add(libraryOption); + setLibrary(TYPHOEUS); } @Override @@ -209,10 +220,8 @@ public class RubyClientCodegen extends AbstractRubyCodegen { setModelPackage("models"); setApiPackage("api"); - supportingFiles.add(new SupportingFile("gemspec.mustache", "", gemName + ".gemspec")); supportingFiles.add(new SupportingFile("gem.mustache", libFolder, gemName + ".rb")); String gemFolder = libFolder + File.separator + gemName; - supportingFiles.add(new SupportingFile("api_client.mustache", gemFolder, "api_client.rb")); supportingFiles.add(new SupportingFile("api_error.mustache", gemFolder, "api_error.rb")); supportingFiles.add(new SupportingFile("configuration.mustache", gemFolder, "configuration.rb")); supportingFiles.add(new SupportingFile("version.mustache", gemFolder, "version.rb")); @@ -221,10 +230,20 @@ public class RubyClientCodegen extends AbstractRubyCodegen { supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); supportingFiles.add(new SupportingFile("Rakefile.mustache", "", "Rakefile")); supportingFiles.add(new SupportingFile("Gemfile.mustache", "", "Gemfile")); - supportingFiles.add(new SupportingFile("Gemfile.lock.mustache", "", "Gemfile.lock")); supportingFiles.add(new SupportingFile("rubocop.mustache", "", ".rubocop.yml")); supportingFiles.add(new SupportingFile("travis.mustache", "", ".travis.yml")); + if (TYPHOEUS.equals(getLibrary())) { + supportingFiles.add(new SupportingFile("api_client.mustache", gemFolder, "api_client.rb")); + supportingFiles.add(new SupportingFile("gemspec.mustache", "", gemName + ".gemspec")); + supportingFiles.add(new SupportingFile("Gemfile.lock.mustache", "", "Gemfile.lock")); + } else if (FARADAY.equals(getLibrary())) { + supportingFiles.add(new SupportingFile("faraday_api_client.mustache", gemFolder, "api_client.rb")); + supportingFiles.add(new SupportingFile("faraday_gemspec.mustache", "", gemName + ".gemspec")); + } else { + throw new RuntimeException("Invalid HTTP library " + getLibrary() + ". Only faraday, typhoeus are supported."); + } + // test files should not be overwritten writeOptional(outputFolder, new SupportingFile("rspec.mustache", "", ".rspec")); writeOptional(outputFolder, new SupportingFile("spec_helper.mustache", specFolder, "spec_helper.rb")); diff --git a/modules/openapi-generator/src/main/resources/ruby-client/faraday_api_client.mustache b/modules/openapi-generator/src/main/resources/ruby-client/faraday_api_client.mustache new file mode 100644 index 00000000000..bfe0ad907f3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/ruby-client/faraday_api_client.mustache @@ -0,0 +1,393 @@ +=begin +{{> api_info}} +=end + +require 'date' +require 'faraday' +require 'json' +require 'logger' +require 'tempfile' + +module {{moduleName}} + class ApiClient + # The Configuration object holding settings to be used in the API client. + attr_accessor :config + + # Defines the headers to be used in HTTP requests of all API calls by default. + # + # @return [Hash] + attr_accessor :default_headers + + # Initializes the ApiClient + # @option config [Configuration] Configuration for initializing the object, default to Configuration.default + def initialize(config = Configuration.default) + @config = config + @user_agent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/#{VERSION}/ruby{{/httpUserAgent}}" + @default_headers = { + 'Content-Type' => 'application/json', + 'User-Agent' => @user_agent + } + end + + def self.default + @@default ||= ApiClient.new + end + + # Call an API with given options. + # + # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: + # the data deserialized from response body (could be nil), response status code and response headers. + def call_api(http_method, path, opts = {}) + connection = Faraday.new(:url => config.base_url) do |conn| + conn.basic_auth(config.username, config.password) + if opts[:header_params]["Content-Type"] == "multipart/form-data" + conn.request :multipart + conn.request :url_encoded + end + conn.adapter(Faraday.default_adapter) + end + begin + response = connection.public_send(http_method.to_sym.downcase) do |req| + build_request(http_method, path, req, opts) + end + + if @config.debugging + @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" + end + + unless response.success? + if response.status == 0 + # Errors from libcurl will be made visible here + fail ApiError.new(:code => 0, + :message => response.return_message) + else + fail ApiError.new(:code => response.status, + :response_headers => response.headers, + :response_body => response.body), + response.reason_phrase + end + end + rescue Faraday::TimeoutError + fail ApiError.new('Connection timed out') + end + + if opts[:return_type] + data = deserialize(response, opts[:return_type]) + else + data = nil + end + return data, response.status, response.headers + end + + # Builds the HTTP request + # + # @param [String] http_method HTTP method/verb (e.g. POST) + # @param [String] path URL path (e.g. /account/new) + # @option opts [Hash] :header_params Header parameters + # @option opts [Hash] :query_params Query parameters + # @option opts [Hash] :form_params Query parameters + # @option opts [Object] :body HTTP body (JSON/XML) + # @return [Typhoeus::Request] A Typhoeus Request + def build_request(http_method, path, request, opts = {}) + url = build_request_url(path) + http_method = http_method.to_sym.downcase + + header_params = @default_headers.merge(opts[:header_params] || {}) + query_params = opts[:query_params] || {} + form_params = opts[:form_params] || {} + + update_params_for_auth! header_params, query_params, opts[:auth_names] + + # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) + _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 + + req_opts = { + :method => http_method, + :headers => header_params, + :params => query_params, + :params_encoding => @config.params_encoding, + :timeout => @config.timeout, + :ssl_verifypeer => @config.verify_ssl, + :ssl_verifyhost => _verify_ssl_host, + :sslcert => @config.cert_file, + :sslkey => @config.key_file, + :verbose => @config.debugging + } + + # set custom cert, if provided + req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert + + if [:post, :patch, :put, :delete].include?(http_method) + req_body = build_request_body(header_params, form_params, opts[:body]) + req_opts.update :body => req_body + if @config.debugging + @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" + end + end + request.headers = header_params + request.body = req_body + request.url path + request.params = query_params + download_file(request) if opts[:return_type] == 'File' + request + end + + # Check if the given MIME is a JSON MIME. + # JSON MIME examples: + # application/json + # application/json; charset=UTF8 + # APPLICATION/JSON + # */* + # @param [String] mime MIME + # @return [Boolean] True if the MIME is application/json + def json_mime?(mime) + (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? + end + + # Deserialize the response to the given return type. + # + # @param [Response] response HTTP response + # @param [String] return_type some examples: "User", "Array", "Hash" + def deserialize(response, return_type) + body = response.body + + # handle file downloading - return the File instance processed in request callbacks + # note that response body is empty when the file is written in chunks in request on_body callback + return @tempfile if return_type == 'File' + + return nil if body.nil? || body.empty? + + # return response body directly for String return type + return body if return_type == 'String' + + # ensuring a default content type + content_type = response.headers['Content-Type'] || 'application/json' + + fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) + + begin + data = JSON.parse("[#{body}]", :symbolize_names => true)[0] + rescue JSON::ParserError => e + if %w(String Date DateTime).include?(return_type) + data = body + else + raise e + end + end + + convert_to_type data, return_type + end + + # Convert data to the given return type. + # @param [Object] data Data to be converted + # @param [String] return_type Return type + # @return [Mixed] Data in a particular type + def convert_to_type(data, return_type) + return nil if data.nil? + case return_type + when 'String' + data.to_s + when 'Integer' + data.to_i + when 'Float' + data.to_f + when 'Boolean' + data == true + when 'DateTime' + # parse date time (expecting ISO 8601 format) + DateTime.parse data + when 'Date' + # parse date time (expecting ISO 8601 format) + Date.parse data + when 'Object' + # generic object (usually a Hash), return directly + data + when /\AArray<(.+)>\z/ + # e.g. Array + sub_type = $1 + data.map { |item| convert_to_type(item, sub_type) } + when /\AHash\\z/ + # e.g. Hash + sub_type = $1 + {}.tap do |hash| + data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } + end + else + # models, e.g. Pet + {{moduleName}}.const_get(return_type).build_from_hash(data) + end + end + + # Save response body into a file in (the defined) temporary folder, using the filename + # from the "Content-Disposition" header if provided, otherwise a random filename. + # The response body is written to the file in chunks in order to handle files which + # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby + # process can use. + # + # @see Configuration#temp_folder_path + def download_file(request) + tempfile = nil + encoding = nil + request.on_headers do |response| + content_disposition = response.headers['Content-Disposition'] + if content_disposition && content_disposition =~ /filename=/i + filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] + prefix = sanitize_filename(filename) + else + prefix = 'download-' + end + prefix = prefix + '-' unless prefix.end_with?('-') + encoding = response.body.encoding + tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) + @tempfile = tempfile + end + request.on_body do |chunk| + chunk.force_encoding(encoding) + tempfile.write(chunk) + end + request.on_complete do |response| + tempfile.close if tempfile + @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ + "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ + "will be deleted automatically with GC. It's also recommended to delete the temp file "\ + "explicitly with `tempfile.delete`" + end + end + + # Sanitize filename by removing path. + # e.g. ../../sun.gif becomes sun.gif + # + # @param [String] filename the filename to be sanitized + # @return [String] the sanitized filename + def sanitize_filename(filename) + filename.gsub(/.*[\/\\]/, '') + end + + def build_request_url(path) + # Add leading and trailing slashes to path + path = "/#{path}".gsub(/\/+/, '/') + @config.base_url + path + end + + # Builds the HTTP request body + # + # @param [Hash] header_params Header parameters + # @param [Hash] form_params Query parameters + # @param [Object] body HTTP body (JSON/XML) + # @return [String] HTTP body data in the form of string + def build_request_body(header_params, form_params, body) + # http form + if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || + header_params['Content-Type'] == 'multipart/form-data' + data = {} + form_params.each do |key, value| + case value + when ::File, ::Tempfile + data[key] = Faraday::UploadIO.new(value.path, '') + when ::Array, nil + # let Faraday handle Array and nil parameters + data[key] = value + else + data[key] = value.to_s + end + end + elsif body + data = body.is_a?(String) ? body : body.to_json + else + data = nil + end + data + end + + # Update hearder and query params based on authentication settings. + # + # @param [Hash] header_params Header parameters + # @param [Hash] query_params Query parameters + # @param [String] auth_names Authentication scheme name + def update_params_for_auth!(header_params, query_params, auth_names) + Array(auth_names).each do |auth_name| + auth_setting = @config.auth_settings[auth_name] + next unless auth_setting + case auth_setting[:in] + when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] + when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] + else fail ArgumentError, 'Authentication token must be in `query` of `header`' + end + end + end + + # Sets user agent in HTTP header + # + # @param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.0) + def user_agent=(user_agent) + @user_agent = user_agent + @default_headers['User-Agent'] = @user_agent + end + + # Return Accept header based on an array of accepts provided. + # @param [Array] accepts array for Accept + # @return [String] the Accept header (e.g. application/json) + def select_header_accept(accepts) + return nil if accepts.nil? || accepts.empty? + # use JSON when present, otherwise use all of the provided + json_accept = accepts.find { |s| json_mime?(s) } + json_accept || accepts.join(',') + end + + # Return Content-Type header based on an array of content types provided. + # @param [Array] content_types array for Content-Type + # @return [String] the Content-Type header (e.g. application/json) + def select_header_content_type(content_types) + # use application/json by default + return 'application/json' if content_types.nil? || content_types.empty? + # use JSON when present, otherwise use the first one + json_content_type = content_types.find { |s| json_mime?(s) } + json_content_type || content_types.first + end + + # Convert object (array, hash, object, etc) to JSON string. + # @param [Object] model object to be converted into JSON string + # @return [String] JSON string representation of the object + def object_to_http_body(model) + return model if model.nil? || model.is_a?(String) + local_body = nil + if model.is_a?(Array) + local_body = model.map { |m| object_to_hash(m) } + else + local_body = object_to_hash(model) + end + local_body.to_json + end + + # Convert object(non-array) to hash. + # @param [Object] obj object to be converted into JSON string + # @return [String] JSON string representation of the object + def object_to_hash(obj) + if obj.respond_to?(:to_hash) + obj.to_hash + else + obj + end + end + + # Build parameter value according to the given collection format. + # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi + def build_collection_param(param, collection_format) + case collection_format + when :csv + param.join(',') + when :ssv + param.join(' ') + when :tsv + param.join("\t") + when :pipes + param.join('|') + when :multi + # return the array directly as typhoeus will handle it as expected + param + else + fail "unknown collection format: #{collection_format.inspect}" + end + end + end +end diff --git a/modules/openapi-generator/src/main/resources/ruby-client/faraday_gemspec.mustache b/modules/openapi-generator/src/main/resources/ruby-client/faraday_gemspec.mustache new file mode 100644 index 00000000000..09046b7f28e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/ruby-client/faraday_gemspec.mustache @@ -0,0 +1,38 @@ +# -*- encoding: utf-8 -*- + +=begin +{{> api_info}} +=end + +$:.push File.expand_path("../lib", __FILE__) +require "{{gemName}}/version" + +Gem::Specification.new do |s| + s.name = "{{gemName}}{{^gemName}}{{{appName}}}{{/gemName}}" + s.version = {{moduleName}}::VERSION + s.platform = Gem::Platform::RUBY + s.authors = ["{{gemAuthor}}{{^gemAuthor}}OpenAPI-Generator{{/gemAuthor}}"] + s.email = ["{{gemAuthorEmail}}{{^gemAuthorEmail}}{{infoEmail}}{{/gemAuthorEmail}}"] + s.homepage = "{{gemHomepage}}{{^gemHomepage}}https://openapi-generator.tech{{/gemHomepage}}" + s.summary = "{{gemSummary}}{{^gemSummary}}{{{appName}}} Ruby Gem{{/gemSummary}}" + s.description = "{{gemDescription}}{{^gemDescription}}{{{appDescription}}}{{^appDescription}}{{{appName}}} Ruby Gem{{/appDescription}}{{/gemDescription}}" + {{#gemLicense}} + s.license = '{{{gemLicense}}}' + {{/gemLicense}} + {{^gemLicense}} + s.license = "Unlicense" + {{/gemLicense}} + s.required_ruby_version = "{{{gemRequiredRubyVersion}}}{{^gemRequiredRubyVersion}}>= 1.9{{/gemRequiredRubyVersion}}" + + s.add_runtime_dependency 'faraday', '>= 0.14.0' + s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' + + s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' + s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1' + s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3' + + s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } + s.test_files = `find spec/*`.split("\n") + s.executables = [] + s.require_paths = ["lib"] +end diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/RubyClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/RubyClientOptionsProvider.java index a42bbb22f09..61c914163c3 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/RubyClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/RubyClientOptionsProvider.java @@ -38,6 +38,7 @@ public class RubyClientOptionsProvider implements OptionsProvider { public static final String GEM_AUTHOR_EMAIL_VALUE = "foo"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; + public static final String LIBRARY = "typhoeus"; @Override public String getLanguage() { @@ -62,6 +63,7 @@ public class RubyClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true") .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) + .put(CodegenConstants.LIBRARY, LIBRARY) .build(); } diff --git a/samples/client/petstore/ruby-faraday/.gitignore b/samples/client/petstore/ruby-faraday/.gitignore new file mode 100644 index 00000000000..05a17cb8f0a --- /dev/null +++ b/samples/client/petstore/ruby-faraday/.gitignore @@ -0,0 +1,39 @@ +# Generated by: https://openapi-generator.tech +# + +*.gem +*.rbc +/.config +/coverage/ +/InstalledFiles +/pkg/ +/spec/reports/ +/spec/examples.txt +/test/tmp/ +/test/version_tmp/ +/tmp/ + +## Specific to RubyMotion: +.dat* +.repl_history +build/ + +## Documentation cache and generated files: +/.yardoc/ +/_yardoc/ +/doc/ +/rdoc/ + +## Environment normalization: +/.bundle/ +/vendor/bundle +/lib/bundler/man/ + +# for a library or gem, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# Gemfile.lock +# .ruby-version +# .ruby-gemset + +# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: +.rvmrc diff --git a/samples/client/petstore/ruby-faraday/.openapi-generator-ignore b/samples/client/petstore/ruby-faraday/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION b/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION new file mode 100644 index 00000000000..e24c1f857e0 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION @@ -0,0 +1 @@ +3.3.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ruby-faraday/.rspec b/samples/client/petstore/ruby-faraday/.rspec new file mode 100644 index 00000000000..83e16f80447 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/.rspec @@ -0,0 +1,2 @@ +--color +--require spec_helper diff --git a/samples/client/petstore/ruby-faraday/.rubocop.yml b/samples/client/petstore/ruby-faraday/.rubocop.yml new file mode 100644 index 00000000000..98c7e3c7e51 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/.rubocop.yml @@ -0,0 +1,154 @@ +# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) +# Automatically generated by OpenAPI Generator (https://openapi-generator.tech) +AllCops: + TargetRubyVersion: 2.2 + # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop + # to ignore them, so only the ones explicitly set in this file are enabled. + DisabledByDefault: true + Exclude: + - '**/templates/**/*' + - '**/vendor/**/*' + - 'actionpack/lib/action_dispatch/journey/parser.rb' + +# Prefer &&/|| over and/or. +Style/AndOr: + Enabled: true + +# Do not use braces for hash literals when they are the last argument of a +# method call. +Style/BracesAroundHashParameters: + Enabled: true + EnforcedStyle: context_dependent + +# Align `when` with `case`. +Layout/CaseIndentation: + Enabled: true + +# Align comments with method definitions. +Layout/CommentIndentation: + Enabled: true + +Layout/ElseAlignment: + Enabled: true + +Layout/EmptyLineAfterMagicComment: + Enabled: true + +# In a regular class definition, no empty lines around the body. +Layout/EmptyLinesAroundClassBody: + Enabled: true + +# In a regular method definition, no empty lines around the body. +Layout/EmptyLinesAroundMethodBody: + Enabled: true + +# In a regular module definition, no empty lines around the body. +Layout/EmptyLinesAroundModuleBody: + Enabled: true + +Layout/FirstParameterIndentation: + Enabled: true + +# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. +Style/HashSyntax: + Enabled: false + +# Method definitions after `private` or `protected` isolated calls need one +# extra level of indentation. +Layout/IndentationConsistency: + Enabled: true + EnforcedStyle: rails + +# Two spaces, no tabs (for indentation). +Layout/IndentationWidth: + Enabled: true + +Layout/LeadingCommentSpace: + Enabled: true + +Layout/SpaceAfterColon: + Enabled: true + +Layout/SpaceAfterComma: + Enabled: true + +Layout/SpaceAroundEqualsInParameterDefault: + Enabled: true + +Layout/SpaceAroundKeyword: + Enabled: true + +Layout/SpaceAroundOperators: + Enabled: true + +Layout/SpaceBeforeComma: + Enabled: true + +Layout/SpaceBeforeFirstArg: + Enabled: true + +Style/DefWithParentheses: + Enabled: true + +# Defining a method with parameters needs parentheses. +Style/MethodDefParentheses: + Enabled: true + +Style/FrozenStringLiteralComment: + Enabled: false + EnforcedStyle: always + +# Use `foo {}` not `foo{}`. +Layout/SpaceBeforeBlockBraces: + Enabled: true + +# Use `foo { bar }` not `foo {bar}`. +Layout/SpaceInsideBlockBraces: + Enabled: true + +# Use `{ a: 1 }` not `{a:1}`. +Layout/SpaceInsideHashLiteralBraces: + Enabled: true + +Layout/SpaceInsideParens: + Enabled: true + +# Check quotes usage according to lint rule below. +#Style/StringLiterals: +# Enabled: true +# EnforcedStyle: single_quotes + +# Detect hard tabs, no hard tabs. +Layout/Tab: + Enabled: true + +# Blank lines should not have any spaces. +Layout/TrailingBlankLines: + Enabled: true + +# No trailing whitespace. +Layout/TrailingWhitespace: + Enabled: false + +# Use quotes for string literals when they are enough. +Style/UnneededPercentQ: + Enabled: true + +# Align `end` with the matching keyword or starting expression except for +# assignments, where it should be aligned with the LHS. +Layout/EndAlignment: + Enabled: true + EnforcedStyleAlignWith: variable + AutoCorrect: true + +# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. +Lint/RequireParentheses: + Enabled: true + +Style/RedundantReturn: + Enabled: true + AllowMultipleReturnValues: true + +Style/Semicolon: + Enabled: true + AllowAsExpressionSeparator: true diff --git a/samples/client/petstore/ruby-faraday/Gemfile b/samples/client/petstore/ruby-faraday/Gemfile new file mode 100644 index 00000000000..01ba313fe12 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/Gemfile @@ -0,0 +1,8 @@ +source 'https://rubygems.org' + +gemspec + +group :development, :test do + gem 'rake', '~> 12.0.0' + gem 'pry-byebug' +end diff --git a/samples/client/petstore/ruby-faraday/README.md b/samples/client/petstore/ruby-faraday/README.md new file mode 100644 index 00000000000..9e3a1180a6b --- /dev/null +++ b/samples/client/petstore/ruby-faraday/README.md @@ -0,0 +1,180 @@ +# petstore + +Petstore - the Ruby gem for the OpenAPI Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.RubyClientCodegen + +## Installation + +### Build a gem + +To build the Ruby code into a gem: + +```shell +gem build petstore.gemspec +``` + +Then either install the gem locally: + +```shell +gem install ./petstore-1.0.0.gem +``` +(for development, run `gem install --dev ./petstore-1.0.0.gem` to install the development dependencies) + +or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). + +Finally add this to the Gemfile: + + gem 'petstore', '~> 1.0.0' + +### Install from Git + +If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: + + gem 'petstore', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' + +### Include the Ruby code directly + +Include the Ruby code directly using `-I` as follows: + +```shell +ruby -Ilib script.rb +``` + +## Getting Started + +Please follow the [installation](#installation) procedure and then run the following code: +```ruby +# Load the gem +require 'petstore' + +api_instance = Petstore::AnotherFakeApi.new +client = Petstore::Client.new # Client | client model + +begin + #To test special tags + result = api_instance.call_123_test_special_tags(client) + p result +rescue Petstore::ApiError => e + puts "Exception when calling AnotherFakeApi->call_123_test_special_tags: #{e}" +end + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*Petstore::AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags +*Petstore::FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | +*Petstore::FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | +*Petstore::FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | +*Petstore::FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | +*Petstore::FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | +*Petstore::FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | +*Petstore::FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model +*Petstore::FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*Petstore::FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +*Petstore::FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +*Petstore::FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*Petstore::FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*Petstore::FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case +*Petstore::PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +*Petstore::PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +*Petstore::PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +*Petstore::PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +*Petstore::PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +*Petstore::PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet +*Petstore::PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data +*Petstore::PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image +*Petstore::PetApi* | [**upload_file_with_required_file**](docs/PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*Petstore::StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*Petstore::StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status +*Petstore::StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID +*Petstore::StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet +*Petstore::UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user +*Petstore::UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array +*Petstore::UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array +*Petstore::UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +*Petstore::UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +*Petstore::UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system +*Petstore::UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +*Petstore::UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user + + +## Documentation for Models + + - [Petstore::AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [Petstore::Animal](docs/Animal.md) + - [Petstore::AnimalFarm](docs/AnimalFarm.md) + - [Petstore::ApiResponse](docs/ApiResponse.md) + - [Petstore::ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [Petstore::ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [Petstore::ArrayTest](docs/ArrayTest.md) + - [Petstore::Capitalization](docs/Capitalization.md) + - [Petstore::Cat](docs/Cat.md) + - [Petstore::Category](docs/Category.md) + - [Petstore::ClassModel](docs/ClassModel.md) + - [Petstore::Client](docs/Client.md) + - [Petstore::Dog](docs/Dog.md) + - [Petstore::EnumArrays](docs/EnumArrays.md) + - [Petstore::EnumClass](docs/EnumClass.md) + - [Petstore::EnumTest](docs/EnumTest.md) + - [Petstore::File](docs/File.md) + - [Petstore::FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [Petstore::FormatTest](docs/FormatTest.md) + - [Petstore::HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [Petstore::List](docs/List.md) + - [Petstore::MapTest](docs/MapTest.md) + - [Petstore::MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Petstore::Model200Response](docs/Model200Response.md) + - [Petstore::ModelReturn](docs/ModelReturn.md) + - [Petstore::Name](docs/Name.md) + - [Petstore::NumberOnly](docs/NumberOnly.md) + - [Petstore::Order](docs/Order.md) + - [Petstore::OuterComposite](docs/OuterComposite.md) + - [Petstore::OuterEnum](docs/OuterEnum.md) + - [Petstore::Pet](docs/Pet.md) + - [Petstore::ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [Petstore::SpecialModelName](docs/SpecialModelName.md) + - [Petstore::StringBooleanMap](docs/StringBooleanMap.md) + - [Petstore::Tag](docs/Tag.md) + - [Petstore::User](docs/User.md) + + +## Documentation for Authorization + + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + +### api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + +### http_basic_test + +- **Type**: HTTP basic authentication + +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + diff --git a/samples/client/petstore/ruby-faraday/Rakefile b/samples/client/petstore/ruby-faraday/Rakefile new file mode 100644 index 00000000000..c72ca30d454 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/Rakefile @@ -0,0 +1,10 @@ +require "bundler/gem_tasks" + +begin + require 'rspec/core/rake_task' + + RSpec::Core::RakeTask.new(:spec) + task default: :spec +rescue LoadError + # no rspec available +end diff --git a/samples/client/petstore/ruby-faraday/bin/console b/samples/client/petstore/ruby-faraday/bin/console new file mode 100755 index 00000000000..07c7bbe1955 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/bin/console @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby + +require "bundler/setup" +require "petstore" + +# You can add fixtures and/or initialization code here to make experimenting +# with your gem easier. You can also use a different console, if you like. +api = Petstore::PetApi.new +api.api_client.config.debugging = true +pet = api.get_pet_by_id(545646631) +new_pet = pet.dup +new_pet.id = nil + +res = api.add_pet(new_pet) + +require "pry" +Pry.start diff --git a/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesClass.md b/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..c3ee2cdf637 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesClass.md @@ -0,0 +1,9 @@ +# Petstore::AdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**map_property** | **Hash<String, String>** | | [optional] +**map_of_map_property** | **Hash<String, Hash<String, String>>** | | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/Animal.md b/samples/client/petstore/ruby-faraday/docs/Animal.md new file mode 100644 index 00000000000..077e6c2d87c --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/Animal.md @@ -0,0 +1,9 @@ +# Petstore::Animal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **String** | | +**color** | **String** | | [optional] [default to 'red'] + + diff --git a/samples/client/petstore/ruby-faraday/docs/AnimalFarm.md b/samples/client/petstore/ruby-faraday/docs/AnimalFarm.md new file mode 100644 index 00000000000..30d704dc7d1 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/AnimalFarm.md @@ -0,0 +1,7 @@ +# Petstore::AnimalFarm + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md b/samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..2d4891e0660 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md @@ -0,0 +1,54 @@ +# Petstore::AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**call_123_test_special_tags**](AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags + + +# **call_123_test_special_tags** +> Client call_123_test_special_tags(client) + +To test special tags + +To test special tags and operation ID starting with number + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::AnotherFakeApi.new +client = Petstore::Client.new # Client | client model + +begin + #To test special tags + result = api_instance.call_123_test_special_tags(client) + p result +rescue Petstore::ApiError => e + puts "Exception when calling AnotherFakeApi->call_123_test_special_tags: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/samples/client/petstore/ruby-faraday/docs/ApiResponse.md b/samples/client/petstore/ruby-faraday/docs/ApiResponse.md new file mode 100644 index 00000000000..843f9cc525b --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/ApiResponse.md @@ -0,0 +1,10 @@ +# Petstore::ApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **Integer** | | [optional] +**type** | **String** | | [optional] +**message** | **String** | | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/ruby-faraday/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..003cf9a8d6d --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,8 @@ +# Petstore::ArrayOfArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_array_number** | **Array<Array<Float>>** | | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/ArrayOfNumberOnly.md b/samples/client/petstore/ruby-faraday/docs/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..c2b9fada4f8 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/ArrayOfNumberOnly.md @@ -0,0 +1,8 @@ +# Petstore::ArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_number** | **Array<Float>** | | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/ArrayTest.md b/samples/client/petstore/ruby-faraday/docs/ArrayTest.md new file mode 100644 index 00000000000..5fbfd67159b --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/ArrayTest.md @@ -0,0 +1,10 @@ +# Petstore::ArrayTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_of_string** | **Array<String>** | | [optional] +**array_array_of_integer** | **Array<Array<Integer>>** | | [optional] +**array_array_of_model** | **Array<Array<ReadOnlyFirst>>** | | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/Capitalization.md b/samples/client/petstore/ruby-faraday/docs/Capitalization.md new file mode 100644 index 00000000000..d99c603f54a --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/Capitalization.md @@ -0,0 +1,13 @@ +# Petstore::Capitalization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**small_camel** | **String** | | [optional] +**capital_camel** | **String** | | [optional] +**small_snake** | **String** | | [optional] +**capital_snake** | **String** | | [optional] +**sca_eth_flow_points** | **String** | | [optional] +**att_name** | **String** | Name of the pet | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/Cat.md b/samples/client/petstore/ruby-faraday/docs/Cat.md new file mode 100644 index 00000000000..d0fc50e4da8 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/Cat.md @@ -0,0 +1,10 @@ +# Petstore::Cat + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **String** | | +**color** | **String** | | [optional] [default to 'red'] +**declawed** | **BOOLEAN** | | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/Category.md b/samples/client/petstore/ruby-faraday/docs/Category.md new file mode 100644 index 00000000000..4500de105b2 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/Category.md @@ -0,0 +1,9 @@ +# Petstore::Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | | [optional] +**name** | **String** | | [default to 'default-name'] + + diff --git a/samples/client/petstore/ruby-faraday/docs/ClassModel.md b/samples/client/petstore/ruby-faraday/docs/ClassModel.md new file mode 100644 index 00000000000..cd4de850633 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/ClassModel.md @@ -0,0 +1,8 @@ +# Petstore::ClassModel + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_class** | **String** | | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/Client.md b/samples/client/petstore/ruby-faraday/docs/Client.md new file mode 100644 index 00000000000..2b8e400aaee --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/Client.md @@ -0,0 +1,8 @@ +# Petstore::Client + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **String** | | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/Dog.md b/samples/client/petstore/ruby-faraday/docs/Dog.md new file mode 100644 index 00000000000..1e66990d593 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/Dog.md @@ -0,0 +1,10 @@ +# Petstore::Dog + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **String** | | +**color** | **String** | | [optional] [default to 'red'] +**breed** | **String** | | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/EnumArrays.md b/samples/client/petstore/ruby-faraday/docs/EnumArrays.md new file mode 100644 index 00000000000..ef6a935fbd7 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/EnumArrays.md @@ -0,0 +1,9 @@ +# Petstore::EnumArrays + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**just_symbol** | **String** | | [optional] +**array_enum** | **Array<String>** | | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/EnumClass.md b/samples/client/petstore/ruby-faraday/docs/EnumClass.md new file mode 100644 index 00000000000..8d56e1f8873 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/EnumClass.md @@ -0,0 +1,7 @@ +# Petstore::EnumClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/samples/client/petstore/ruby-faraday/docs/EnumTest.md b/samples/client/petstore/ruby-faraday/docs/EnumTest.md new file mode 100644 index 00000000000..87297ac476e --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/EnumTest.md @@ -0,0 +1,12 @@ +# Petstore::EnumTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enum_string** | **String** | | [optional] +**enum_string_required** | **String** | | +**enum_integer** | **Integer** | | [optional] +**enum_number** | **Float** | | [optional] +**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/FakeApi.md b/samples/client/petstore/ruby-faraday/docs/FakeApi.md new file mode 100644 index 00000000000..e7e99549266 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/FakeApi.md @@ -0,0 +1,615 @@ +# Petstore::FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | +[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | +[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | +[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | +[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | +[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | +[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model +[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +[**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data + + +# **fake_outer_boolean_serialize** +> BOOLEAN fake_outer_boolean_serialize(opts) + + + +Test serialization of outer boolean types + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +opts = { + body: true # BOOLEAN | Input boolean as post body +} + +begin + result = api_instance.fake_outer_boolean_serialize(opts) + p result +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->fake_outer_boolean_serialize: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **BOOLEAN**| Input boolean as post body | [optional] + +### Return type + +**BOOLEAN** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + + + +# **fake_outer_composite_serialize** +> OuterComposite fake_outer_composite_serialize(opts) + + + +Test serialization of object with outer number type + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +opts = { + outer_composite: Petstore::OuterComposite.new # OuterComposite | Input composite as post body +} + +begin + result = api_instance.fake_outer_composite_serialize(opts) + p result +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->fake_outer_composite_serialize: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outer_composite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + + + +# **fake_outer_number_serialize** +> Float fake_outer_number_serialize(opts) + + + +Test serialization of outer number types + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +opts = { + body: 3.4 # Float | Input number as post body +} + +begin + result = api_instance.fake_outer_number_serialize(opts) + p result +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->fake_outer_number_serialize: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **Float**| Input number as post body | [optional] + +### Return type + +**Float** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + + + +# **fake_outer_string_serialize** +> String fake_outer_string_serialize(opts) + + + +Test serialization of outer string types + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +opts = { + body: 'body_example' # String | Input string as post body +} + +begin + result = api_instance.fake_outer_string_serialize(opts) + p result +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->fake_outer_string_serialize: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **String**| Input string as post body | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + + + +# **test_body_with_file_schema** +> test_body_with_file_schema(file_schema_test_class) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +file_schema_test_class = Petstore::FileSchemaTestClass.new # FileSchemaTestClass | + +begin + api_instance.test_body_with_file_schema(file_schema_test_class) +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->test_body_with_file_schema: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file_schema_test_class** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + + +# **test_body_with_query_params** +> test_body_with_query_params(query, user) + + + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +query = 'query_example' # String | +user = Petstore::User.new # User | + +begin + api_instance.test_body_with_query_params(query, user) +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->test_body_with_query_params: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **user** | [**User**](User.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + + +# **test_client_model** +> Client test_client_model(client) + +To test \"client\" model + +To test \"client\" model + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +client = Petstore::Client.new # Client | client model + +begin + #To test \"client\" model + result = api_instance.test_client_model(client) + p result +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->test_client_model: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **test_endpoint_parameters** +> test_endpoint_parameters(number, double, pattern_without_delimiter, byte, opts) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```ruby +# load the gem +require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure HTTP basic authorization: http_basic_test + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Petstore::FakeApi.new +number = 3.4 # Float | None +double = 3.4 # Float | None +pattern_without_delimiter = 'pattern_without_delimiter_example' # String | None +byte = 'byte_example' # String | None +opts = { + integer: 56, # Integer | None + int32: 56, # Integer | None + int64: 56, # Integer | None + float: 3.4, # Float | None + string: 'string_example', # String | None + binary: File.new('/path/to/file'), # File | None + date: Date.parse('2013-10-20'), # Date | None + date_time: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | None + password: 'password_example', # String | None + callback: 'callback_example' # String | None +} + +begin + #Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, opts) +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->test_endpoint_parameters: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **Float**| None | + **double** | **Float**| None | + **pattern_without_delimiter** | **String**| None | + **byte** | **String**| None | + **integer** | **Integer**| None | [optional] + **int32** | **Integer**| None | [optional] + **int64** | **Integer**| None | [optional] + **float** | **Float**| None | [optional] + **string** | **String**| None | [optional] + **binary** | **File**| None | [optional] + **date** | **Date**| None | [optional] + **date_time** | **DateTime**| None | [optional] + **password** | **String**| None | [optional] + **callback** | **String**| None | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + + +# **test_enum_parameters** +> test_enum_parameters(opts) + +To test enum parameters + +To test enum parameters + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +opts = { + enum_header_string_array: ['enum_header_string_array_example'], # Array | Header parameter enum test (string array) + enum_header_string: '-efg', # String | Header parameter enum test (string) + enum_query_string_array: ['enum_query_string_array_example'], # Array | Query parameter enum test (string array) + enum_query_string: '-efg', # String | Query parameter enum test (string) + enum_query_integer: 56, # Integer | Query parameter enum test (double) + enum_query_double: 3.4, # Float | Query parameter enum test (double) + enum_form_string_array: '$', # Array | Form parameter enum test (string array) + enum_form_string: '-efg' # String | Form parameter enum test (string) +} + +begin + #To test enum parameters + api_instance.test_enum_parameters(opts) +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->test_enum_parameters: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enum_header_string_array** | [**Array<String>**](String.md)| Header parameter enum test (string array) | [optional] + **enum_header_string** | **String**| Header parameter enum test (string) | [optional] [default to '-efg'] + **enum_query_string_array** | [**Array<String>**](String.md)| Query parameter enum test (string array) | [optional] + **enum_query_string** | **String**| Query parameter enum test (string) | [optional] [default to '-efg'] + **enum_query_integer** | **Integer**| Query parameter enum test (double) | [optional] + **enum_query_double** | **Float**| Query parameter enum test (double) | [optional] + **enum_form_string_array** | [**Array<String>**](String.md)| Form parameter enum test (string array) | [optional] [default to '$'] + **enum_form_string** | **String**| Form parameter enum test (string) | [optional] [default to '-efg'] + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + + +# **test_group_parameters** +> test_group_parameters(required_string_group, required_boolean_group, required_int64_group, opts) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +required_string_group = 56 # Integer | Required String in group parameters +required_boolean_group = true # BOOLEAN | Required Boolean in group parameters +required_int64_group = 56 # Integer | Required Integer in group parameters +opts = { + string_group: 56, # Integer | String in group parameters + boolean_group: true, # BOOLEAN | Boolean in group parameters + int64_group: 56 # Integer | Integer in group parameters +} + +begin + #Fake endpoint to test group parameters (optional) + api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, opts) +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->test_group_parameters: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **required_string_group** | **Integer**| Required String in group parameters | + **required_boolean_group** | **BOOLEAN**| Required Boolean in group parameters | + **required_int64_group** | **Integer**| Required Integer in group parameters | + **string_group** | **Integer**| String in group parameters | [optional] + **boolean_group** | **BOOLEAN**| Boolean in group parameters | [optional] + **int64_group** | **Integer**| Integer in group parameters | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + + +# **test_inline_additional_properties** +> test_inline_additional_properties(request_body) + +test inline additionalProperties + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +request_body = {'key' => 'request_body_example'} # Hash | request body + +begin + #test inline additionalProperties + api_instance.test_inline_additional_properties(request_body) +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->test_inline_additional_properties: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **request_body** | [**Hash<String, String>**](String.md)| request body | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + + +# **test_json_form_data** +> test_json_form_data(param, param2) + +test json serialization of form data + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +param = 'param_example' # String | field1 +param2 = 'param2_example' # String | field2 + +begin + #test json serialization of form data + api_instance.test_json_form_data(param, param2) +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->test_json_form_data: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **String**| field1 | + **param2** | **String**| field2 | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + + diff --git a/samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md b/samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..a6153f02926 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md @@ -0,0 +1,61 @@ +# Petstore::FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**test_classname**](FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case + + +# **test_classname** +> Client test_classname(client) + +To test class name in snake case + +To test class name in snake case + +### Example +```ruby +# load the gem +require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure API key authorization: api_key_query + config.api_key['api_key_query'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api_key_query'] = 'Bearer' +end + +api_instance = Petstore::FakeClassnameTags123Api.new +client = Petstore::Client.new # Client | client model + +begin + #To test class name in snake case + result = api_instance.test_classname(client) + p result +rescue Petstore::ApiError => e + puts "Exception when calling FakeClassnameTags123Api->test_classname: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/samples/client/petstore/ruby-faraday/docs/File.md b/samples/client/petstore/ruby-faraday/docs/File.md new file mode 100644 index 00000000000..428a5a04188 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/File.md @@ -0,0 +1,8 @@ +# Petstore::File + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source_uri** | **String** | Test capitalization | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/FileSchemaTestClass.md b/samples/client/petstore/ruby-faraday/docs/FileSchemaTestClass.md new file mode 100644 index 00000000000..d32819b3578 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/FileSchemaTestClass.md @@ -0,0 +1,9 @@ +# Petstore::FileSchemaTestClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | **File** | | [optional] +**files** | **Array<File>** | | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/FormatTest.md b/samples/client/petstore/ruby-faraday/docs/FormatTest.md new file mode 100644 index 00000000000..ad9b8191dce --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/FormatTest.md @@ -0,0 +1,20 @@ +# Petstore::FormatTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **Integer** | | [optional] +**int32** | **Integer** | | [optional] +**int64** | **Integer** | | [optional] +**number** | **Float** | | +**float** | **Float** | | [optional] +**double** | **Float** | | [optional] +**string** | **String** | | [optional] +**byte** | **String** | | +**binary** | **File** | | [optional] +**date** | **Date** | | +**date_time** | **DateTime** | | [optional] +**uuid** | **String** | | [optional] +**password** | **String** | | + + diff --git a/samples/client/petstore/ruby-faraday/docs/HasOnlyReadOnly.md b/samples/client/petstore/ruby-faraday/docs/HasOnlyReadOnly.md new file mode 100644 index 00000000000..16de3c060cc --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/HasOnlyReadOnly.md @@ -0,0 +1,9 @@ +# Petstore::HasOnlyReadOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] +**foo** | **String** | | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/List.md b/samples/client/petstore/ruby-faraday/docs/List.md new file mode 100644 index 00000000000..211d299f671 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/List.md @@ -0,0 +1,8 @@ +# Petstore::List + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123_list** | **String** | | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/MapTest.md b/samples/client/petstore/ruby-faraday/docs/MapTest.md new file mode 100644 index 00000000000..54e16e1933e --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/MapTest.md @@ -0,0 +1,11 @@ +# Petstore::MapTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**map_map_of_string** | **Hash<String, Hash<String, String>>** | | [optional] +**map_of_enum_string** | **Hash<String, String>** | | [optional] +**direct_map** | **Hash<String, BOOLEAN>** | | [optional] +**indirect_map** | **Hash<String, BOOLEAN>** | | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/ruby-faraday/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..dcb02e2ffa6 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,10 @@ +# Petstore::MixedPropertiesAndAdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **String** | | [optional] +**date_time** | **DateTime** | | [optional] +**map** | [**Hash<String, Animal>**](Animal.md) | | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/Model200Response.md b/samples/client/petstore/ruby-faraday/docs/Model200Response.md new file mode 100644 index 00000000000..e745da1a756 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/Model200Response.md @@ -0,0 +1,9 @@ +# Petstore::Model200Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **Integer** | | [optional] +**_class** | **String** | | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/ModelReturn.md b/samples/client/petstore/ruby-faraday/docs/ModelReturn.md new file mode 100644 index 00000000000..dfcfff1dd06 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/ModelReturn.md @@ -0,0 +1,8 @@ +# Petstore::ModelReturn + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_return** | **Integer** | | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/Name.md b/samples/client/petstore/ruby-faraday/docs/Name.md new file mode 100644 index 00000000000..1ae49f8ee1b --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/Name.md @@ -0,0 +1,11 @@ +# Petstore::Name + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **Integer** | | +**snake_case** | **Integer** | | [optional] +**property** | **String** | | [optional] +**_123_number** | **Integer** | | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/NumberOnly.md b/samples/client/petstore/ruby-faraday/docs/NumberOnly.md new file mode 100644 index 00000000000..4be8a12a79d --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/NumberOnly.md @@ -0,0 +1,8 @@ +# Petstore::NumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**just_number** | **Float** | | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/Order.md b/samples/client/petstore/ruby-faraday/docs/Order.md new file mode 100644 index 00000000000..52a832c5106 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/Order.md @@ -0,0 +1,13 @@ +# Petstore::Order + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | | [optional] +**pet_id** | **Integer** | | [optional] +**quantity** | **Integer** | | [optional] +**ship_date** | **DateTime** | | [optional] +**status** | **String** | Order Status | [optional] +**complete** | **BOOLEAN** | | [optional] [default to false] + + diff --git a/samples/client/petstore/ruby-faraday/docs/OuterComposite.md b/samples/client/petstore/ruby-faraday/docs/OuterComposite.md new file mode 100644 index 00000000000..e1548870a7b --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/OuterComposite.md @@ -0,0 +1,10 @@ +# Petstore::OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**my_number** | **Float** | | [optional] +**my_string** | **String** | | [optional] +**my_boolean** | **BOOLEAN** | | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/OuterEnum.md b/samples/client/petstore/ruby-faraday/docs/OuterEnum.md new file mode 100644 index 00000000000..60d87c12381 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/OuterEnum.md @@ -0,0 +1,7 @@ +# Petstore::OuterEnum + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/samples/client/petstore/ruby-faraday/docs/Pet.md b/samples/client/petstore/ruby-faraday/docs/Pet.md new file mode 100644 index 00000000000..f4320a0b72b --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/Pet.md @@ -0,0 +1,13 @@ +# Petstore::Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **String** | | +**photo_urls** | **Array<String>** | | +**tags** | [**Array<Tag>**](Tag.md) | | [optional] +**status** | **String** | pet status in the store | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/PetApi.md b/samples/client/petstore/ruby-faraday/docs/PetApi.md new file mode 100644 index 00000000000..61adf80830b --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/PetApi.md @@ -0,0 +1,475 @@ +# Petstore::PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet +[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image +[**upload_file_with_required_file**](PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) + + +# **add_pet** +> add_pet(pet) + +Add a new pet to the store + +### Example +```ruby +# load the gem +require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure OAuth2 access token for authorization: petstore_auth + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = Petstore::PetApi.new +pet = Petstore::Pet.new # Pet | Pet object that needs to be added to the store + +begin + #Add a new pet to the store + api_instance.add_pet(pet) +rescue Petstore::ApiError => e + puts "Exception when calling PetApi->add_pet: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +nil (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + + +# **delete_pet** +> delete_pet(pet_id, opts) + +Deletes a pet + +### Example +```ruby +# load the gem +require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure OAuth2 access token for authorization: petstore_auth + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = Petstore::PetApi.new +pet_id = 56 # Integer | Pet id to delete +opts = { + api_key: 'api_key_example' # String | +} + +begin + #Deletes a pet + api_instance.delete_pet(pet_id, opts) +rescue Petstore::ApiError => e + puts "Exception when calling PetApi->delete_pet: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **Integer**| Pet id to delete | + **api_key** | **String**| | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + + +# **find_pets_by_status** +> Array<Pet> find_pets_by_status(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```ruby +# load the gem +require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure OAuth2 access token for authorization: petstore_auth + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = Petstore::PetApi.new +status = ['status_example'] # Array | Status values that need to be considered for filter + +begin + #Finds Pets by status + result = api_instance.find_pets_by_status(status) + p result +rescue Petstore::ApiError => e + puts "Exception when calling PetApi->find_pets_by_status: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**Array<String>**](String.md)| Status values that need to be considered for filter | + +### Return type + +[**Array<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + + +# **find_pets_by_tags** +> Array<Pet> find_pets_by_tags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```ruby +# load the gem +require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure OAuth2 access token for authorization: petstore_auth + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = Petstore::PetApi.new +tags = ['tags_example'] # Array | Tags to filter by + +begin + #Finds Pets by tags + result = api_instance.find_pets_by_tags(tags) + p result +rescue Petstore::ApiError => e + puts "Exception when calling PetApi->find_pets_by_tags: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**Array<String>**](String.md)| Tags to filter by | + +### Return type + +[**Array<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + + +# **get_pet_by_id** +> Pet get_pet_by_id(pet_id) + +Find pet by ID + +Returns a single pet + +### Example +```ruby +# load the gem +require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure API key authorization: api_key + config.api_key['api_key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api_key'] = 'Bearer' +end + +api_instance = Petstore::PetApi.new +pet_id = 56 # Integer | ID of pet to return + +begin + #Find pet by ID + result = api_instance.get_pet_by_id(pet_id) + p result +rescue Petstore::ApiError => e + puts "Exception when calling PetApi->get_pet_by_id: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **Integer**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + + +# **update_pet** +> update_pet(pet) + +Update an existing pet + +### Example +```ruby +# load the gem +require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure OAuth2 access token for authorization: petstore_auth + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = Petstore::PetApi.new +pet = Petstore::Pet.new # Pet | Pet object that needs to be added to the store + +begin + #Update an existing pet + api_instance.update_pet(pet) +rescue Petstore::ApiError => e + puts "Exception when calling PetApi->update_pet: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +nil (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + + +# **update_pet_with_form** +> update_pet_with_form(pet_id, opts) + +Updates a pet in the store with form data + +### Example +```ruby +# load the gem +require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure OAuth2 access token for authorization: petstore_auth + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = Petstore::PetApi.new +pet_id = 56 # Integer | ID of pet that needs to be updated +opts = { + name: 'name_example', # String | Updated name of the pet + status: 'status_example' # String | Updated status of the pet +} + +begin + #Updates a pet in the store with form data + api_instance.update_pet_with_form(pet_id, opts) +rescue Petstore::ApiError => e + puts "Exception when calling PetApi->update_pet_with_form: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **Integer**| ID of pet that needs to be updated | + **name** | **String**| Updated name of the pet | [optional] + **status** | **String**| Updated status of the pet | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + + +# **upload_file** +> ApiResponse upload_file(pet_id, opts) + +uploads an image + +### Example +```ruby +# load the gem +require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure OAuth2 access token for authorization: petstore_auth + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = Petstore::PetApi.new +pet_id = 56 # Integer | ID of pet to update +opts = { + additional_metadata: 'additional_metadata_example', # String | Additional data to pass to server + file: File.new('/path/to/file') # File | file to upload +} + +begin + #uploads an image + result = api_instance.upload_file(pet_id, opts) + p result +rescue Petstore::ApiError => e + puts "Exception when calling PetApi->upload_file: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **Integer**| ID of pet to update | + **additional_metadata** | **String**| Additional data to pass to server | [optional] + **file** | **File**| file to upload | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + + +# **upload_file_with_required_file** +> ApiResponse upload_file_with_required_file(pet_id, required_file, opts) + +uploads an image (required) + +### Example +```ruby +# load the gem +require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure OAuth2 access token for authorization: petstore_auth + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = Petstore::PetApi.new +pet_id = 56 # Integer | ID of pet to update +required_file = File.new('/path/to/file') # File | file to upload +opts = { + additional_metadata: 'additional_metadata_example' # String | Additional data to pass to server +} + +begin + #uploads an image (required) + result = api_instance.upload_file_with_required_file(pet_id, required_file, opts) + p result +rescue Petstore::ApiError => e + puts "Exception when calling PetApi->upload_file_with_required_file: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **Integer**| ID of pet to update | + **required_file** | **File**| file to upload | + **additional_metadata** | **String**| Additional data to pass to server | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + + diff --git a/samples/client/petstore/ruby-faraday/docs/ReadOnlyFirst.md b/samples/client/petstore/ruby-faraday/docs/ReadOnlyFirst.md new file mode 100644 index 00000000000..e49b5119478 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/ReadOnlyFirst.md @@ -0,0 +1,9 @@ +# Petstore::ReadOnlyFirst + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] +**baz** | **String** | | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/SpecialModelName.md b/samples/client/petstore/ruby-faraday/docs/SpecialModelName.md new file mode 100644 index 00000000000..581ab6907ef --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/SpecialModelName.md @@ -0,0 +1,8 @@ +# Petstore::SpecialModelName + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**special_property_name** | **Integer** | | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/StoreApi.md b/samples/client/petstore/ruby-faraday/docs/StoreApi.md new file mode 100644 index 00000000000..2ebdc4ddc0e --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/StoreApi.md @@ -0,0 +1,192 @@ +# Petstore::StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status +[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID +[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet + + +# **delete_order** +> delete_order(order_id) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::StoreApi.new +order_id = 'order_id_example' # String | ID of the order that needs to be deleted + +begin + #Delete purchase order by ID + api_instance.delete_order(order_id) +rescue Petstore::ApiError => e + puts "Exception when calling StoreApi->delete_order: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **String**| ID of the order that needs to be deleted | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + + +# **get_inventory** +> Hash<String, Integer> get_inventory + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```ruby +# load the gem +require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure API key authorization: api_key + config.api_key['api_key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api_key'] = 'Bearer' +end + +api_instance = Petstore::StoreApi.new + +begin + #Returns pet inventories by status + result = api_instance.get_inventory + p result +rescue Petstore::ApiError => e + puts "Exception when calling StoreApi->get_inventory: #{e}" +end +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Hash<String, Integer>** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + + +# **get_order_by_id** +> Order get_order_by_id(order_id) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::StoreApi.new +order_id = 56 # Integer | ID of pet that needs to be fetched + +begin + #Find purchase order by ID + result = api_instance.get_order_by_id(order_id) + p result +rescue Petstore::ApiError => e + puts "Exception when calling StoreApi->get_order_by_id: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **Integer**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + + +# **place_order** +> Order place_order(order) + +Place an order for a pet + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::StoreApi.new +order = Petstore::Order.new # Order | order placed for purchasing the pet + +begin + #Place an order for a pet + result = api_instance.place_order(order) + p result +rescue Petstore::ApiError => e + puts "Exception when calling StoreApi->place_order: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + + diff --git a/samples/client/petstore/ruby-faraday/docs/StringBooleanMap.md b/samples/client/petstore/ruby-faraday/docs/StringBooleanMap.md new file mode 100644 index 00000000000..0fbc07cb043 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/StringBooleanMap.md @@ -0,0 +1,7 @@ +# Petstore::StringBooleanMap + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/samples/client/petstore/ruby-faraday/docs/Tag.md b/samples/client/petstore/ruby-faraday/docs/Tag.md new file mode 100644 index 00000000000..5bd94d6c04e --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/Tag.md @@ -0,0 +1,9 @@ +# Petstore::Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | | [optional] +**name** | **String** | | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/User.md b/samples/client/petstore/ruby-faraday/docs/User.md new file mode 100644 index 00000000000..bd76116e023 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/User.md @@ -0,0 +1,15 @@ +# Petstore::User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | | [optional] +**username** | **String** | | [optional] +**first_name** | **String** | | [optional] +**last_name** | **String** | | [optional] +**email** | **String** | | [optional] +**password** | **String** | | [optional] +**phone** | **String** | | [optional] +**user_status** | **Integer** | User Status | [optional] + + diff --git a/samples/client/petstore/ruby-faraday/docs/UserApi.md b/samples/client/petstore/ruby-faraday/docs/UserApi.md new file mode 100644 index 00000000000..ae8f3fad0f1 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/UserApi.md @@ -0,0 +1,360 @@ +# Petstore::UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_user**](UserApi.md#create_user) | **POST** /user | Create user +[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array +[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array +[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system +[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user + + +# **create_user** +> create_user(user) + +Create user + +This can only be done by the logged in user. + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::UserApi.new +user = Petstore::User.new # User | Created user object + +begin + #Create user + api_instance.create_user(user) +rescue Petstore::ApiError => e + puts "Exception when calling UserApi->create_user: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md)| Created user object | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + + +# **create_users_with_array_input** +> create_users_with_array_input(user) + +Creates list of users with given input array + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::UserApi.new +user = nil # Array | List of user object + +begin + #Creates list of users with given input array + api_instance.create_users_with_array_input(user) +rescue Petstore::ApiError => e + puts "Exception when calling UserApi->create_users_with_array_input: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**Array<User>**](Array.md)| List of user object | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + + +# **create_users_with_list_input** +> create_users_with_list_input(user) + +Creates list of users with given input array + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::UserApi.new +user = nil # Array | List of user object + +begin + #Creates list of users with given input array + api_instance.create_users_with_list_input(user) +rescue Petstore::ApiError => e + puts "Exception when calling UserApi->create_users_with_list_input: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**Array<User>**](Array.md)| List of user object | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + + +# **delete_user** +> delete_user(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::UserApi.new +username = 'username_example' # String | The name that needs to be deleted + +begin + #Delete user + api_instance.delete_user(username) +rescue Petstore::ApiError => e + puts "Exception when calling UserApi->delete_user: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be deleted | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + + +# **get_user_by_name** +> User get_user_by_name(username) + +Get user by user name + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::UserApi.new +username = 'username_example' # String | The name that needs to be fetched. Use user1 for testing. + +begin + #Get user by user name + result = api_instance.get_user_by_name(username) + p result +rescue Petstore::ApiError => e + puts "Exception when calling UserApi->get_user_by_name: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + + +# **login_user** +> String login_user(username, password) + +Logs user into the system + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::UserApi.new +username = 'username_example' # String | The user name for login +password = 'password_example' # String | The password for login in clear text + +begin + #Logs user into the system + result = api_instance.login_user(username, password) + p result +rescue Petstore::ApiError => e + puts "Exception when calling UserApi->login_user: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The user name for login | + **password** | **String**| The password for login in clear text | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + + +# **logout_user** +> logout_user + +Logs out current logged in user session + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::UserApi.new + +begin + #Logs out current logged in user session + api_instance.logout_user +rescue Petstore::ApiError => e + puts "Exception when calling UserApi->logout_user: #{e}" +end +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + + +# **update_user** +> update_user(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::UserApi.new +username = 'username_example' # String | name that need to be deleted +user = Petstore::User.new # User | Updated user object + +begin + #Updated user + api_instance.update_user(username, user) +rescue Petstore::ApiError => e + puts "Exception when calling UserApi->update_user: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| name that need to be deleted | + **user** | [**User**](User.md)| Updated user object | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + + diff --git a/samples/client/petstore/ruby-faraday/git_push.sh b/samples/client/petstore/ruby-faraday/git_push.sh new file mode 100644 index 00000000000..b9fd6af8e05 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/git_push.sh @@ -0,0 +1,55 @@ +#!/bin/sh +# +# Generated by: https://openapi-generator.tech +# +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/client/petstore/ruby-faraday/lib/petstore.rb b/samples/client/petstore/ruby-faraday/lib/petstore.rb new file mode 100644 index 00000000000..63c881c52fd --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore.rb @@ -0,0 +1,81 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +# Common files +require 'petstore/api_client' +require 'petstore/api_error' +require 'petstore/version' +require 'petstore/configuration' + +# Models +require 'petstore/models/additional_properties_class' +require 'petstore/models/animal' +require 'petstore/models/animal_farm' +require 'petstore/models/api_response' +require 'petstore/models/array_of_array_of_number_only' +require 'petstore/models/array_of_number_only' +require 'petstore/models/array_test' +require 'petstore/models/capitalization' +require 'petstore/models/cat' +require 'petstore/models/category' +require 'petstore/models/class_model' +require 'petstore/models/client' +require 'petstore/models/dog' +require 'petstore/models/enum_arrays' +require 'petstore/models/enum_class' +require 'petstore/models/enum_test' +require 'petstore/models/file' +require 'petstore/models/file_schema_test_class' +require 'petstore/models/format_test' +require 'petstore/models/has_only_read_only' +require 'petstore/models/list' +require 'petstore/models/map_test' +require 'petstore/models/mixed_properties_and_additional_properties_class' +require 'petstore/models/model200_response' +require 'petstore/models/model_return' +require 'petstore/models/name' +require 'petstore/models/number_only' +require 'petstore/models/order' +require 'petstore/models/outer_composite' +require 'petstore/models/outer_enum' +require 'petstore/models/pet' +require 'petstore/models/read_only_first' +require 'petstore/models/special_model_name' +require 'petstore/models/string_boolean_map' +require 'petstore/models/tag' +require 'petstore/models/user' + +# APIs +require 'petstore/api/another_fake_api' +require 'petstore/api/fake_api' +require 'petstore/api/fake_classname_tags123_api' +require 'petstore/api/pet_api' +require 'petstore/api/store_api' +require 'petstore/api/user_api' + +module Petstore + class << self + # Customize default settings for the SDK using block. + # Petstore.configure do |config| + # config.username = "xxx" + # config.password = "xxx" + # end + # If no block given, return the default Configuration object. + def configure + if block_given? + yield(Configuration.default) + else + Configuration.default + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb new file mode 100644 index 00000000000..71fb17eeb8a --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb @@ -0,0 +1,78 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'uri' + +module Petstore + class AnotherFakeApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # To test special tags + # To test special tags and operation ID starting with number + # @param client client model + # @param [Hash] opts the optional parameters + # @return [Client] + def call_123_test_special_tags(client, opts = {}) + data, _status_code, _headers = call_123_test_special_tags_with_http_info(client, opts) + data + end + + # To test special tags + # To test special tags and operation ID starting with number + # @param client client model + # @param [Hash] opts the optional parameters + # @return [Array<(Client, Fixnum, Hash)>] Client data, response status code and response headers + def call_123_test_special_tags_with_http_info(client, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AnotherFakeApi.call_123_test_special_tags ...' + end + # verify the required parameter 'client' is set + if @api_client.config.client_side_validation && client.nil? + fail ArgumentError, "Missing the required parameter 'client' when calling AnotherFakeApi.call_123_test_special_tags" + end + # resource path + local_var_path = '/another-fake/dummy' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(client) + auth_names = [] + data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Client') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AnotherFakeApi#call_123_test_special_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb new file mode 100644 index 00000000000..b4de2621434 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb @@ -0,0 +1,803 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'uri' + +module Petstore + class FakeApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Test serialization of outer boolean types + # @param [Hash] opts the optional parameters + # @option opts [BOOLEAN] :body Input boolean as post body + # @return [BOOLEAN] + def fake_outer_boolean_serialize(opts = {}) + data, _status_code, _headers = fake_outer_boolean_serialize_with_http_info(opts) + data + end + + # Test serialization of outer boolean types + # @param [Hash] opts the optional parameters + # @option opts [BOOLEAN] :body Input boolean as post body + # @return [Array<(BOOLEAN, Fixnum, Hash)>] BOOLEAN data, response status code and response headers + def fake_outer_boolean_serialize_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.fake_outer_boolean_serialize ...' + end + # resource path + local_var_path = '/fake/outer/boolean' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(opts[:'body']) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'BOOLEAN') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#fake_outer_boolean_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Test serialization of object with outer number type + # @param [Hash] opts the optional parameters + # @option opts [OuterComposite] :outer_composite Input composite as post body + # @return [OuterComposite] + def fake_outer_composite_serialize(opts = {}) + data, _status_code, _headers = fake_outer_composite_serialize_with_http_info(opts) + data + end + + # Test serialization of object with outer number type + # @param [Hash] opts the optional parameters + # @option opts [OuterComposite] :outer_composite Input composite as post body + # @return [Array<(OuterComposite, Fixnum, Hash)>] OuterComposite data, response status code and response headers + def fake_outer_composite_serialize_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.fake_outer_composite_serialize ...' + end + # resource path + local_var_path = '/fake/outer/composite' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(opts[:'outer_composite']) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'OuterComposite') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#fake_outer_composite_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Test serialization of outer number types + # @param [Hash] opts the optional parameters + # @option opts [Float] :body Input number as post body + # @return [Float] + def fake_outer_number_serialize(opts = {}) + data, _status_code, _headers = fake_outer_number_serialize_with_http_info(opts) + data + end + + # Test serialization of outer number types + # @param [Hash] opts the optional parameters + # @option opts [Float] :body Input number as post body + # @return [Array<(Float, Fixnum, Hash)>] Float data, response status code and response headers + def fake_outer_number_serialize_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.fake_outer_number_serialize ...' + end + # resource path + local_var_path = '/fake/outer/number' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(opts[:'body']) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Float') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#fake_outer_number_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Test serialization of outer string types + # @param [Hash] opts the optional parameters + # @option opts [String] :body Input string as post body + # @return [String] + def fake_outer_string_serialize(opts = {}) + data, _status_code, _headers = fake_outer_string_serialize_with_http_info(opts) + data + end + + # Test serialization of outer string types + # @param [Hash] opts the optional parameters + # @option opts [String] :body Input string as post body + # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers + def fake_outer_string_serialize_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.fake_outer_string_serialize ...' + end + # resource path + local_var_path = '/fake/outer/string' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(opts[:'body']) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'String') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#fake_outer_string_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # For this test, the body for this request much reference a schema named `File`. + # @param file_schema_test_class + # @param [Hash] opts the optional parameters + # @return [nil] + def test_body_with_file_schema(file_schema_test_class, opts = {}) + test_body_with_file_schema_with_http_info(file_schema_test_class, opts) + nil + end + + # For this test, the body for this request much reference a schema named `File`. + # @param file_schema_test_class + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def test_body_with_file_schema_with_http_info(file_schema_test_class, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_body_with_file_schema ...' + end + # verify the required parameter 'file_schema_test_class' is set + if @api_client.config.client_side_validation && file_schema_test_class.nil? + fail ArgumentError, "Missing the required parameter 'file_schema_test_class' when calling FakeApi.test_body_with_file_schema" + end + # resource path + local_var_path = '/fake/body-with-file-schema' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(file_schema_test_class) + auth_names = [] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_body_with_file_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # @param query + # @param user + # @param [Hash] opts the optional parameters + # @return [nil] + def test_body_with_query_params(query, user, opts = {}) + test_body_with_query_params_with_http_info(query, user, opts) + nil + end + + # @param query + # @param user + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def test_body_with_query_params_with_http_info(query, user, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_body_with_query_params ...' + end + # verify the required parameter 'query' is set + if @api_client.config.client_side_validation && query.nil? + fail ArgumentError, "Missing the required parameter 'query' when calling FakeApi.test_body_with_query_params" + end + # verify the required parameter 'user' is set + if @api_client.config.client_side_validation && user.nil? + fail ArgumentError, "Missing the required parameter 'user' when calling FakeApi.test_body_with_query_params" + end + # resource path + local_var_path = '/fake/body-with-query-params' + + # query parameters + query_params = {} + query_params[:'query'] = query + + # header parameters + header_params = {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(user) + auth_names = [] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_body_with_query_params\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # To test \"client\" model + # To test \"client\" model + # @param client client model + # @param [Hash] opts the optional parameters + # @return [Client] + def test_client_model(client, opts = {}) + data, _status_code, _headers = test_client_model_with_http_info(client, opts) + data + end + + # To test \"client\" model + # To test \"client\" model + # @param client client model + # @param [Hash] opts the optional parameters + # @return [Array<(Client, Fixnum, Hash)>] Client data, response status code and response headers + def test_client_model_with_http_info(client, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_client_model ...' + end + # verify the required parameter 'client' is set + if @api_client.config.client_side_validation && client.nil? + fail ArgumentError, "Missing the required parameter 'client' when calling FakeApi.test_client_model" + end + # resource path + local_var_path = '/fake' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(client) + auth_names = [] + data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Client') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_client_model\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # @param number None + # @param double None + # @param pattern_without_delimiter None + # @param byte None + # @param [Hash] opts the optional parameters + # @option opts [Integer] :integer None + # @option opts [Integer] :int32 None + # @option opts [Integer] :int64 None + # @option opts [Float] :float None + # @option opts [String] :string None + # @option opts [File] :binary None + # @option opts [Date] :date None + # @option opts [DateTime] :date_time None + # @option opts [String] :password None + # @option opts [String] :callback None + # @return [nil] + def test_endpoint_parameters(number, double, pattern_without_delimiter, byte, opts = {}) + test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, opts) + nil + end + + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # @param number None + # @param double None + # @param pattern_without_delimiter None + # @param byte None + # @param [Hash] opts the optional parameters + # @option opts [Integer] :integer None + # @option opts [Integer] :int32 None + # @option opts [Integer] :int64 None + # @option opts [Float] :float None + # @option opts [String] :string None + # @option opts [File] :binary None + # @option opts [Date] :date None + # @option opts [DateTime] :date_time None + # @option opts [String] :password None + # @option opts [String] :callback None + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_endpoint_parameters ...' + end + # verify the required parameter 'number' is set + if @api_client.config.client_side_validation && number.nil? + fail ArgumentError, "Missing the required parameter 'number' when calling FakeApi.test_endpoint_parameters" + end + if @api_client.config.client_side_validation && number > 543.2 + fail ArgumentError, 'invalid value for "number" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 543.2.' + end + + if @api_client.config.client_side_validation && number < 32.1 + fail ArgumentError, 'invalid value for "number" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 32.1.' + end + + # verify the required parameter 'double' is set + if @api_client.config.client_side_validation && double.nil? + fail ArgumentError, "Missing the required parameter 'double' when calling FakeApi.test_endpoint_parameters" + end + if @api_client.config.client_side_validation && double > 123.4 + fail ArgumentError, 'invalid value for "double" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 123.4.' + end + + if @api_client.config.client_side_validation && double < 67.8 + fail ArgumentError, 'invalid value for "double" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 67.8.' + end + + # verify the required parameter 'pattern_without_delimiter' is set + if @api_client.config.client_side_validation && pattern_without_delimiter.nil? + fail ArgumentError, "Missing the required parameter 'pattern_without_delimiter' when calling FakeApi.test_endpoint_parameters" + end + if @api_client.config.client_side_validation && pattern_without_delimiter !~ Regexp.new(/^[A-Z].*/) + fail ArgumentError, "invalid value for 'pattern_without_delimiter' when calling FakeApi.test_endpoint_parameters, must conform to the pattern /^[A-Z].*/." + end + + # verify the required parameter 'byte' is set + if @api_client.config.client_side_validation && byte.nil? + fail ArgumentError, "Missing the required parameter 'byte' when calling FakeApi.test_endpoint_parameters" + end + if @api_client.config.client_side_validation && !opts[:'integer'].nil? && opts[:'integer'] > 100 + fail ArgumentError, 'invalid value for "opts[:"integer"]" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 100.' + end + + if @api_client.config.client_side_validation && !opts[:'integer'].nil? && opts[:'integer'] < 10 + fail ArgumentError, 'invalid value for "opts[:"integer"]" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 10.' + end + + if @api_client.config.client_side_validation && !opts[:'int32'].nil? && opts[:'int32'] > 200 + fail ArgumentError, 'invalid value for "opts[:"int32"]" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 200.' + end + + if @api_client.config.client_side_validation && !opts[:'int32'].nil? && opts[:'int32'] < 20 + fail ArgumentError, 'invalid value for "opts[:"int32"]" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 20.' + end + + if @api_client.config.client_side_validation && !opts[:'float'].nil? && opts[:'float'] > 987.6 + fail ArgumentError, 'invalid value for "opts[:"float"]" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 987.6.' + end + + if @api_client.config.client_side_validation && !opts[:'string'].nil? && opts[:'string'] !~ Regexp.new(/[a-z]/i) + fail ArgumentError, "invalid value for 'opts[:\"string\"]' when calling FakeApi.test_endpoint_parameters, must conform to the pattern /[a-z]/i." + end + + if @api_client.config.client_side_validation && !opts[:'password'].nil? && opts[:'password'].to_s.length > 64 + fail ArgumentError, 'invalid value for "opts[:"password"]" when calling FakeApi.test_endpoint_parameters, the character length must be smaller than or equal to 64.' + end + + if @api_client.config.client_side_validation && !opts[:'password'].nil? && opts[:'password'].to_s.length < 10 + fail ArgumentError, 'invalid value for "opts[:"password"]" when calling FakeApi.test_endpoint_parameters, the character length must be great than or equal to 10.' + end + + # resource path + local_var_path = '/fake' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) + + # form parameters + form_params = {} + form_params['number'] = number + form_params['double'] = double + form_params['pattern_without_delimiter'] = pattern_without_delimiter + form_params['byte'] = byte + form_params['integer'] = opts[:'integer'] if !opts[:'integer'].nil? + form_params['int32'] = opts[:'int32'] if !opts[:'int32'].nil? + form_params['int64'] = opts[:'int64'] if !opts[:'int64'].nil? + form_params['float'] = opts[:'float'] if !opts[:'float'].nil? + form_params['string'] = opts[:'string'] if !opts[:'string'].nil? + form_params['binary'] = opts[:'binary'] if !opts[:'binary'].nil? + form_params['date'] = opts[:'date'] if !opts[:'date'].nil? + form_params['dateTime'] = opts[:'date_time'] if !opts[:'date_time'].nil? + form_params['password'] = opts[:'password'] if !opts[:'password'].nil? + form_params['callback'] = opts[:'callback'] if !opts[:'callback'].nil? + + # http body (model) + post_body = nil + auth_names = ['http_basic_test'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_endpoint_parameters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # To test enum parameters + # To test enum parameters + # @param [Hash] opts the optional parameters + # @option opts [Array] :enum_header_string_array Header parameter enum test (string array) + # @option opts [String] :enum_header_string Header parameter enum test (string) (default to '-efg') + # @option opts [Array] :enum_query_string_array Query parameter enum test (string array) + # @option opts [String] :enum_query_string Query parameter enum test (string) (default to '-efg') + # @option opts [Integer] :enum_query_integer Query parameter enum test (double) + # @option opts [Float] :enum_query_double Query parameter enum test (double) + # @option opts [Array] :enum_form_string_array Form parameter enum test (string array) (default to '$') + # @option opts [String] :enum_form_string Form parameter enum test (string) (default to '-efg') + # @return [nil] + def test_enum_parameters(opts = {}) + test_enum_parameters_with_http_info(opts) + nil + end + + # To test enum parameters + # To test enum parameters + # @param [Hash] opts the optional parameters + # @option opts [Array] :enum_header_string_array Header parameter enum test (string array) + # @option opts [String] :enum_header_string Header parameter enum test (string) + # @option opts [Array] :enum_query_string_array Query parameter enum test (string array) + # @option opts [String] :enum_query_string Query parameter enum test (string) + # @option opts [Integer] :enum_query_integer Query parameter enum test (double) + # @option opts [Float] :enum_query_double Query parameter enum test (double) + # @option opts [Array] :enum_form_string_array Form parameter enum test (string array) + # @option opts [String] :enum_form_string Form parameter enum test (string) + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def test_enum_parameters_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_enum_parameters ...' + end + if @api_client.config.client_side_validation && opts[:'enum_header_string_array'] && !opts[:'enum_header_string_array'].all? { |item| ['>', '$'].include?(item) } + fail ArgumentError, 'invalid value for "enum_header_string_array", must include one of >, $' + end + if @api_client.config.client_side_validation && opts[:'enum_header_string'] && !['_abc', '-efg', '(xyz)'].include?(opts[:'enum_header_string']) + fail ArgumentError, 'invalid value for "enum_header_string", must be one of _abc, -efg, (xyz)' + end + if @api_client.config.client_side_validation && opts[:'enum_query_string_array'] && !opts[:'enum_query_string_array'].all? { |item| ['>', '$'].include?(item) } + fail ArgumentError, 'invalid value for "enum_query_string_array", must include one of >, $' + end + if @api_client.config.client_side_validation && opts[:'enum_query_string'] && !['_abc', '-efg', '(xyz)'].include?(opts[:'enum_query_string']) + fail ArgumentError, 'invalid value for "enum_query_string", must be one of _abc, -efg, (xyz)' + end + if @api_client.config.client_side_validation && opts[:'enum_query_integer'] && !['1', '-2'].include?(opts[:'enum_query_integer']) + fail ArgumentError, 'invalid value for "enum_query_integer", must be one of 1, -2' + end + if @api_client.config.client_side_validation && opts[:'enum_query_double'] && !['1.1', '-1.2'].include?(opts[:'enum_query_double']) + fail ArgumentError, 'invalid value for "enum_query_double", must be one of 1.1, -1.2' + end + if @api_client.config.client_side_validation && opts[:'enum_form_string_array'] && !opts[:'enum_form_string_array'].all? { |item| ['>', '$'].include?(item) } + fail ArgumentError, 'invalid value for "enum_form_string_array", must include one of >, $' + end + if @api_client.config.client_side_validation && opts[:'enum_form_string'] && !['_abc', '-efg', '(xyz)'].include?(opts[:'enum_form_string']) + fail ArgumentError, 'invalid value for "enum_form_string", must be one of _abc, -efg, (xyz)' + end + # resource path + local_var_path = '/fake' + + # query parameters + 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'] = opts[:'enum_query_string'] if !opts[:'enum_query_string'].nil? + query_params[:'enum_query_integer'] = opts[:'enum_query_integer'] if !opts[:'enum_query_integer'].nil? + query_params[:'enum_query_double'] = opts[:'enum_query_double'] if !opts[:'enum_query_double'].nil? + + # header parameters + header_params = {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) + header_params[:'enum_header_string_array'] = @api_client.build_collection_param(opts[:'enum_header_string_array'], :csv) if !opts[:'enum_header_string_array'].nil? + header_params[:'enum_header_string'] = opts[:'enum_header_string'] if !opts[:'enum_header_string'].nil? + + # form parameters + form_params = {} + form_params['enum_form_string_array'] = @api_client.build_collection_param(opts[:'enum_form_string_array'], :csv) if !opts[:'enum_form_string_array'].nil? + form_params['enum_form_string'] = opts[:'enum_form_string'] if !opts[:'enum_form_string'].nil? + + # http body (model) + post_body = nil + auth_names = [] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_enum_parameters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Fake endpoint to test group parameters (optional) + # Fake endpoint to test group parameters (optional) + # @param required_string_group Required String in group parameters + # @param required_boolean_group Required Boolean in group parameters + # @param required_int64_group Required Integer in group parameters + # @param [Hash] opts the optional parameters + # @option opts [Integer] :string_group String in group parameters + # @option opts [BOOLEAN] :boolean_group Boolean in group parameters + # @option opts [Integer] :int64_group Integer in group parameters + # @return [nil] + def test_group_parameters(required_string_group, required_boolean_group, required_int64_group, opts = {}) + test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, opts) + nil + end + + # Fake endpoint to test group parameters (optional) + # Fake endpoint to test group parameters (optional) + # @param required_string_group Required String in group parameters + # @param required_boolean_group Required Boolean in group parameters + # @param required_int64_group Required Integer in group parameters + # @param [Hash] opts the optional parameters + # @option opts [Integer] :string_group String in group parameters + # @option opts [BOOLEAN] :boolean_group Boolean in group parameters + # @option opts [Integer] :int64_group Integer in group parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_group_parameters ...' + end + # verify the required parameter 'required_string_group' is set + if @api_client.config.client_side_validation && required_string_group.nil? + fail ArgumentError, "Missing the required parameter 'required_string_group' when calling FakeApi.test_group_parameters" + end + # verify the required parameter 'required_boolean_group' is set + if @api_client.config.client_side_validation && required_boolean_group.nil? + fail ArgumentError, "Missing the required parameter 'required_boolean_group' when calling FakeApi.test_group_parameters" + end + # verify the required parameter 'required_int64_group' is set + if @api_client.config.client_side_validation && required_int64_group.nil? + fail ArgumentError, "Missing the required parameter 'required_int64_group' when calling FakeApi.test_group_parameters" + end + # resource path + local_var_path = '/fake' + + # query parameters + query_params = {} + query_params[:'required_string_group'] = required_string_group + query_params[:'required_int64_group'] = required_int64_group + query_params[:'string_group'] = opts[:'string_group'] if !opts[:'string_group'].nil? + query_params[:'int64_group'] = opts[:'int64_group'] if !opts[:'int64_group'].nil? + + # header parameters + header_params = {} + header_params[:'required_boolean_group'] = required_boolean_group + header_params[:'boolean_group'] = opts[:'boolean_group'] if !opts[:'boolean_group'].nil? + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = [] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_group_parameters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # test inline additionalProperties + # @param request_body request body + # @param [Hash] opts the optional parameters + # @return [nil] + def test_inline_additional_properties(request_body, opts = {}) + test_inline_additional_properties_with_http_info(request_body, opts) + nil + end + + # test inline additionalProperties + # @param request_body request body + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def test_inline_additional_properties_with_http_info(request_body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_inline_additional_properties ...' + end + # verify the required parameter 'request_body' is set + if @api_client.config.client_side_validation && request_body.nil? + fail ArgumentError, "Missing the required parameter 'request_body' when calling FakeApi.test_inline_additional_properties" + end + # resource path + local_var_path = '/fake/inline-additionalProperties' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(request_body) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_inline_additional_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # test json serialization of form data + # @param param field1 + # @param param2 field2 + # @param [Hash] opts the optional parameters + # @return [nil] + def test_json_form_data(param, param2, opts = {}) + test_json_form_data_with_http_info(param, param2, opts) + nil + end + + # test json serialization of form data + # @param param field1 + # @param param2 field2 + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def test_json_form_data_with_http_info(param, param2, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_json_form_data ...' + end + # verify the required parameter 'param' is set + if @api_client.config.client_side_validation && param.nil? + fail ArgumentError, "Missing the required parameter 'param' when calling FakeApi.test_json_form_data" + end + # verify the required parameter 'param2' is set + if @api_client.config.client_side_validation && param2.nil? + fail ArgumentError, "Missing the required parameter 'param2' when calling FakeApi.test_json_form_data" + end + # resource path + local_var_path = '/fake/jsonFormData' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) + + # form parameters + form_params = {} + form_params['param'] = param + form_params['param2'] = param2 + + # http body (model) + post_body = nil + auth_names = [] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_json_form_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb new file mode 100644 index 00000000000..e9aff0ba146 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb @@ -0,0 +1,78 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'uri' + +module Petstore + class FakeClassnameTags123Api + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # To test class name in snake case + # To test class name in snake case + # @param client client model + # @param [Hash] opts the optional parameters + # @return [Client] + def test_classname(client, opts = {}) + data, _status_code, _headers = test_classname_with_http_info(client, opts) + data + end + + # To test class name in snake case + # To test class name in snake case + # @param client client model + # @param [Hash] opts the optional parameters + # @return [Array<(Client, Fixnum, Hash)>] Client data, response status code and response headers + def test_classname_with_http_info(client, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeClassnameTags123Api.test_classname ...' + end + # verify the required parameter 'client' is set + if @api_client.config.client_side_validation && client.nil? + fail ArgumentError, "Missing the required parameter 'client' when calling FakeClassnameTags123Api.test_classname" + end + # resource path + local_var_path = '/fake_classname_test' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(client) + auth_names = ['api_key_query'] + data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Client') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeClassnameTags123Api#test_classname\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb new file mode 100644 index 00000000000..0dc4ac1f3c5 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb @@ -0,0 +1,513 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'uri' + +module Petstore + class PetApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Add a new pet to the store + # @param pet Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @return [nil] + def add_pet(pet, opts = {}) + add_pet_with_http_info(pet, opts) + nil + end + + # Add a new pet to the store + # @param pet Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def add_pet_with_http_info(pet, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PetApi.add_pet ...' + end + # verify the required parameter 'pet' is set + if @api_client.config.client_side_validation && pet.nil? + fail ArgumentError, "Missing the required parameter 'pet' when calling PetApi.add_pet" + end + # resource path + local_var_path = '/pet' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(pet) + auth_names = ['petstore_auth'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PetApi#add_pet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Deletes a pet + # @param pet_id Pet id to delete + # @param [Hash] opts the optional parameters + # @option opts [String] :api_key + # @return [nil] + def delete_pet(pet_id, opts = {}) + delete_pet_with_http_info(pet_id, opts) + nil + end + + # Deletes a pet + # @param pet_id Pet id to delete + # @param [Hash] opts the optional parameters + # @option opts [String] :api_key + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def delete_pet_with_http_info(pet_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PetApi.delete_pet ...' + end + # verify the required parameter 'pet_id' is set + if @api_client.config.client_side_validation && pet_id.nil? + fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.delete_pet" + end + # resource path + local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', pet_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + header_params[:'api_key'] = opts[:'api_key'] if !opts[:'api_key'].nil? + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['petstore_auth'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PetApi#delete_pet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Finds Pets by status + # Multiple status values can be provided with comma separated strings + # @param status Status values that need to be considered for filter + # @param [Hash] opts the optional parameters + # @return [Array] + def find_pets_by_status(status, opts = {}) + data, _status_code, _headers = find_pets_by_status_with_http_info(status, opts) + data + end + + # Finds Pets by status + # Multiple status values can be provided with comma separated strings + # @param status Status values that need to be considered for filter + # @param [Hash] opts the optional parameters + # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers + def find_pets_by_status_with_http_info(status, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PetApi.find_pets_by_status ...' + end + # verify the required parameter 'status' is set + if @api_client.config.client_side_validation && status.nil? + fail ArgumentError, "Missing the required parameter 'status' when calling PetApi.find_pets_by_status" + end + # resource path + local_var_path = '/pet/findByStatus' + + # query parameters + query_params = {} + query_params[:'status'] = @api_client.build_collection_param(status, :csv) + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['petstore_auth'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Array') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PetApi#find_pets_by_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Finds Pets by tags + # Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + # @param tags Tags to filter by + # @param [Hash] opts the optional parameters + # @return [Array] + def find_pets_by_tags(tags, opts = {}) + data, _status_code, _headers = find_pets_by_tags_with_http_info(tags, opts) + data + end + + # Finds Pets by tags + # Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + # @param tags Tags to filter by + # @param [Hash] opts the optional parameters + # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers + def find_pets_by_tags_with_http_info(tags, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PetApi.find_pets_by_tags ...' + end + # verify the required parameter 'tags' is set + if @api_client.config.client_side_validation && tags.nil? + fail ArgumentError, "Missing the required parameter 'tags' when calling PetApi.find_pets_by_tags" + end + # resource path + local_var_path = '/pet/findByTags' + + # query parameters + query_params = {} + query_params[:'tags'] = @api_client.build_collection_param(tags, :csv) + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['petstore_auth'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Array') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PetApi#find_pets_by_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Find pet by ID + # Returns a single pet + # @param pet_id ID of pet to return + # @param [Hash] opts the optional parameters + # @return [Pet] + def get_pet_by_id(pet_id, opts = {}) + data, _status_code, _headers = get_pet_by_id_with_http_info(pet_id, opts) + data + end + + # Find pet by ID + # Returns a single pet + # @param pet_id ID of pet to return + # @param [Hash] opts the optional parameters + # @return [Array<(Pet, Fixnum, Hash)>] Pet data, response status code and response headers + def get_pet_by_id_with_http_info(pet_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PetApi.get_pet_by_id ...' + end + # verify the required parameter 'pet_id' is set + if @api_client.config.client_side_validation && pet_id.nil? + fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.get_pet_by_id" + end + # resource path + local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', pet_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api_key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Pet') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PetApi#get_pet_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update an existing pet + # @param pet Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @return [nil] + def update_pet(pet, opts = {}) + update_pet_with_http_info(pet, opts) + nil + end + + # Update an existing pet + # @param pet Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def update_pet_with_http_info(pet, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PetApi.update_pet ...' + end + # verify the required parameter 'pet' is set + if @api_client.config.client_side_validation && pet.nil? + fail ArgumentError, "Missing the required parameter 'pet' when calling PetApi.update_pet" + end + # resource path + local_var_path = '/pet' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(pet) + auth_names = ['petstore_auth'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PetApi#update_pet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Updates a pet in the store with form data + # @param pet_id ID of pet that needs to be updated + # @param [Hash] opts the optional parameters + # @option opts [String] :name Updated name of the pet + # @option opts [String] :status Updated status of the pet + # @return [nil] + def update_pet_with_form(pet_id, opts = {}) + update_pet_with_form_with_http_info(pet_id, opts) + nil + end + + # Updates a pet in the store with form data + # @param pet_id ID of pet that needs to be updated + # @param [Hash] opts the optional parameters + # @option opts [String] :name Updated name of the pet + # @option opts [String] :status Updated status of the pet + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def update_pet_with_form_with_http_info(pet_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PetApi.update_pet_with_form ...' + end + # verify the required parameter 'pet_id' is set + if @api_client.config.client_side_validation && pet_id.nil? + fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.update_pet_with_form" + end + # resource path + local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', pet_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) + + # form parameters + form_params = {} + form_params['name'] = opts[:'name'] if !opts[:'name'].nil? + form_params['status'] = opts[:'status'] if !opts[:'status'].nil? + + # http body (model) + post_body = nil + auth_names = ['petstore_auth'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PetApi#update_pet_with_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # uploads an image + # @param pet_id ID of pet to update + # @param [Hash] opts the optional parameters + # @option opts [String] :additional_metadata Additional data to pass to server + # @option opts [File] :file file to upload + # @return [ApiResponse] + def upload_file(pet_id, opts = {}) + data, _status_code, _headers = upload_file_with_http_info(pet_id, opts) + data + end + + # uploads an image + # @param pet_id ID of pet to update + # @param [Hash] opts the optional parameters + # @option opts [String] :additional_metadata Additional data to pass to server + # @option opts [File] :file file to upload + # @return [Array<(ApiResponse, Fixnum, Hash)>] ApiResponse data, response status code and response headers + def upload_file_with_http_info(pet_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PetApi.upload_file ...' + end + # verify the required parameter 'pet_id' is set + if @api_client.config.client_side_validation && pet_id.nil? + fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.upload_file" + end + # resource path + local_var_path = '/pet/{petId}/uploadImage'.sub('{' + 'petId' + '}', pet_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) + + # form parameters + form_params = {} + form_params['additionalMetadata'] = opts[:'additional_metadata'] if !opts[:'additional_metadata'].nil? + form_params['file'] = opts[:'file'] if !opts[:'file'].nil? + + # http body (model) + post_body = nil + auth_names = ['petstore_auth'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ApiResponse') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PetApi#upload_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # uploads an image (required) + # @param pet_id ID of pet to update + # @param required_file file to upload + # @param [Hash] opts the optional parameters + # @option opts [String] :additional_metadata Additional data to pass to server + # @return [ApiResponse] + def upload_file_with_required_file(pet_id, required_file, opts = {}) + data, _status_code, _headers = upload_file_with_required_file_with_http_info(pet_id, required_file, opts) + data + end + + # uploads an image (required) + # @param pet_id ID of pet to update + # @param required_file file to upload + # @param [Hash] opts the optional parameters + # @option opts [String] :additional_metadata Additional data to pass to server + # @return [Array<(ApiResponse, Fixnum, Hash)>] ApiResponse data, response status code and response headers + def upload_file_with_required_file_with_http_info(pet_id, required_file, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PetApi.upload_file_with_required_file ...' + end + # verify the required parameter 'pet_id' is set + if @api_client.config.client_side_validation && pet_id.nil? + fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.upload_file_with_required_file" + end + # verify the required parameter 'required_file' is set + if @api_client.config.client_side_validation && required_file.nil? + fail ArgumentError, "Missing the required parameter 'required_file' when calling PetApi.upload_file_with_required_file" + end + # resource path + local_var_path = '/fake/{petId}/uploadImageWithRequiredFile'.sub('{' + 'petId' + '}', pet_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) + + # form parameters + form_params = {} + form_params['requiredFile'] = required_file + form_params['additionalMetadata'] = opts[:'additional_metadata'] if !opts[:'additional_metadata'].nil? + + # http body (model) + post_body = nil + auth_names = ['petstore_auth'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'ApiResponse') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PetApi#upload_file_with_required_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb new file mode 100644 index 00000000000..0a9c92a0e3a --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb @@ -0,0 +1,232 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'uri' + +module Petstore + class StoreApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Delete purchase order by ID + # For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + # @param order_id ID of the order that needs to be deleted + # @param [Hash] opts the optional parameters + # @return [nil] + def delete_order(order_id, opts = {}) + delete_order_with_http_info(order_id, opts) + nil + end + + # Delete purchase order by ID + # For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + # @param order_id ID of the order that needs to be deleted + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def delete_order_with_http_info(order_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StoreApi.delete_order ...' + end + # verify the required parameter 'order_id' is set + if @api_client.config.client_side_validation && order_id.nil? + fail ArgumentError, "Missing the required parameter 'order_id' when calling StoreApi.delete_order" + end + # resource path + local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', order_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = [] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StoreApi#delete_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Returns pet inventories by status + # Returns a map of status codes to quantities + # @param [Hash] opts the optional parameters + # @return [Hash] + def get_inventory(opts = {}) + data, _status_code, _headers = get_inventory_with_http_info(opts) + data + end + + # Returns pet inventories by status + # Returns a map of status codes to quantities + # @param [Hash] opts the optional parameters + # @return [Array<(Hash, Fixnum, Hash)>] Hash data, response status code and response headers + def get_inventory_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StoreApi.get_inventory ...' + end + # resource path + local_var_path = '/store/inventory' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['api_key'] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Hash') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StoreApi#get_inventory\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Find purchase order by ID + # For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + # @param order_id ID of pet that needs to be fetched + # @param [Hash] opts the optional parameters + # @return [Order] + def get_order_by_id(order_id, opts = {}) + data, _status_code, _headers = get_order_by_id_with_http_info(order_id, opts) + data + end + + # Find purchase order by ID + # For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + # @param order_id ID of pet that needs to be fetched + # @param [Hash] opts the optional parameters + # @return [Array<(Order, Fixnum, Hash)>] Order data, response status code and response headers + def get_order_by_id_with_http_info(order_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StoreApi.get_order_by_id ...' + end + # verify the required parameter 'order_id' is set + if @api_client.config.client_side_validation && order_id.nil? + fail ArgumentError, "Missing the required parameter 'order_id' when calling StoreApi.get_order_by_id" + end + if @api_client.config.client_side_validation && order_id > 5 + fail ArgumentError, 'invalid value for "order_id" when calling StoreApi.get_order_by_id, must be smaller than or equal to 5.' + end + + if @api_client.config.client_side_validation && order_id < 1 + fail ArgumentError, 'invalid value for "order_id" when calling StoreApi.get_order_by_id, must be greater than or equal to 1.' + end + + # resource path + local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', order_id.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = [] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Order') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StoreApi#get_order_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Place an order for a pet + # @param order order placed for purchasing the pet + # @param [Hash] opts the optional parameters + # @return [Order] + def place_order(order, opts = {}) + data, _status_code, _headers = place_order_with_http_info(order, opts) + data + end + + # Place an order for a pet + # @param order order placed for purchasing the pet + # @param [Hash] opts the optional parameters + # @return [Array<(Order, Fixnum, Hash)>] Order data, response status code and response headers + def place_order_with_http_info(order, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StoreApi.place_order ...' + end + # verify the required parameter 'order' is set + if @api_client.config.client_side_validation && order.nil? + fail ArgumentError, "Missing the required parameter 'order' when calling StoreApi.place_order" + end + # resource path + local_var_path = '/store/order' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(order) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'Order') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StoreApi#place_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb new file mode 100644 index 00000000000..d2bdc276a0f --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb @@ -0,0 +1,427 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'uri' + +module Petstore + class UserApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Create user + # This can only be done by the logged in user. + # @param user Created user object + # @param [Hash] opts the optional parameters + # @return [nil] + def create_user(user, opts = {}) + create_user_with_http_info(user, opts) + nil + end + + # Create user + # This can only be done by the logged in user. + # @param user Created user object + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def create_user_with_http_info(user, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserApi.create_user ...' + end + # verify the required parameter 'user' is set + if @api_client.config.client_side_validation && user.nil? + fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_user" + end + # resource path + local_var_path = '/user' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(user) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UserApi#create_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Creates list of users with given input array + # @param user List of user object + # @param [Hash] opts the optional parameters + # @return [nil] + def create_users_with_array_input(user, opts = {}) + create_users_with_array_input_with_http_info(user, opts) + nil + end + + # Creates list of users with given input array + # @param user List of user object + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def create_users_with_array_input_with_http_info(user, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserApi.create_users_with_array_input ...' + end + # verify the required parameter 'user' is set + if @api_client.config.client_side_validation && user.nil? + fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_users_with_array_input" + end + # resource path + local_var_path = '/user/createWithArray' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(user) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UserApi#create_users_with_array_input\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Creates list of users with given input array + # @param user List of user object + # @param [Hash] opts the optional parameters + # @return [nil] + def create_users_with_list_input(user, opts = {}) + create_users_with_list_input_with_http_info(user, opts) + nil + end + + # Creates list of users with given input array + # @param user List of user object + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def create_users_with_list_input_with_http_info(user, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserApi.create_users_with_list_input ...' + end + # verify the required parameter 'user' is set + if @api_client.config.client_side_validation && user.nil? + fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_users_with_list_input" + end + # resource path + local_var_path = '/user/createWithList' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(user) + auth_names = [] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UserApi#create_users_with_list_input\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete user + # This can only be done by the logged in user. + # @param username The name that needs to be deleted + # @param [Hash] opts the optional parameters + # @return [nil] + def delete_user(username, opts = {}) + delete_user_with_http_info(username, opts) + nil + end + + # Delete user + # This can only be done by the logged in user. + # @param username The name that needs to be deleted + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def delete_user_with_http_info(username, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserApi.delete_user ...' + end + # verify the required parameter 'username' is set + if @api_client.config.client_side_validation && username.nil? + fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.delete_user" + end + # resource path + local_var_path = '/user/{username}'.sub('{' + 'username' + '}', username.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = [] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UserApi#delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get user by user name + # @param username The name that needs to be fetched. Use user1 for testing. + # @param [Hash] opts the optional parameters + # @return [User] + def get_user_by_name(username, opts = {}) + data, _status_code, _headers = get_user_by_name_with_http_info(username, opts) + data + end + + # Get user by user name + # @param username The name that needs to be fetched. Use user1 for testing. + # @param [Hash] opts the optional parameters + # @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers + def get_user_by_name_with_http_info(username, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserApi.get_user_by_name ...' + end + # verify the required parameter 'username' is set + if @api_client.config.client_side_validation && username.nil? + fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.get_user_by_name" + end + # resource path + local_var_path = '/user/{username}'.sub('{' + 'username' + '}', username.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = [] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'User') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UserApi#get_user_by_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Logs user into the system + # @param username The user name for login + # @param password The password for login in clear text + # @param [Hash] opts the optional parameters + # @return [String] + def login_user(username, password, opts = {}) + data, _status_code, _headers = login_user_with_http_info(username, password, opts) + data + end + + # Logs user into the system + # @param username The user name for login + # @param password The password for login in clear text + # @param [Hash] opts the optional parameters + # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers + def login_user_with_http_info(username, password, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserApi.login_user ...' + end + # verify the required parameter 'username' is set + if @api_client.config.client_side_validation && username.nil? + fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.login_user" + end + # verify the required parameter 'password' is set + if @api_client.config.client_side_validation && password.nil? + fail ArgumentError, "Missing the required parameter 'password' when calling UserApi.login_user" + end + # resource path + local_var_path = '/user/login' + + # query parameters + query_params = {} + query_params[:'username'] = username + query_params[:'password'] = password + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = [] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'String') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UserApi#login_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Logs out current logged in user session + # @param [Hash] opts the optional parameters + # @return [nil] + def logout_user(opts = {}) + logout_user_with_http_info(opts) + nil + end + + # Logs out current logged in user session + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def logout_user_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserApi.logout_user ...' + end + # resource path + local_var_path = '/user/logout' + + # query parameters + query_params = {} + + # header parameters + header_params = {} + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = [] + data, status_code, headers = @api_client.call_api(:GET, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UserApi#logout_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Updated user + # This can only be done by the logged in user. + # @param username name that need to be deleted + # @param user Updated user object + # @param [Hash] opts the optional parameters + # @return [nil] + def update_user(username, user, opts = {}) + update_user_with_http_info(username, user, opts) + nil + end + + # Updated user + # This can only be done by the logged in user. + # @param username name that need to be deleted + # @param user Updated user object + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def update_user_with_http_info(username, user, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserApi.update_user ...' + end + # verify the required parameter 'username' is set + if @api_client.config.client_side_validation && username.nil? + fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.update_user" + end + # verify the required parameter 'user' is set + if @api_client.config.client_side_validation && user.nil? + fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.update_user" + end + # resource path + local_var_path = '/user/{username}'.sub('{' + 'username' + '}', username.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(user) + auth_names = [] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UserApi#update_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb new file mode 100644 index 00000000000..3709bdb3aef --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb @@ -0,0 +1,204 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' +require 'json' +require 'logger' +require 'faraday' + +module Petstore + class ApiClient + def self.default + @@default ||= ApiClient.new + end + + def initialize(config = Configuration.default) + @config = config + end + + attr_reader :config + + def call_api(http_method, path, opts = {}) + normalized_path = ::File.join(config.base_path, path) + + @last_response = connection.public_send(http_method.to_sym.downcase) do |req| + req.url(normalized_path) + + req.headers = default_headers.merge(opts[:header_params] || {}) + req.body = opts[:body] + + query_params = opts[:query_params] || {} + form_params = opts[:form_params] || {} + req.params = query_params.merge(form_params) + end + + if @config.debugging + @config.logger.debug "HTTP response body ~BEGIN~\n#{@last_response.body}\n~END~\n" + end + + if opts[:return_type] + data = deserialize(@last_response, opts[:return_type]) + else + data = nil + end + + return data, @last_response.status, @last_response.headers + end + + attr_reader :last_response + + # Convert object (array, hash, object, etc) to JSON string. + # @param [Object] model object to be converted into JSON string + # @return [String] JSON string representation of the object + def object_to_http_body(model) + return model if model.nil? || model.is_a?(String) + local_body = nil + if model.is_a?(Array) + local_body = model.map { |m| object_to_hash(m) } + else + local_body = object_to_hash(model) + end + local_body.to_json + end + + # Convert object(non-array) to hash. + # @param [Object] obj object to be converted into JSON string + # @return [String] JSON string representation of the object + def object_to_hash(obj) + if obj.respond_to?(:to_hash) + obj.to_hash + else + obj + end + end + + # Return Accept header based on an array of accepts provided. + # @param [Array] accepts array for Accept + # @return [String] the Accept header (e.g. application/json) + def select_header_accept(accepts) + return nil if accepts.nil? || accepts.empty? + # use JSON when present, otherwise use all of the provided + json_accept = accepts.find { |s| json_mime?(s) } + json_accept || accepts.join(',') + end + + # Return Content-Type header based on an array of content types provided. + # @param [Array] content_types array for Content-Type + # @return [String] the Content-Type header (e.g. application/json) + def select_header_content_type(content_types) + # use application/json by default + return 'application/json' if content_types.nil? || content_types.empty? + # use JSON when present, otherwise use the first one + json_content_type = content_types.find { |s| json_mime?(s) } + json_content_type || content_types.first + end + + def json_mime?(mime) + (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? + end + + private + + def connection + @connection ||= bulid_connection + end + + def bulid_connection + Faraday.new(:url => config.base_url) do |builder| + builder.adapter(Faraday.default_adapter) + end + end + + def user_agent + @user_agent ||= "OpenAPI-Generator/#{VERSION}/ruby" + end + + def default_headers + { + 'Content-Type' => 'application/json', + 'User-Agent' => user_agent + } + end + + # Deserialize the response to the given return type. + # + # @param [Response] response HTTP response + # @param [String] return_type some examples: "User", "Array", "Hash" + def deserialize(response, return_type) + body = response.body + + return nil if body.nil? || body.empty? + + # return response body directly for String return type + return body if return_type == 'String' + + # ensuring a default content type + content_type = response.headers['Content-Type'] || 'application/json' + + fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) + + begin + data = JSON.parse("[#{body}]", :symbolize_names => true)[0] + rescue JSON::ParserError => e + if %w(String Date DateTime).include?(return_type) + data = body + else + raise e + end + end + + convert_to_type data, return_type + end + + # Convert data to the given return type. + # @param [Object] data Data to be converted + # @param [String] return_type Return type + # @return [Mixed] Data in a particular type + def convert_to_type(data, return_type) + return nil if data.nil? + case return_type + when 'String' + data.to_s + when 'Integer' + data.to_i + when 'Float' + data.to_f + when 'BOOLEAN' + data == true + when 'DateTime' + # parse date time (expecting ISO 8601 format) + DateTime.parse data + when 'Date' + # parse date time (expecting ISO 8601 format) + Date.parse data + when 'Object' + # generic object (usually a Hash), return directly + data + when /\AArray<(.+)>\z/ + # e.g. Array + sub_type = $1 + data.map { |item| convert_to_type(item, sub_type) } + when /\AHash\\z/ + # e.g. Hash + sub_type = $1 + {}.tap do |hash| + data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } + end + else + # models, e.g. Pet + Petstore.const_get(return_type).new.tap do |model| + model.build_from_hash data + end + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb new file mode 100644 index 00000000000..629ad384a77 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb @@ -0,0 +1,38 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +module Petstore + class ApiError < StandardError + attr_reader :code, :response_headers, :response_body + + # Usage examples: + # ApiError.new + # ApiError.new("message") + # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") + # ApiError.new(:code => 404, :message => "Not Found") + def initialize(arg = nil) + if arg.is_a? Hash + if arg.key?(:message) || arg.key?('message') + super(arg[:message] || arg['message']) + else + super arg + end + + arg.each do |k, v| + instance_variable_set "@#{k}", v + end + else + super arg + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb new file mode 100644 index 00000000000..ee74eea69a4 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb @@ -0,0 +1,272 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'uri' + +module Petstore + class Configuration + # Defines url scheme + attr_accessor :scheme + + # Defines url host + attr_accessor :host + + # Defines url base path + attr_accessor :base_path + + # Defines API keys used with API Key authentications. + # + # @return [Hash] key: parameter name, value: parameter value (API key) + # + # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) + # config.api_key['api_key'] = 'xxx' + attr_accessor :api_key + + # Defines API key prefixes used with API Key authentications. + # + # @return [Hash] key: parameter name, value: API key prefix + # + # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) + # config.api_key_prefix['api_key'] = 'Token' + attr_accessor :api_key_prefix + + # Defines the username used with HTTP basic authentication. + # + # @return [String] + attr_accessor :username + + # Defines the password used with HTTP basic authentication. + # + # @return [String] + attr_accessor :password + + # Defines the access token (Bearer) used with OAuth2. + attr_accessor :access_token + + # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response + # details will be logged with `logger.debug` (see the `logger` attribute). + # Default to false. + # + # @return [true, false] + attr_accessor :debugging + + # Defines the logger used for debugging. + # Default to `Rails.logger` (when in Rails) or logging to STDOUT. + # + # @return [#debug] + attr_accessor :logger + + # Defines the temporary folder to store downloaded files + # (for API endpoints that have file response). + # Default to use `Tempfile`. + # + # @return [String] + attr_accessor :temp_folder_path + + # The time limit for HTTP request in seconds. + # Default to 0 (never times out). + attr_accessor :timeout + + # Set this to false to skip client side validation in the operation. + # Default to true. + # @return [true, false] + attr_accessor :client_side_validation + + ### TLS/SSL setting + # Set this to false to skip verifying SSL certificate when calling API from https server. + # Default to true. + # + # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. + # + # @return [true, false] + attr_accessor :verify_ssl + + ### TLS/SSL setting + # Set this to false to skip verifying SSL host name + # Default to true. + # + # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. + # + # @return [true, false] + attr_accessor :verify_ssl_host + + ### TLS/SSL setting + # Set this to customize the certificate file to verify the peer. + # + # @return [String] the path to the certificate file + # + # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: + # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 + attr_accessor :ssl_ca_cert + + ### TLS/SSL setting + # Client certificate file (for client certificate) + attr_accessor :cert_file + + ### TLS/SSL setting + # Client private key file (for client certificate) + attr_accessor :key_file + + # Set this to customize parameters encoding of array parameter with multi collectionFormat. + # Default to nil. + # + # @see The params_encoding option of Ethon. Related source code: + # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 + attr_accessor :params_encoding + + attr_accessor :inject_format + + attr_accessor :force_ending_format + + def initialize + @scheme = 'https' + @host = 'petstore.swagger.io' + @base_path = '/v2' + @api_key = {} + @api_key_prefix = {} + @timeout = 0 + @client_side_validation = true + @verify_ssl = true + @verify_ssl_host = true + @params_encoding = nil + @cert_file = nil + @key_file = nil + @debugging = false + @inject_format = false + @force_ending_format = false + @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) + + yield(self) if block_given? + end + + # The default Configuration object. + def self.default + @@default ||= Configuration.new + end + + def configure + yield(self) if block_given? + end + + def scheme=(scheme) + # remove :// from scheme + @scheme = scheme.sub(/:\/\//, '') + end + + def host=(host) + # remove http(s):// and anything after a slash + @host = host.sub(/https?:\/\//, '').split('/').first + end + + def base_path=(base_path) + # Add leading and trailing slashes to base_path + @base_path = "/#{base_path}".gsub(/\/+/, '/') + @base_path = '' if @base_path == '/' + end + + def base_url + url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') + URI.encode(url) + end + + # Gets API key (with prefix if set). + # @param [String] param_name the parameter name of API key auth + def api_key_with_prefix(param_name) + if @api_key_prefix[param_name] + "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" + else + @api_key[param_name] + end + end + + # Gets Basic Auth token string + def basic_auth_token + 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") + end + + # Returns Auth Settings hash for api client. + def auth_settings + { + 'api_key' => + { + type: 'api_key', + in: 'header', + key: 'api_key', + value: api_key_with_prefix('api_key') + }, + 'api_key_query' => + { + type: 'api_key', + in: 'query', + key: 'api_key_query', + value: api_key_with_prefix('api_key_query') + }, + 'http_basic_test' => + { + type: 'basic', + in: 'header', + key: 'Authorization', + value: basic_auth_token + }, + 'petstore_auth' => + { + type: 'oauth2', + in: 'header', + key: 'Authorization', + value: "Bearer #{access_token}" + }, + } + end + + # Returns an array of Server setting + def server_settings + [ + { + url: "http://petstore.swagger.io:80/v2", + description: "No descriptoin provided", + } + ] + end + + # Returns URL based on server settings + # + # @param index array index of the server settings + # @param variables hash of variable and the corresponding value + def server_url(index, variables = {}) + servers = server_settings + + # check array index out of bound + if (index < 0 || index > servers.size) + fail ArgumentError "Invalid index #{index} when selecting the server. Must be less than #{servers.size}" + end + + server = servers[index] + url = server[:url] + + # go through variable and assign a value + server[:variables].each do |name, variable| + if variables.key?(name) + if (server[:variables][name][:enum_values].include? variables[name]) + url.gsub! "{" + name.to_s + "}", variables[name] + else + fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}." + end + else + # use default value + url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value] + end + end + + url + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb new file mode 100644 index 00000000000..86bd37cba1f --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb @@ -0,0 +1,196 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class AdditionalPropertiesClass + attr_accessor :map_property + + attr_accessor :map_of_map_property + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'map_property' => :'map_property', + :'map_of_map_property' => :'map_of_map_property' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'map_property' => :'Hash', + :'map_of_map_property' => :'Hash>' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'map_property') + if (value = attributes[:'map_property']).is_a?(Hash) + self.map_property = value + end + end + + if attributes.has_key?(:'map_of_map_property') + if (value = attributes[:'map_of_map_property']).is_a?(Hash) + self.map_of_map_property = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + map_property == o.map_property && + map_of_map_property == o.map_of_map_property + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [map_property, map_of_map_property].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb new file mode 100644 index 00000000000..7fe8f2a2efc --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb @@ -0,0 +1,199 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class Animal + attr_accessor :class_name + + attr_accessor :color + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'class_name' => :'className', + :'color' => :'color' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'class_name' => :'String', + :'color' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'className') + self.class_name = attributes[:'className'] + end + + if attributes.has_key?(:'color') + self.color = attributes[:'color'] + else + self.color = 'red' + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @class_name.nil? + invalid_properties.push('invalid value for "class_name", class_name cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @class_name.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + class_name == o.class_name && + color == o.color + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [class_name, color].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal_farm.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal_farm.rb new file mode 100644 index 00000000000..c9db67d4a92 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal_farm.rb @@ -0,0 +1,174 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class AnimalFarm + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + } + end + + # Attribute type mapping. + def self.openapi_types + { + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + 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 + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [].hash + 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb new file mode 100644 index 00000000000..03eb6f3cb81 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb @@ -0,0 +1,201 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class ApiResponse + attr_accessor :code + + attr_accessor :type + + attr_accessor :message + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'code' => :'code', + :'type' => :'type', + :'message' => :'message' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'code' => :'Integer', + :'type' => :'String', + :'message' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.has_key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.has_key?(:'message') + self.message = attributes[:'message'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + type == o.type && + message == o.message + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [code, type, message].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb new file mode 100644 index 00000000000..b13489a7903 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb @@ -0,0 +1,185 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class ArrayOfArrayOfNumberOnly + attr_accessor :array_array_number + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'array_array_number' => :'ArrayArrayNumber' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'array_array_number' => :'Array>' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'ArrayArrayNumber') + if (value = attributes[:'ArrayArrayNumber']).is_a?(Array) + self.array_array_number = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + array_array_number == o.array_array_number + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [array_array_number].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb new file mode 100644 index 00000000000..cb0670d2830 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb @@ -0,0 +1,185 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class ArrayOfNumberOnly + attr_accessor :array_number + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'array_number' => :'ArrayNumber' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'array_number' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'ArrayNumber') + if (value = attributes[:'ArrayNumber']).is_a?(Array) + self.array_number = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + array_number == o.array_number + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [array_number].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb new file mode 100644 index 00000000000..858b6b177c1 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb @@ -0,0 +1,207 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class ArrayTest + attr_accessor :array_of_string + + attr_accessor :array_array_of_integer + + attr_accessor :array_array_of_model + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'array_of_string' => :'array_of_string', + :'array_array_of_integer' => :'array_array_of_integer', + :'array_array_of_model' => :'array_array_of_model' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'array_of_string' => :'Array', + :'array_array_of_integer' => :'Array>', + :'array_array_of_model' => :'Array>' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'array_of_string') + if (value = attributes[:'array_of_string']).is_a?(Array) + self.array_of_string = value + end + end + + if attributes.has_key?(:'array_array_of_integer') + if (value = attributes[:'array_array_of_integer']).is_a?(Array) + self.array_array_of_integer = value + end + end + + if attributes.has_key?(:'array_array_of_model') + if (value = attributes[:'array_array_of_model']).is_a?(Array) + self.array_array_of_model = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + array_of_string == o.array_of_string && + array_array_of_integer == o.array_array_of_integer && + array_array_of_model == o.array_array_of_model + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [array_of_string, array_array_of_integer, array_array_of_model].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb new file mode 100644 index 00000000000..5991e98aabb --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb @@ -0,0 +1,229 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class Capitalization + attr_accessor :small_camel + + attr_accessor :capital_camel + + attr_accessor :small_snake + + attr_accessor :capital_snake + + attr_accessor :sca_eth_flow_points + + # Name of the pet + attr_accessor :att_name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'small_camel' => :'smallCamel', + :'capital_camel' => :'CapitalCamel', + :'small_snake' => :'small_Snake', + :'capital_snake' => :'Capital_Snake', + :'sca_eth_flow_points' => :'SCA_ETH_Flow_Points', + :'att_name' => :'ATT_NAME' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'small_camel' => :'String', + :'capital_camel' => :'String', + :'small_snake' => :'String', + :'capital_snake' => :'String', + :'sca_eth_flow_points' => :'String', + :'att_name' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'smallCamel') + self.small_camel = attributes[:'smallCamel'] + end + + if attributes.has_key?(:'CapitalCamel') + self.capital_camel = attributes[:'CapitalCamel'] + end + + if attributes.has_key?(:'small_Snake') + self.small_snake = attributes[:'small_Snake'] + end + + if attributes.has_key?(:'Capital_Snake') + self.capital_snake = attributes[:'Capital_Snake'] + end + + if attributes.has_key?(:'SCA_ETH_Flow_Points') + self.sca_eth_flow_points = attributes[:'SCA_ETH_Flow_Points'] + end + + if attributes.has_key?(:'ATT_NAME') + self.att_name = attributes[:'ATT_NAME'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + small_camel == o.small_camel && + capital_camel == o.capital_camel && + small_snake == o.small_snake && + capital_snake == o.capital_snake && + sca_eth_flow_points == o.sca_eth_flow_points && + att_name == o.att_name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [small_camel, capital_camel, small_snake, capital_snake, sca_eth_flow_points, att_name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb new file mode 100644 index 00000000000..ab83695cbc4 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb @@ -0,0 +1,208 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class Cat + attr_accessor :class_name + + attr_accessor :color + + attr_accessor :declawed + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'class_name' => :'className', + :'color' => :'color', + :'declawed' => :'declawed' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'class_name' => :'String', + :'color' => :'String', + :'declawed' => :'BOOLEAN' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'className') + self.class_name = attributes[:'className'] + end + + if attributes.has_key?(:'color') + self.color = attributes[:'color'] + else + self.color = 'red' + end + + if attributes.has_key?(:'declawed') + self.declawed = attributes[:'declawed'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @class_name.nil? + invalid_properties.push('invalid value for "class_name", class_name cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @class_name.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + class_name == o.class_name && + color == o.color && + declawed == o.declawed + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [class_name, color, declawed].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb new file mode 100644 index 00000000000..4517cc7ea3f --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb @@ -0,0 +1,199 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class Category + attr_accessor :id + + attr_accessor :name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'Integer', + :'name' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.has_key?(:'name') + self.name = attributes[:'name'] + else + self.name = 'default-name' + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @name.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [id, name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb new file mode 100644 index 00000000000..8287046f2e0 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb @@ -0,0 +1,184 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + # Model for testing model with \"_class\" property + class ClassModel + attr_accessor :_class + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'_class' => :'_class' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'_class' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'_class') + self._class = attributes[:'_class'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _class == o._class + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [_class].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb new file mode 100644 index 00000000000..a4b6090829e --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb @@ -0,0 +1,183 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class Client + attr_accessor :client + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'client' => :'client' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'client' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'client') + self.client = attributes[:'client'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + client == o.client + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [client].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb new file mode 100644 index 00000000000..72213047998 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb @@ -0,0 +1,208 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class Dog + attr_accessor :class_name + + attr_accessor :color + + attr_accessor :breed + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'class_name' => :'className', + :'color' => :'color', + :'breed' => :'breed' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'class_name' => :'String', + :'color' => :'String', + :'breed' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'className') + self.class_name = attributes[:'className'] + end + + if attributes.has_key?(:'color') + self.color = attributes[:'color'] + else + self.color = 'red' + end + + if attributes.has_key?(:'breed') + self.breed = attributes[:'breed'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @class_name.nil? + invalid_properties.push('invalid value for "class_name", class_name cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @class_name.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + class_name == o.class_name && + color == o.color && + breed == o.breed + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [class_name, color, breed].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb new file mode 100644 index 00000000000..b74014bee3b --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb @@ -0,0 +1,228 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class EnumArrays + attr_accessor :just_symbol + + attr_accessor :array_enum + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'just_symbol' => :'just_symbol', + :'array_enum' => :'array_enum' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'just_symbol' => :'String', + :'array_enum' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'just_symbol') + self.just_symbol = attributes[:'just_symbol'] + end + + if attributes.has_key?(:'array_enum') + if (value = attributes[:'array_enum']).is_a?(Array) + self.array_enum = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + just_symbol_validator = EnumAttributeValidator.new('String', ['>=', '$']) + return false unless just_symbol_validator.valid?(@just_symbol) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] just_symbol Object to be assigned + def just_symbol=(just_symbol) + validator = EnumAttributeValidator.new('String', ['>=', '$']) + unless validator.valid?(just_symbol) + fail ArgumentError, 'invalid value for "just_symbol", must be one of #{validator.allowable_values}.' + end + @just_symbol = just_symbol + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + just_symbol == o.just_symbol && + array_enum == o.array_enum + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [just_symbol, array_enum].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb new file mode 100644 index 00000000000..c8a20442268 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb @@ -0,0 +1,31 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class EnumClass + + ABC = '_abc'.freeze + EFG = '-efg'.freeze + XYZ = '(xyz)'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = EnumClass.constants.select { |c| EnumClass::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #EnumClass" if constantValues.empty? + value + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb new file mode 100644 index 00000000000..4fdd1016bb9 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb @@ -0,0 +1,294 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class EnumTest + attr_accessor :enum_string + + attr_accessor :enum_string_required + + attr_accessor :enum_integer + + attr_accessor :enum_number + + attr_accessor :outer_enum + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'enum_string' => :'enum_string', + :'enum_string_required' => :'enum_string_required', + :'enum_integer' => :'enum_integer', + :'enum_number' => :'enum_number', + :'outer_enum' => :'outerEnum' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'enum_string' => :'String', + :'enum_string_required' => :'String', + :'enum_integer' => :'Integer', + :'enum_number' => :'Float', + :'outer_enum' => :'OuterEnum' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'enum_string') + self.enum_string = attributes[:'enum_string'] + end + + if attributes.has_key?(:'enum_string_required') + self.enum_string_required = attributes[:'enum_string_required'] + end + + if attributes.has_key?(:'enum_integer') + self.enum_integer = attributes[:'enum_integer'] + end + + if attributes.has_key?(:'enum_number') + self.enum_number = attributes[:'enum_number'] + end + + if attributes.has_key?(:'outerEnum') + self.outer_enum = attributes[:'outerEnum'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @enum_string_required.nil? + invalid_properties.push('invalid value for "enum_string_required", enum_string_required cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + enum_string_validator = EnumAttributeValidator.new('String', ['UPPER', 'lower', '']) + return false unless enum_string_validator.valid?(@enum_string) + return false if @enum_string_required.nil? + enum_string_required_validator = EnumAttributeValidator.new('String', ['UPPER', 'lower', '']) + return false unless enum_string_required_validator.valid?(@enum_string_required) + enum_integer_validator = EnumAttributeValidator.new('Integer', ['1', '-1']) + return false unless enum_integer_validator.valid?(@enum_integer) + enum_number_validator = EnumAttributeValidator.new('Float', ['1.1', '-1.2']) + return false unless enum_number_validator.valid?(@enum_number) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] enum_string Object to be assigned + def enum_string=(enum_string) + validator = EnumAttributeValidator.new('String', ['UPPER', 'lower', '']) + unless validator.valid?(enum_string) + fail ArgumentError, 'invalid value for "enum_string", must be one of #{validator.allowable_values}.' + end + @enum_string = enum_string + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] enum_string_required Object to be assigned + def enum_string_required=(enum_string_required) + validator = EnumAttributeValidator.new('String', ['UPPER', 'lower', '']) + unless validator.valid?(enum_string_required) + fail ArgumentError, 'invalid value for "enum_string_required", must be one of #{validator.allowable_values}.' + end + @enum_string_required = enum_string_required + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] enum_integer Object to be assigned + def enum_integer=(enum_integer) + validator = EnumAttributeValidator.new('Integer', ['1', '-1']) + unless validator.valid?(enum_integer) + fail ArgumentError, 'invalid value for "enum_integer", must be one of #{validator.allowable_values}.' + end + @enum_integer = enum_integer + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] enum_number Object to be assigned + def enum_number=(enum_number) + validator = EnumAttributeValidator.new('Float', ['1.1', '-1.2']) + unless validator.valid?(enum_number) + fail ArgumentError, 'invalid value for "enum_number", must be one of #{validator.allowable_values}.' + end + @enum_number = enum_number + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + enum_string == o.enum_string && + enum_string_required == o.enum_string_required && + enum_integer == o.enum_integer && + enum_number == o.enum_number && + outer_enum == o.outer_enum + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [enum_string, enum_string_required, enum_integer, enum_number, outer_enum].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb new file mode 100644 index 00000000000..6045b5e7842 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb @@ -0,0 +1,185 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + # Must be named `File` for test. + class File + # Test capitalization + attr_accessor :source_uri + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'source_uri' => :'sourceURI' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'source_uri' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'sourceURI') + self.source_uri = attributes[:'sourceURI'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + source_uri == o.source_uri + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [source_uri].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb new file mode 100644 index 00000000000..b207e13cf8f --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb @@ -0,0 +1,194 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class FileSchemaTestClass + attr_accessor :file + + attr_accessor :files + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'file' => :'file', + :'files' => :'files' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'file' => :'File', + :'files' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'file') + self.file = attributes[:'file'] + end + + if attributes.has_key?(:'files') + if (value = attributes[:'files']).is_a?(Array) + self.files = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + file == o.file && + files == o.files + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [file, files].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb new file mode 100644 index 00000000000..3ea21fa953a --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb @@ -0,0 +1,497 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class FormatTest + attr_accessor :integer + + attr_accessor :int32 + + attr_accessor :int64 + + attr_accessor :number + + attr_accessor :float + + attr_accessor :double + + attr_accessor :string + + attr_accessor :byte + + attr_accessor :binary + + attr_accessor :date + + attr_accessor :date_time + + attr_accessor :uuid + + attr_accessor :password + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'integer' => :'integer', + :'int32' => :'int32', + :'int64' => :'int64', + :'number' => :'number', + :'float' => :'float', + :'double' => :'double', + :'string' => :'string', + :'byte' => :'byte', + :'binary' => :'binary', + :'date' => :'date', + :'date_time' => :'dateTime', + :'uuid' => :'uuid', + :'password' => :'password' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'integer' => :'Integer', + :'int32' => :'Integer', + :'int64' => :'Integer', + :'number' => :'Float', + :'float' => :'Float', + :'double' => :'Float', + :'string' => :'String', + :'byte' => :'String', + :'binary' => :'File', + :'date' => :'Date', + :'date_time' => :'DateTime', + :'uuid' => :'String', + :'password' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'integer') + self.integer = attributes[:'integer'] + end + + if attributes.has_key?(:'int32') + self.int32 = attributes[:'int32'] + end + + if attributes.has_key?(:'int64') + self.int64 = attributes[:'int64'] + end + + if attributes.has_key?(:'number') + self.number = attributes[:'number'] + end + + if attributes.has_key?(:'float') + self.float = attributes[:'float'] + end + + if attributes.has_key?(:'double') + self.double = attributes[:'double'] + end + + if attributes.has_key?(:'string') + self.string = attributes[:'string'] + end + + if attributes.has_key?(:'byte') + self.byte = attributes[:'byte'] + end + + if attributes.has_key?(:'binary') + self.binary = attributes[:'binary'] + end + + if attributes.has_key?(:'date') + self.date = attributes[:'date'] + end + + if attributes.has_key?(:'dateTime') + self.date_time = attributes[:'dateTime'] + end + + if attributes.has_key?(:'uuid') + self.uuid = attributes[:'uuid'] + end + + if attributes.has_key?(:'password') + self.password = attributes[:'password'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@integer.nil? && @integer > 100 + invalid_properties.push('invalid value for "integer", must be smaller than or equal to 100.') + end + + if !@integer.nil? && @integer < 10 + invalid_properties.push('invalid value for "integer", must be greater than or equal to 10.') + end + + if !@int32.nil? && @int32 > 200 + invalid_properties.push('invalid value for "int32", must be smaller than or equal to 200.') + end + + if !@int32.nil? && @int32 < 20 + invalid_properties.push('invalid value for "int32", must be greater than or equal to 20.') + end + + if @number.nil? + invalid_properties.push('invalid value for "number", number cannot be nil.') + end + + if @number > 543.2 + invalid_properties.push('invalid value for "number", must be smaller than or equal to 543.2.') + end + + if @number < 32.1 + invalid_properties.push('invalid value for "number", must be greater than or equal to 32.1.') + end + + if !@float.nil? && @float > 987.6 + invalid_properties.push('invalid value for "float", must be smaller than or equal to 987.6.') + end + + if !@float.nil? && @float < 54.3 + invalid_properties.push('invalid value for "float", must be greater than or equal to 54.3.') + end + + if !@double.nil? && @double > 123.4 + invalid_properties.push('invalid value for "double", must be smaller than or equal to 123.4.') + end + + if !@double.nil? && @double < 67.8 + invalid_properties.push('invalid value for "double", must be greater than or equal to 67.8.') + end + + if !@string.nil? && @string !~ Regexp.new(/[a-z]/i) + invalid_properties.push('invalid value for "string", must conform to the pattern /[a-z]/i.') + end + + if @byte.nil? + invalid_properties.push('invalid value for "byte", byte cannot be nil.') + end + + if @byte !~ Regexp.new(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$) + invalid_properties.push('invalid value for "byte", must conform to the pattern /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$.') + end + + if @date.nil? + invalid_properties.push('invalid value for "date", date cannot be nil.') + end + + if @password.nil? + invalid_properties.push('invalid value for "password", password cannot be nil.') + end + + if @password.to_s.length > 64 + invalid_properties.push('invalid value for "password", the character length must be smaller than or equal to 64.') + end + + if @password.to_s.length < 10 + invalid_properties.push('invalid value for "password", the character length must be great than or equal to 10.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@integer.nil? && @integer > 100 + return false if !@integer.nil? && @integer < 10 + return false if !@int32.nil? && @int32 > 200 + return false if !@int32.nil? && @int32 < 20 + return false if @number.nil? + return false if @number > 543.2 + return false if @number < 32.1 + return false if !@float.nil? && @float > 987.6 + return false if !@float.nil? && @float < 54.3 + return false if !@double.nil? && @double > 123.4 + return false if !@double.nil? && @double < 67.8 + return false if !@string.nil? && @string !~ Regexp.new(/[a-z]/i) + return false if @byte.nil? + return false if @byte !~ Regexp.new(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$) + return false if @date.nil? + return false if @password.nil? + return false if @password.to_s.length > 64 + return false if @password.to_s.length < 10 + true + end + + # Custom attribute writer method with validation + # @param [Object] integer Value to be assigned + def integer=(integer) + if !integer.nil? && integer > 100 + fail ArgumentError, 'invalid value for "integer", must be smaller than or equal to 100.' + end + + if !integer.nil? && integer < 10 + fail ArgumentError, 'invalid value for "integer", must be greater than or equal to 10.' + end + + @integer = integer + end + + # Custom attribute writer method with validation + # @param [Object] int32 Value to be assigned + def int32=(int32) + if !int32.nil? && int32 > 200 + fail ArgumentError, 'invalid value for "int32", must be smaller than or equal to 200.' + end + + if !int32.nil? && int32 < 20 + fail ArgumentError, 'invalid value for "int32", must be greater than or equal to 20.' + end + + @int32 = int32 + end + + # Custom attribute writer method with validation + # @param [Object] number Value to be assigned + def number=(number) + if number.nil? + fail ArgumentError, 'number cannot be nil' + end + + if number > 543.2 + fail ArgumentError, 'invalid value for "number", must be smaller than or equal to 543.2.' + end + + if number < 32.1 + fail ArgumentError, 'invalid value for "number", must be greater than or equal to 32.1.' + end + + @number = number + end + + # Custom attribute writer method with validation + # @param [Object] float Value to be assigned + def float=(float) + if !float.nil? && float > 987.6 + fail ArgumentError, 'invalid value for "float", must be smaller than or equal to 987.6.' + end + + if !float.nil? && float < 54.3 + fail ArgumentError, 'invalid value for "float", must be greater than or equal to 54.3.' + end + + @float = float + end + + # Custom attribute writer method with validation + # @param [Object] double Value to be assigned + def double=(double) + if !double.nil? && double > 123.4 + fail ArgumentError, 'invalid value for "double", must be smaller than or equal to 123.4.' + end + + if !double.nil? && double < 67.8 + fail ArgumentError, 'invalid value for "double", must be greater than or equal to 67.8.' + end + + @double = double + end + + # Custom attribute writer method with validation + # @param [Object] string Value to be assigned + def string=(string) + if !string.nil? && string !~ Regexp.new(/[a-z]/i) + fail ArgumentError, 'invalid value for "string", must conform to the pattern /[a-z]/i.' + end + + @string = string + end + + # Custom attribute writer method with validation + # @param [Object] byte Value to be assigned + def byte=(byte) + if byte.nil? + fail ArgumentError, 'byte cannot be nil' + end + + if byte !~ Regexp.new(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$) + fail ArgumentError, 'invalid value for "byte", must conform to the pattern /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$.' + end + + @byte = byte + end + + # Custom attribute writer method with validation + # @param [Object] password Value to be assigned + def password=(password) + if password.nil? + fail ArgumentError, 'password cannot be nil' + end + + if password.to_s.length > 64 + fail ArgumentError, 'invalid value for "password", the character length must be smaller than or equal to 64.' + end + + if password.to_s.length < 10 + fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 10.' + end + + @password = password + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + integer == o.integer && + int32 == o.int32 && + int64 == o.int64 && + number == o.number && + float == o.float && + double == o.double && + string == o.string && + byte == o.byte && + binary == o.binary && + date == o.date && + date_time == o.date_time && + uuid == o.uuid && + password == o.password + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [integer, int32, int64, number, float, double, string, byte, binary, date, date_time, uuid, password].hash + 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb new file mode 100644 index 00000000000..1071f8736ad --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb @@ -0,0 +1,192 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class HasOnlyReadOnly + attr_accessor :bar + + attr_accessor :foo + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'bar' => :'bar', + :'foo' => :'foo' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'bar' => :'String', + :'foo' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'bar') + self.bar = attributes[:'bar'] + end + + if attributes.has_key?(:'foo') + self.foo = attributes[:'foo'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + bar == o.bar && + foo == o.foo + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [bar, foo].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb new file mode 100644 index 00000000000..366669b4c69 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb @@ -0,0 +1,183 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class List + attr_accessor :_123_list + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'_123_list' => :'123-list' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'_123_list' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'123-list') + self._123_list = attributes[:'123-list'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _123_list == o._123_list + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [_123_list].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb new file mode 100644 index 00000000000..cfc30bc635d --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb @@ -0,0 +1,240 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class MapTest + attr_accessor :map_map_of_string + + attr_accessor :map_of_enum_string + + attr_accessor :direct_map + + attr_accessor :indirect_map + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'map_map_of_string' => :'map_map_of_string', + :'map_of_enum_string' => :'map_of_enum_string', + :'direct_map' => :'direct_map', + :'indirect_map' => :'indirect_map' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'map_map_of_string' => :'Hash>', + :'map_of_enum_string' => :'Hash', + :'direct_map' => :'Hash', + :'indirect_map' => :'Hash' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'map_map_of_string') + if (value = attributes[:'map_map_of_string']).is_a?(Hash) + self.map_map_of_string = value + end + end + + if attributes.has_key?(:'map_of_enum_string') + if (value = attributes[:'map_of_enum_string']).is_a?(Hash) + self.map_of_enum_string = value + end + end + + if attributes.has_key?(:'direct_map') + if (value = attributes[:'direct_map']).is_a?(Hash) + self.direct_map = value + end + end + + if attributes.has_key?(:'indirect_map') + if (value = attributes[:'indirect_map']).is_a?(Hash) + self.indirect_map = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + map_map_of_string == o.map_map_of_string && + map_of_enum_string == o.map_of_enum_string && + direct_map == o.direct_map && + indirect_map == o.indirect_map + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [map_map_of_string, map_of_enum_string, direct_map, indirect_map].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb new file mode 100644 index 00000000000..729418423c9 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -0,0 +1,203 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class MixedPropertiesAndAdditionalPropertiesClass + attr_accessor :uuid + + attr_accessor :date_time + + attr_accessor :map + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'uuid' => :'uuid', + :'date_time' => :'dateTime', + :'map' => :'map' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'uuid' => :'String', + :'date_time' => :'DateTime', + :'map' => :'Hash' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'uuid') + self.uuid = attributes[:'uuid'] + end + + if attributes.has_key?(:'dateTime') + self.date_time = attributes[:'dateTime'] + end + + if attributes.has_key?(:'map') + if (value = attributes[:'map']).is_a?(Hash) + self.map = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + uuid == o.uuid && + date_time == o.date_time && + map == o.map + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [uuid, date_time, map].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb new file mode 100644 index 00000000000..b896ec31497 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb @@ -0,0 +1,193 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + # Model for testing model name starting with number + class Model200Response + attr_accessor :name + + attr_accessor :_class + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'_class' => :'class' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'Integer', + :'_class' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.has_key?(:'class') + self._class = attributes[:'class'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + _class == o._class + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [name, _class].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb new file mode 100644 index 00000000000..dd13ff9effe --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb @@ -0,0 +1,184 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + # Model for testing reserved words + class ModelReturn + attr_accessor :_return + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'_return' => :'return' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'_return' => :'Integer' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'return') + self._return = attributes[:'return'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _return == o._return + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [_return].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb new file mode 100644 index 00000000000..5ef4c859926 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb @@ -0,0 +1,216 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + # Model for testing model name same as property name + class Name + attr_accessor :name + + attr_accessor :snake_case + + attr_accessor :property + + attr_accessor :_123_number + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'snake_case' => :'snake_case', + :'property' => :'property', + :'_123_number' => :'123Number' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'Integer', + :'snake_case' => :'Integer', + :'property' => :'String', + :'_123_number' => :'Integer' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.has_key?(:'snake_case') + self.snake_case = attributes[:'snake_case'] + end + + if attributes.has_key?(:'property') + self.property = attributes[:'property'] + end + + if attributes.has_key?(:'123Number') + self._123_number = attributes[:'123Number'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @name.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + snake_case == o.snake_case && + property == o.property && + _123_number == o._123_number + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [name, snake_case, property, _123_number].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb new file mode 100644 index 00000000000..f900b2556a5 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb @@ -0,0 +1,183 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class NumberOnly + attr_accessor :just_number + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'just_number' => :'JustNumber' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'just_number' => :'Float' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'JustNumber') + self.just_number = attributes[:'JustNumber'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + just_number == o.just_number + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [just_number].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb new file mode 100644 index 00000000000..3f42f9ac82c --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb @@ -0,0 +1,265 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class Order + attr_accessor :id + + attr_accessor :pet_id + + attr_accessor :quantity + + attr_accessor :ship_date + + # Order Status + attr_accessor :status + + attr_accessor :complete + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'pet_id' => :'petId', + :'quantity' => :'quantity', + :'ship_date' => :'shipDate', + :'status' => :'status', + :'complete' => :'complete' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'Integer', + :'pet_id' => :'Integer', + :'quantity' => :'Integer', + :'ship_date' => :'DateTime', + :'status' => :'String', + :'complete' => :'BOOLEAN' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.has_key?(:'petId') + self.pet_id = attributes[:'petId'] + end + + if attributes.has_key?(:'quantity') + self.quantity = attributes[:'quantity'] + end + + if attributes.has_key?(:'shipDate') + self.ship_date = attributes[:'shipDate'] + end + + if attributes.has_key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.has_key?(:'complete') + self.complete = attributes[:'complete'] + else + self.complete = false + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + status_validator = EnumAttributeValidator.new('String', ['placed', 'approved', 'delivered']) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ['placed', 'approved', 'delivered']) + unless validator.valid?(status) + fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.' + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + pet_id == o.pet_id && + quantity == o.quantity && + ship_date == o.ship_date && + status == o.status && + complete == o.complete + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [id, pet_id, quantity, ship_date, status, complete].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb new file mode 100644 index 00000000000..f6becc74ec3 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb @@ -0,0 +1,201 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class OuterComposite + attr_accessor :my_number + + attr_accessor :my_string + + attr_accessor :my_boolean + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'my_number' => :'my_number', + :'my_string' => :'my_string', + :'my_boolean' => :'my_boolean' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'my_number' => :'Float', + :'my_string' => :'String', + :'my_boolean' => :'BOOLEAN' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'my_number') + self.my_number = attributes[:'my_number'] + end + + if attributes.has_key?(:'my_string') + self.my_string = attributes[:'my_string'] + end + + if attributes.has_key?(:'my_boolean') + self.my_boolean = attributes[:'my_boolean'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + my_number == o.my_number && + my_string == o.my_string && + my_boolean == o.my_boolean + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [my_number, my_string, my_boolean].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb new file mode 100644 index 00000000000..b63876234a2 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb @@ -0,0 +1,31 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class OuterEnum + + PLACED = 'placed'.freeze + APPROVED = 'approved'.freeze + DELIVERED = 'delivered'.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = OuterEnum.constants.select { |c| OuterEnum::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #OuterEnum" if constantValues.empty? + value + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb new file mode 100644 index 00000000000..e53f01becc5 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb @@ -0,0 +1,277 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class Pet + attr_accessor :id + + attr_accessor :category + + attr_accessor :name + + attr_accessor :photo_urls + + attr_accessor :tags + + # pet status in the store + attr_accessor :status + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'category' => :'category', + :'name' => :'name', + :'photo_urls' => :'photoUrls', + :'tags' => :'tags', + :'status' => :'status' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'Integer', + :'category' => :'Category', + :'name' => :'String', + :'photo_urls' => :'Array', + :'tags' => :'Array', + :'status' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.has_key?(:'category') + self.category = attributes[:'category'] + end + + if attributes.has_key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.has_key?(:'photoUrls') + if (value = attributes[:'photoUrls']).is_a?(Array) + self.photo_urls = value + end + end + + if attributes.has_key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.has_key?(:'status') + self.status = attributes[:'status'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @photo_urls.nil? + invalid_properties.push('invalid value for "photo_urls", photo_urls cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @name.nil? + return false if @photo_urls.nil? + status_validator = EnumAttributeValidator.new('String', ['available', 'pending', 'sold']) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ['available', 'pending', 'sold']) + unless validator.valid?(status) + fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.' + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + category == o.category && + name == o.name && + photo_urls == o.photo_urls && + tags == o.tags && + status == o.status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [id, category, name, photo_urls, tags, status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb new file mode 100644 index 00000000000..d1a7db8f63f --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb @@ -0,0 +1,192 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class ReadOnlyFirst + attr_accessor :bar + + attr_accessor :baz + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'bar' => :'bar', + :'baz' => :'baz' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'bar' => :'String', + :'baz' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'bar') + self.bar = attributes[:'bar'] + end + + if attributes.has_key?(:'baz') + self.baz = attributes[:'baz'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + bar == o.bar && + baz == o.baz + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [bar, baz].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb new file mode 100644 index 00000000000..51143fe4d21 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb @@ -0,0 +1,183 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class SpecialModelName + attr_accessor :special_property_name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'special_property_name' => :'$special[property.name]' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'special_property_name' => :'Integer' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'$special[property.name]') + self.special_property_name = attributes[:'$special[property.name]'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + special_property_name == o.special_property_name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [special_property_name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/string_boolean_map.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/string_boolean_map.rb new file mode 100644 index 00000000000..bf4b4c4b64e --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/string_boolean_map.rb @@ -0,0 +1,174 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class StringBooleanMap + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + } + end + + # Attribute type mapping. + def self.openapi_types + { + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + 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 + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [].hash + 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb new file mode 100644 index 00000000000..d83971dc4e2 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb @@ -0,0 +1,192 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class Tag + attr_accessor :id + + attr_accessor :name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'Integer', + :'name' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.has_key?(:'name') + self.name = attributes[:'name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [id, name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb new file mode 100644 index 00000000000..db6c7964f2e --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb @@ -0,0 +1,247 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'date' + +module Petstore + class User + attr_accessor :id + + attr_accessor :username + + attr_accessor :first_name + + attr_accessor :last_name + + attr_accessor :email + + attr_accessor :password + + attr_accessor :phone + + # User Status + attr_accessor :user_status + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'username' => :'username', + :'first_name' => :'firstName', + :'last_name' => :'lastName', + :'email' => :'email', + :'password' => :'password', + :'phone' => :'phone', + :'user_status' => :'userStatus' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'Integer', + :'username' => :'String', + :'first_name' => :'String', + :'last_name' => :'String', + :'email' => :'String', + :'password' => :'String', + :'phone' => :'String', + :'user_status' => :'Integer' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.has_key?(:'username') + self.username = attributes[:'username'] + end + + if attributes.has_key?(:'firstName') + self.first_name = attributes[:'firstName'] + end + + if attributes.has_key?(:'lastName') + self.last_name = attributes[:'lastName'] + end + + if attributes.has_key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.has_key?(:'password') + self.password = attributes[:'password'] + end + + if attributes.has_key?(:'phone') + self.phone = attributes[:'phone'] + end + + if attributes.has_key?(:'userStatus') + self.user_status = attributes[:'userStatus'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + username == o.username && + first_name == o.first_name && + last_name == o.last_name && + email == o.email && + password == o.password && + phone == o.phone && + user_status == o.user_status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [id, username, first_name, last_name, email, password, phone, user_status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def 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 the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = Petstore.const_get(type).new + temp_model.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) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/version.rb b/samples/client/petstore/ruby-faraday/lib/petstore/version.rb new file mode 100644 index 00000000000..7f71ec18157 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/version.rb @@ -0,0 +1,15 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +module Petstore + VERSION = '1.0.0' +end diff --git a/samples/client/petstore/ruby-faraday/petstore.gemspec b/samples/client/petstore/ruby-faraday/petstore.gemspec new file mode 100644 index 00000000000..6d22555fd42 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/petstore.gemspec @@ -0,0 +1,41 @@ +# -*- encoding: utf-8 -*- + +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +$:.push File.expand_path("../lib", __FILE__) +require "petstore/version" + +Gem::Specification.new do |s| + s.name = "petstore" + s.version = Petstore::VERSION + s.platform = Gem::Platform::RUBY + s.authors = ["OpenAPI-Generator"] + s.email = [""] + s.homepage = "https://openapi-generator.tech" + s.summary = "OpenAPI Petstore Ruby Gem" + s.description = "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\" + s.license = "Unlicense" + s.required_ruby_version = ">= 1.9" + + s.add_runtime_dependency 'faraday', '>= 0.14.0' + s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' + + s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' + s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1' + s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3' + + s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } + s.test_files = `find spec/*`.split("\n") + s.executables = [] + s.require_paths = ["lib"] +end diff --git a/samples/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb b/samples/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb new file mode 100644 index 00000000000..5fbf346bd1d --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb @@ -0,0 +1,47 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for Petstore::AnotherFakeApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'AnotherFakeApi' do + before do + # run before each test + @instance = Petstore::AnotherFakeApi.new + end + + after do + # run after each test + end + + describe 'test an instance of AnotherFakeApi' do + it 'should create an instance of AnotherFakeApi' do + expect(@instance).to be_instance_of(Petstore::AnotherFakeApi) + end + end + + # unit tests for call_123_test_special_tags + # To test special tags + # To test special tags and operation ID starting with number + # @param client client model + # @param [Hash] opts the optional parameters + # @return [Client] + describe 'call_123_test_special_tags test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb b/samples/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb new file mode 100644 index 00000000000..010716fac61 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb @@ -0,0 +1,197 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for Petstore::FakeApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'FakeApi' do + before do + # run before each test + @instance = Petstore::FakeApi.new + end + + after do + # run after each test + end + + describe 'test an instance of FakeApi' do + it 'should create an instance of FakeApi' do + expect(@instance).to be_instance_of(Petstore::FakeApi) + end + end + + # unit tests for fake_outer_boolean_serialize + # Test serialization of outer boolean types + # @param [Hash] opts the optional parameters + # @option opts [BOOLEAN] :body Input boolean as post body + # @return [BOOLEAN] + describe 'fake_outer_boolean_serialize test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for fake_outer_composite_serialize + # Test serialization of object with outer number type + # @param [Hash] opts the optional parameters + # @option opts [OuterComposite] :outer_composite Input composite as post body + # @return [OuterComposite] + describe 'fake_outer_composite_serialize test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for fake_outer_number_serialize + # Test serialization of outer number types + # @param [Hash] opts the optional parameters + # @option opts [Float] :body Input number as post body + # @return [Float] + describe 'fake_outer_number_serialize test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for fake_outer_string_serialize + # Test serialization of outer string types + # @param [Hash] opts the optional parameters + # @option opts [String] :body Input string as post body + # @return [String] + describe 'fake_outer_string_serialize test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for test_body_with_file_schema + # For this test, the body for this request much reference a schema named `File`. + # @param file_schema_test_class + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'test_body_with_file_schema test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for test_body_with_query_params + # @param query + # @param user + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'test_body_with_query_params test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for test_client_model + # To test \"client\" model + # To test \"client\" model + # @param client client model + # @param [Hash] opts the optional parameters + # @return [Client] + describe 'test_client_model test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for test_endpoint_parameters + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # @param number None + # @param double None + # @param pattern_without_delimiter None + # @param byte None + # @param [Hash] opts the optional parameters + # @option opts [Integer] :integer None + # @option opts [Integer] :int32 None + # @option opts [Integer] :int64 None + # @option opts [Float] :float None + # @option opts [String] :string None + # @option opts [File] :binary None + # @option opts [Date] :date None + # @option opts [DateTime] :date_time None + # @option opts [String] :password None + # @option opts [String] :callback None + # @return [nil] + describe 'test_endpoint_parameters test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for test_enum_parameters + # To test enum parameters + # To test enum parameters + # @param [Hash] opts the optional parameters + # @option opts [Array] :enum_header_string_array Header parameter enum test (string array) + # @option opts [String] :enum_header_string Header parameter enum test (string) + # @option opts [Array] :enum_query_string_array Query parameter enum test (string array) + # @option opts [String] :enum_query_string Query parameter enum test (string) + # @option opts [Integer] :enum_query_integer Query parameter enum test (double) + # @option opts [Float] :enum_query_double Query parameter enum test (double) + # @option opts [Array] :enum_form_string_array Form parameter enum test (string array) + # @option opts [String] :enum_form_string Form parameter enum test (string) + # @return [nil] + describe 'test_enum_parameters test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for test_group_parameters + # Fake endpoint to test group parameters (optional) + # Fake endpoint to test group parameters (optional) + # @param required_string_group Required String in group parameters + # @param required_boolean_group Required Boolean in group parameters + # @param required_int64_group Required Integer in group parameters + # @param [Hash] opts the optional parameters + # @option opts [Integer] :string_group String in group parameters + # @option opts [BOOLEAN] :boolean_group Boolean in group parameters + # @option opts [Integer] :int64_group Integer in group parameters + # @return [nil] + describe 'test_group_parameters test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for test_inline_additional_properties + # test inline additionalProperties + # @param request_body request body + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'test_inline_additional_properties test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for test_json_form_data + # test json serialization of form data + # @param param field1 + # @param param2 field2 + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'test_json_form_data test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb b/samples/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb new file mode 100644 index 00000000000..bc7b1b9f014 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb @@ -0,0 +1,47 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for Petstore::FakeClassnameTags123Api +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'FakeClassnameTags123Api' do + before do + # run before each test + @instance = Petstore::FakeClassnameTags123Api.new + end + + after do + # run after each test + end + + describe 'test an instance of FakeClassnameTags123Api' do + it 'should create an instance of FakeClassnameTags123Api' do + expect(@instance).to be_instance_of(Petstore::FakeClassnameTags123Api) + end + end + + # unit tests for test_classname + # To test class name in snake case + # To test class name in snake case + # @param client client model + # @param [Hash] opts the optional parameters + # @return [Client] + describe 'test_classname test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb b/samples/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb new file mode 100644 index 00000000000..46d04d03821 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb @@ -0,0 +1,144 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for Petstore::PetApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PetApi' do + before do + # run before each test + @instance = Petstore::PetApi.new + end + + after do + # run after each test + end + + describe 'test an instance of PetApi' do + it 'should create an instance of PetApi' do + expect(@instance).to be_instance_of(Petstore::PetApi) + end + end + + # unit tests for add_pet + # Add a new pet to the store + # @param pet Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'add_pet test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for delete_pet + # Deletes a pet + # @param pet_id Pet id to delete + # @param [Hash] opts the optional parameters + # @option opts [String] :api_key + # @return [nil] + describe 'delete_pet test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for find_pets_by_status + # Finds Pets by status + # Multiple status values can be provided with comma separated strings + # @param status Status values that need to be considered for filter + # @param [Hash] opts the optional parameters + # @return [Array] + describe 'find_pets_by_status test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for find_pets_by_tags + # Finds Pets by tags + # Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + # @param tags Tags to filter by + # @param [Hash] opts the optional parameters + # @return [Array] + describe 'find_pets_by_tags test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_pet_by_id + # Find pet by ID + # Returns a single pet + # @param pet_id ID of pet to return + # @param [Hash] opts the optional parameters + # @return [Pet] + describe 'get_pet_by_id test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_pet + # Update an existing pet + # @param pet Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'update_pet test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_pet_with_form + # Updates a pet in the store with form data + # @param pet_id ID of pet that needs to be updated + # @param [Hash] opts the optional parameters + # @option opts [String] :name Updated name of the pet + # @option opts [String] :status Updated status of the pet + # @return [nil] + describe 'update_pet_with_form test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for upload_file + # uploads an image + # @param pet_id ID of pet to update + # @param [Hash] opts the optional parameters + # @option opts [String] :additional_metadata Additional data to pass to server + # @option opts [File] :file file to upload + # @return [ApiResponse] + describe 'upload_file test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for upload_file_with_required_file + # uploads an image (required) + # @param pet_id ID of pet to update + # @param required_file file to upload + # @param [Hash] opts the optional parameters + # @option opts [String] :additional_metadata Additional data to pass to server + # @return [ApiResponse] + describe 'upload_file_with_required_file test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/api/store_api_spec.rb b/samples/client/petstore/ruby-faraday/spec/api/store_api_spec.rb new file mode 100644 index 00000000000..a8e5f98f265 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/api/store_api_spec.rb @@ -0,0 +1,81 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for Petstore::StoreApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'StoreApi' do + before do + # run before each test + @instance = Petstore::StoreApi.new + end + + after do + # run after each test + end + + describe 'test an instance of StoreApi' do + it 'should create an instance of StoreApi' do + expect(@instance).to be_instance_of(Petstore::StoreApi) + end + end + + # unit tests for delete_order + # Delete purchase order by ID + # For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + # @param order_id ID of the order that needs to be deleted + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'delete_order test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_inventory + # Returns pet inventories by status + # Returns a map of status codes to quantities + # @param [Hash] opts the optional parameters + # @return [Hash] + describe 'get_inventory test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_order_by_id + # Find purchase order by ID + # For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + # @param order_id ID of pet that needs to be fetched + # @param [Hash] opts the optional parameters + # @return [Order] + describe 'get_order_by_id test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for place_order + # Place an order for a pet + # @param order order placed for purchasing the pet + # @param [Hash] opts the optional parameters + # @return [Order] + describe 'place_order test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/api/user_api_spec.rb b/samples/client/petstore/ruby-faraday/spec/api/user_api_spec.rb new file mode 100644 index 00000000000..ad03485ad55 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/api/user_api_spec.rb @@ -0,0 +1,127 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for Petstore::UserApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'UserApi' do + before do + # run before each test + @instance = Petstore::UserApi.new + end + + after do + # run after each test + end + + describe 'test an instance of UserApi' do + it 'should create an instance of UserApi' do + expect(@instance).to be_instance_of(Petstore::UserApi) + end + end + + # unit tests for create_user + # Create user + # This can only be done by the logged in user. + # @param user Created user object + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'create_user test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_users_with_array_input + # Creates list of users with given input array + # @param user List of user object + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'create_users_with_array_input test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_users_with_list_input + # Creates list of users with given input array + # @param user List of user object + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'create_users_with_list_input test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for delete_user + # Delete user + # This can only be done by the logged in user. + # @param username The name that needs to be deleted + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'delete_user test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_user_by_name + # Get user by user name + # @param username The name that needs to be fetched. Use user1 for testing. + # @param [Hash] opts the optional parameters + # @return [User] + describe 'get_user_by_name test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for login_user + # Logs user into the system + # @param username The user name for login + # @param password The password for login in clear text + # @param [Hash] opts the optional parameters + # @return [String] + describe 'login_user test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for logout_user + # Logs out current logged in user session + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'logout_user test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_user + # Updated user + # This can only be done by the logged in user. + # @param username name that need to be deleted + # @param user Updated user object + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'update_user test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/api_client_spec.rb b/samples/client/petstore/ruby-faraday/spec/api_client_spec.rb new file mode 100644 index 00000000000..126277d9c46 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/api_client_spec.rb @@ -0,0 +1,226 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' + +describe Petstore::ApiClient do + context 'initialization' do + context 'URL stuff' do + context 'host' do + it 'removes http from host' do + Petstore.configure { |c| c.host = 'http://example.com' } + expect(Petstore::Configuration.default.host).to eq('example.com') + end + + it 'removes https from host' do + Petstore.configure { |c| c.host = 'https://wookiee.com' } + expect(Petstore::ApiClient.default.config.host).to eq('wookiee.com') + end + + it 'removes trailing path from host' do + Petstore.configure { |c| c.host = 'hobo.com/v4' } + expect(Petstore::Configuration.default.host).to eq('hobo.com') + end + end + + context 'base_path' do + it "prepends a slash to base_path" do + Petstore.configure { |c| c.base_path = 'v4/dog' } + expect(Petstore::Configuration.default.base_path).to eq('/v4/dog') + end + + it "doesn't prepend a slash if one is already there" do + Petstore.configure { |c| c.base_path = '/v4/dog' } + expect(Petstore::Configuration.default.base_path).to eq('/v4/dog') + end + + it "ends up as a blank string if nil" do + Petstore.configure { |c| c.base_path = nil } + expect(Petstore::Configuration.default.base_path).to eq('') + end + end + end + end + + describe 'params_encoding in #build_request' do + let(:config) { Petstore::Configuration.new } + let(:api_client) { Petstore::ApiClient.new(config) } + + it 'defaults to nil' do + expect(Petstore::Configuration.default.params_encoding).to eq(nil) + expect(config.params_encoding).to eq(nil) + + request = api_client.build_request(:get, '/test') + expect(request.options[:params_encoding]).to eq(nil) + end + + it 'can be customized' do + config.params_encoding = :multi + request = api_client.build_request(:get, '/test') + expect(request.options[:params_encoding]).to eq(:multi) + end + end + + describe 'timeout in #build_request' do + let(:config) { Petstore::Configuration.new } + let(:api_client) { Petstore::ApiClient.new(config) } + + it 'defaults to 0' do + expect(Petstore::Configuration.default.timeout).to eq(0) + expect(config.timeout).to eq(0) + + request = api_client.build_request(:get, '/test') + expect(request.options[:timeout]).to eq(0) + end + + it 'can be customized' do + config.timeout = 100 + request = api_client.build_request(:get, '/test') + expect(request.options[:timeout]).to eq(100) + end + end + + describe '#deserialize' do + it "handles Array" do + api_client = Petstore::ApiClient.new + headers = { 'Content-Type' => 'application/json' } + response = double('response', headers: headers, body: '[12, 34]') + data = api_client.deserialize(response, 'Array') + expect(data).to be_instance_of(Array) + expect(data).to eq([12, 34]) + end + + it 'handles Array>' do + api_client = Petstore::ApiClient.new + headers = { 'Content-Type' => 'application/json' } + response = double('response', headers: headers, body: '[[12, 34], [56]]') + data = api_client.deserialize(response, 'Array>') + expect(data).to be_instance_of(Array) + expect(data).to eq([[12, 34], [56]]) + end + + it 'handles Hash' do + api_client = Petstore::ApiClient.new + headers = { 'Content-Type' => 'application/json' } + response = double('response', headers: headers, body: '{"message": "Hello"}') + data = api_client.deserialize(response, 'Hash') + expect(data).to be_instance_of(Hash) + expect(data).to eq(:message => 'Hello') + end + end + + describe "#object_to_hash" do + it 'ignores nils and includes empty arrays' do + # uncomment below to test object_to_hash for model + # api_client = Petstore::ApiClient.new + # _model = Petstore::ModelName.new + # update the model attribute below + # _model.id = 1 + # update the expected value (hash) below + # expected = {id: 1, name: '', tags: []} + # expect(api_client.object_to_hash(_model)).to eq(expected) + end + end + + describe '#build_collection_param' do + let(:param) { ['aa', 'bb', 'cc'] } + let(:api_client) { Petstore::ApiClient.new } + + it 'works for csv' do + expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc') + end + + it 'works for ssv' do + expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc') + end + + it 'works for tsv' do + expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc") + end + + it 'works for pipes' do + expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc') + end + + it 'works for multi' do + expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc']) + end + + it 'fails for invalid collection format' do + expect(proc { api_client.build_collection_param(param, :INVALID) }).to raise_error(RuntimeError, 'unknown collection format: :INVALID') + end + end + + describe '#json_mime?' do + let(:api_client) { Petstore::ApiClient.new } + + it 'works' do + expect(api_client.json_mime?(nil)).to eq false + expect(api_client.json_mime?('')).to eq false + + expect(api_client.json_mime?('application/json')).to eq true + expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true + expect(api_client.json_mime?('APPLICATION/JSON')).to eq true + + expect(api_client.json_mime?('application/xml')).to eq false + expect(api_client.json_mime?('text/plain')).to eq false + expect(api_client.json_mime?('application/jsonp')).to eq false + end + end + + describe '#select_header_accept' do + let(:api_client) { Petstore::ApiClient.new } + + it 'works' do + expect(api_client.select_header_accept(nil)).to be_nil + expect(api_client.select_header_accept([])).to be_nil + + expect(api_client.select_header_accept(['application/json'])).to eq('application/json') + expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8') + expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON') + + expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml') + expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml') + end + end + + describe '#select_header_content_type' do + let(:api_client) { Petstore::ApiClient.new } + + it 'works' do + expect(api_client.select_header_content_type(nil)).to eq('application/json') + expect(api_client.select_header_content_type([])).to eq('application/json') + + expect(api_client.select_header_content_type(['application/json'])).to eq('application/json') + expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8') + expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON') + expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml') + expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain') + end + end + + describe '#sanitize_filename' do + let(:api_client) { Petstore::ApiClient.new } + + it 'works' do + expect(api_client.sanitize_filename('sun')).to eq('sun') + expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif') + end + end +end diff --git a/samples/client/petstore/ruby-faraday/spec/configuration_spec.rb b/samples/client/petstore/ruby-faraday/spec/configuration_spec.rb new file mode 100644 index 00000000000..dc10a08725a --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/configuration_spec.rb @@ -0,0 +1,42 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' + +describe Petstore::Configuration do + let(:config) { Petstore::Configuration.default } + + before(:each) do + # uncomment below to setup host and base_path + # require 'URI' + # uri = URI.parse("http://petstore.swagger.io:80/v2") + # Petstore.configure do |c| + # c.host = uri.host + # c.base_path = uri.path + # end + end + + describe '#base_url' do + it 'should have the default value' do + # uncomment below to test default value of the base path + # expect(config.base_url).to eq("http://petstore.swagger.io:80/v2") + end + + it 'should remove trailing slashes' do + [nil, '', '/', '//'].each do |base_path| + config.base_path = base_path + # uncomment below to test trailing slashes + # expect(config.base_url).to eq("http://petstore.swagger.io:80/v2") + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb new file mode 100644 index 00000000000..74cdfd72662 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb @@ -0,0 +1,47 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::AdditionalPropertiesClass +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'AdditionalPropertiesClass' do + before do + # run before each test + @instance = Petstore::AdditionalPropertiesClass.new + end + + after do + # run after each test + end + + describe 'test an instance of AdditionalPropertiesClass' do + it 'should create an instance of AdditionalPropertiesClass' do + expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesClass) + end + end + describe 'test attribute "map_property"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "map_of_map_property"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/animal_farm_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/animal_farm_spec.rb new file mode 100644 index 00000000000..ed49a705c19 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/animal_farm_spec.rb @@ -0,0 +1,35 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::AnimalFarm +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'AnimalFarm' do + before do + # run before each test + @instance = Petstore::AnimalFarm.new + end + + after do + # run after each test + end + + describe 'test an instance of AnimalFarm' do + it 'should create an instance of AnimalFarm' do + expect(@instance).to be_instance_of(Petstore::AnimalFarm) + end + end +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/animal_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/animal_spec.rb new file mode 100644 index 00000000000..919d44a6de1 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/animal_spec.rb @@ -0,0 +1,47 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::Animal +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Animal' do + before do + # run before each test + @instance = Petstore::Animal.new + end + + after do + # run after each test + end + + describe 'test an instance of Animal' do + it 'should create an instance of Animal' do + expect(@instance).to be_instance_of(Petstore::Animal) + end + end + describe 'test attribute "class_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "color"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/api_response_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/api_response_spec.rb new file mode 100644 index 00000000000..eee16162150 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/api_response_spec.rb @@ -0,0 +1,53 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::ApiResponse +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ApiResponse' do + before do + # run before each test + @instance = Petstore::ApiResponse.new + end + + after do + # run after each test + end + + describe 'test an instance of ApiResponse' do + it 'should create an instance of ApiResponse' do + expect(@instance).to be_instance_of(Petstore::ApiResponse) + end + end + describe 'test attribute "code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "message"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb new file mode 100644 index 00000000000..af1b73b32fd --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb @@ -0,0 +1,41 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::ArrayOfArrayOfNumberOnly +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ArrayOfArrayOfNumberOnly' do + before do + # run before each test + @instance = Petstore::ArrayOfArrayOfNumberOnly.new + end + + after do + # run after each test + end + + describe 'test an instance of ArrayOfArrayOfNumberOnly' do + it 'should create an instance of ArrayOfArrayOfNumberOnly' do + expect(@instance).to be_instance_of(Petstore::ArrayOfArrayOfNumberOnly) + end + end + describe 'test attribute "array_array_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb new file mode 100644 index 00000000000..09614264747 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb @@ -0,0 +1,41 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::ArrayOfNumberOnly +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ArrayOfNumberOnly' do + before do + # run before each test + @instance = Petstore::ArrayOfNumberOnly.new + end + + after do + # run after each test + end + + describe 'test an instance of ArrayOfNumberOnly' do + it 'should create an instance of ArrayOfNumberOnly' do + expect(@instance).to be_instance_of(Petstore::ArrayOfNumberOnly) + end + end + describe 'test attribute "array_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/array_test_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/array_test_spec.rb new file mode 100644 index 00000000000..0a73951d055 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/array_test_spec.rb @@ -0,0 +1,53 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::ArrayTest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ArrayTest' do + before do + # run before each test + @instance = Petstore::ArrayTest.new + end + + after do + # run after each test + end + + describe 'test an instance of ArrayTest' do + it 'should create an instance of ArrayTest' do + expect(@instance).to be_instance_of(Petstore::ArrayTest) + end + end + describe 'test attribute "array_of_string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "array_array_of_integer"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "array_array_of_model"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb new file mode 100644 index 00000000000..3ff0cc6d46a --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb @@ -0,0 +1,71 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::Capitalization +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Capitalization' do + before do + # run before each test + @instance = Petstore::Capitalization.new + end + + after do + # run after each test + end + + describe 'test an instance of Capitalization' do + it 'should create an instance of Capitalization' do + expect(@instance).to be_instance_of(Petstore::Capitalization) + end + end + describe 'test attribute "small_camel"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "capital_camel"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "small_snake"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "capital_snake"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "sca_eth_flow_points"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "att_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/cat_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/cat_spec.rb new file mode 100644 index 00000000000..0a7f6f73d40 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/cat_spec.rb @@ -0,0 +1,53 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::Cat +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Cat' do + before do + # run before each test + @instance = Petstore::Cat.new + end + + after do + # run after each test + end + + describe 'test an instance of Cat' do + it 'should create an instance of Cat' do + expect(@instance).to be_instance_of(Petstore::Cat) + end + end + describe 'test attribute "class_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "color"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "declawed"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/category_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/category_spec.rb new file mode 100644 index 00000000000..9c01794aa13 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/category_spec.rb @@ -0,0 +1,47 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::Category +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Category' do + before do + # run before each test + @instance = Petstore::Category.new + end + + after do + # run after each test + end + + describe 'test an instance of Category' do + it 'should create an instance of Category' do + expect(@instance).to be_instance_of(Petstore::Category) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/class_model_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/class_model_spec.rb new file mode 100644 index 00000000000..5db801ec21a --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/class_model_spec.rb @@ -0,0 +1,41 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::ClassModel +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ClassModel' do + before do + # run before each test + @instance = Petstore::ClassModel.new + end + + after do + # run after each test + end + + describe 'test an instance of ClassModel' do + it 'should create an instance of ClassModel' do + expect(@instance).to be_instance_of(Petstore::ClassModel) + end + end + describe 'test attribute "_class"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/client_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/client_spec.rb new file mode 100644 index 00000000000..799a0ab76a4 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/client_spec.rb @@ -0,0 +1,41 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::Client +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Client' do + before do + # run before each test + @instance = Petstore::Client.new + end + + after do + # run after each test + end + + describe 'test an instance of Client' do + it 'should create an instance of Client' do + expect(@instance).to be_instance_of(Petstore::Client) + end + end + describe 'test attribute "client"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/dog_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/dog_spec.rb new file mode 100644 index 00000000000..0534bd2d1c7 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/dog_spec.rb @@ -0,0 +1,53 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::Dog +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Dog' do + before do + # run before each test + @instance = Petstore::Dog.new + end + + after do + # run after each test + end + + describe 'test an instance of Dog' do + it 'should create an instance of Dog' do + expect(@instance).to be_instance_of(Petstore::Dog) + end + end + describe 'test attribute "class_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "color"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "breed"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb new file mode 100644 index 00000000000..b41dbf4c3ab --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb @@ -0,0 +1,55 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::EnumArrays +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EnumArrays' do + before do + # run before each test + @instance = Petstore::EnumArrays.new + end + + after do + # run after each test + end + + describe 'test an instance of EnumArrays' do + it 'should create an instance of EnumArrays' do + expect(@instance).to be_instance_of(Petstore::EnumArrays) + end + end + describe 'test attribute "just_symbol"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', [">=", "$"]) + # validator.allowable_values.each do |value| + # expect { @instance.just_symbol = value }.not_to raise_error + # end + end + end + + describe 'test attribute "array_enum"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array', ["fish", "crab"]) + # validator.allowable_values.each do |value| + # expect { @instance.array_enum = value }.not_to raise_error + # end + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb new file mode 100644 index 00000000000..372b077794f --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb @@ -0,0 +1,35 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::EnumClass +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EnumClass' do + before do + # run before each test + @instance = Petstore::EnumClass.new + end + + after do + # run after each test + end + + describe 'test an instance of EnumClass' do + it 'should create an instance of EnumClass' do + expect(@instance).to be_instance_of(Petstore::EnumClass) + end + end +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb new file mode 100644 index 00000000000..4c2323476f4 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb @@ -0,0 +1,81 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::EnumTest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EnumTest' do + before do + # run before each test + @instance = Petstore::EnumTest.new + end + + after do + # run after each test + end + + describe 'test an instance of EnumTest' do + it 'should create an instance of EnumTest' do + expect(@instance).to be_instance_of(Petstore::EnumTest) + end + end + describe 'test attribute "enum_string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) + # validator.allowable_values.each do |value| + # expect { @instance.enum_string = value }.not_to raise_error + # end + end + end + + describe 'test attribute "enum_string_required"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) + # validator.allowable_values.each do |value| + # expect { @instance.enum_string_required = value }.not_to raise_error + # end + end + end + + describe 'test attribute "enum_integer"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('Integer', ["1", "-1"]) + # validator.allowable_values.each do |value| + # expect { @instance.enum_integer = value }.not_to raise_error + # end + end + end + + describe 'test attribute "enum_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('Float', ["1.1", "-1.2"]) + # validator.allowable_values.each do |value| + # expect { @instance.enum_number = value }.not_to raise_error + # end + end + end + + describe 'test attribute "outer_enum"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb new file mode 100644 index 00000000000..0fe4facbb33 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb @@ -0,0 +1,47 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::FileSchemaTestClass +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'FileSchemaTestClass' do + before do + # run before each test + @instance = Petstore::FileSchemaTestClass.new + end + + after do + # run after each test + end + + describe 'test an instance of FileSchemaTestClass' do + it 'should create an instance of FileSchemaTestClass' do + expect(@instance).to be_instance_of(Petstore::FileSchemaTestClass) + end + end + describe 'test attribute "file"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "files"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/file_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/file_spec.rb new file mode 100644 index 00000000000..b13b57fa11e --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/file_spec.rb @@ -0,0 +1,41 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::File +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'File' do + before do + # run before each test + @instance = Petstore::File.new + end + + after do + # run after each test + end + + describe 'test an instance of File' do + it 'should create an instance of File' do + expect(@instance).to be_instance_of(Petstore::File) + end + end + describe 'test attribute "source_uri"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/format_test_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/format_test_spec.rb new file mode 100644 index 00000000000..a23e6648d16 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/format_test_spec.rb @@ -0,0 +1,113 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::FormatTest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'FormatTest' do + before do + # run before each test + @instance = Petstore::FormatTest.new + end + + after do + # run after each test + end + + describe 'test an instance of FormatTest' do + it 'should create an instance of FormatTest' do + expect(@instance).to be_instance_of(Petstore::FormatTest) + end + end + describe 'test attribute "integer"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "int32"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "int64"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "float"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "double"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "byte"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "binary"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "date_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "uuid"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "password"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb new file mode 100644 index 00000000000..e03a10b9d1c --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb @@ -0,0 +1,47 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::HasOnlyReadOnly +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'HasOnlyReadOnly' do + before do + # run before each test + @instance = Petstore::HasOnlyReadOnly.new + end + + after do + # run after each test + end + + describe 'test an instance of HasOnlyReadOnly' do + it 'should create an instance of HasOnlyReadOnly' do + expect(@instance).to be_instance_of(Petstore::HasOnlyReadOnly) + end + end + describe 'test attribute "bar"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "foo"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/list_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/list_spec.rb new file mode 100644 index 00000000000..17d747979b6 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/list_spec.rb @@ -0,0 +1,41 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::List +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'List' do + before do + # run before each test + @instance = Petstore::List.new + end + + after do + # run after each test + end + + describe 'test an instance of List' do + it 'should create an instance of List' do + expect(@instance).to be_instance_of(Petstore::List) + end + end + describe 'test attribute "_123_list"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/map_test_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/map_test_spec.rb new file mode 100644 index 00000000000..a715bf7e686 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/map_test_spec.rb @@ -0,0 +1,63 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::MapTest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'MapTest' do + before do + # run before each test + @instance = Petstore::MapTest.new + end + + after do + # run after each test + end + + describe 'test an instance of MapTest' do + it 'should create an instance of MapTest' do + expect(@instance).to be_instance_of(Petstore::MapTest) + end + end + describe 'test attribute "map_map_of_string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "map_of_enum_string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('Hash', ["UPPER", "lower"]) + # validator.allowable_values.each do |value| + # expect { @instance.map_of_enum_string = value }.not_to raise_error + # end + end + end + + describe 'test attribute "direct_map"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "indirect_map"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb new file mode 100644 index 00000000000..cfd0b0b7bac --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb @@ -0,0 +1,53 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::MixedPropertiesAndAdditionalPropertiesClass +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'MixedPropertiesAndAdditionalPropertiesClass' do + before do + # run before each test + @instance = Petstore::MixedPropertiesAndAdditionalPropertiesClass.new + end + + after do + # run after each test + end + + describe 'test an instance of MixedPropertiesAndAdditionalPropertiesClass' do + it 'should create an instance of MixedPropertiesAndAdditionalPropertiesClass' do + expect(@instance).to be_instance_of(Petstore::MixedPropertiesAndAdditionalPropertiesClass) + end + end + describe 'test attribute "uuid"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "date_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "map"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb new file mode 100644 index 00000000000..fb4647bd659 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb @@ -0,0 +1,47 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::Model200Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Model200Response' do + before do + # run before each test + @instance = Petstore::Model200Response.new + end + + after do + # run after each test + end + + describe 'test an instance of Model200Response' do + it 'should create an instance of Model200Response' do + expect(@instance).to be_instance_of(Petstore::Model200Response) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "_class"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/model_return_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/model_return_spec.rb new file mode 100644 index 00000000000..f48aa159a4a --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/model_return_spec.rb @@ -0,0 +1,41 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::ModelReturn +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ModelReturn' do + before do + # run before each test + @instance = Petstore::ModelReturn.new + end + + after do + # run after each test + end + + describe 'test an instance of ModelReturn' do + it 'should create an instance of ModelReturn' do + expect(@instance).to be_instance_of(Petstore::ModelReturn) + end + end + describe 'test attribute "_return"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/name_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/name_spec.rb new file mode 100644 index 00000000000..c579b1d6fc0 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/name_spec.rb @@ -0,0 +1,59 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::Name +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Name' do + before do + # run before each test + @instance = Petstore::Name.new + end + + after do + # run after each test + end + + describe 'test an instance of Name' do + it 'should create an instance of Name' do + expect(@instance).to be_instance_of(Petstore::Name) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "snake_case"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "property"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "_123_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/number_only_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/number_only_spec.rb new file mode 100644 index 00000000000..875e0f4b16e --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/number_only_spec.rb @@ -0,0 +1,41 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::NumberOnly +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'NumberOnly' do + before do + # run before each test + @instance = Petstore::NumberOnly.new + end + + after do + # run after each test + end + + describe 'test an instance of NumberOnly' do + it 'should create an instance of NumberOnly' do + expect(@instance).to be_instance_of(Petstore::NumberOnly) + end + end + describe 'test attribute "just_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/order_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/order_spec.rb new file mode 100644 index 00000000000..f7a93960045 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/order_spec.rb @@ -0,0 +1,75 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::Order +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Order' do + before do + # run before each test + @instance = Petstore::Order.new + end + + after do + # run after each test + end + + describe 'test an instance of Order' do + it 'should create an instance of Order' do + expect(@instance).to be_instance_of(Petstore::Order) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pet_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "quantity"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "ship_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["placed", "approved", "delivered"]) + # validator.allowable_values.each do |value| + # expect { @instance.status = value }.not_to raise_error + # end + end + end + + describe 'test attribute "complete"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb new file mode 100644 index 00000000000..c096a07bb9c --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb @@ -0,0 +1,53 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::OuterComposite +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'OuterComposite' do + before do + # run before each test + @instance = Petstore::OuterComposite.new + end + + after do + # run after each test + end + + describe 'test an instance of OuterComposite' do + it 'should create an instance of OuterComposite' do + expect(@instance).to be_instance_of(Petstore::OuterComposite) + end + end + describe 'test attribute "my_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "my_string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "my_boolean"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb new file mode 100644 index 00000000000..e8d8c501b6c --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb @@ -0,0 +1,35 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::OuterEnum +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'OuterEnum' do + before do + # run before each test + @instance = Petstore::OuterEnum.new + end + + after do + # run after each test + end + + describe 'test an instance of OuterEnum' do + it 'should create an instance of OuterEnum' do + expect(@instance).to be_instance_of(Petstore::OuterEnum) + end + end +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/pet_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/pet_spec.rb new file mode 100644 index 00000000000..28ab0160615 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/pet_spec.rb @@ -0,0 +1,75 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::Pet +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Pet' do + before do + # run before each test + @instance = Petstore::Pet.new + end + + after do + # run after each test + end + + describe 'test an instance of Pet' do + it 'should create an instance of Pet' do + expect(@instance).to be_instance_of(Petstore::Pet) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "category"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "photo_urls"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tags"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["available", "pending", "sold"]) + # validator.allowable_values.each do |value| + # expect { @instance.status = value }.not_to raise_error + # end + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb new file mode 100644 index 00000000000..5688f5a5f61 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb @@ -0,0 +1,47 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::ReadOnlyFirst +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ReadOnlyFirst' do + before do + # run before each test + @instance = Petstore::ReadOnlyFirst.new + end + + after do + # run after each test + end + + describe 'test an instance of ReadOnlyFirst' do + it 'should create an instance of ReadOnlyFirst' do + expect(@instance).to be_instance_of(Petstore::ReadOnlyFirst) + end + end + describe 'test attribute "bar"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "baz"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb new file mode 100644 index 00000000000..154524f6850 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb @@ -0,0 +1,41 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::SpecialModelName +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'SpecialModelName' do + before do + # run before each test + @instance = Petstore::SpecialModelName.new + end + + after do + # run after each test + end + + describe 'test an instance of SpecialModelName' do + it 'should create an instance of SpecialModelName' do + expect(@instance).to be_instance_of(Petstore::SpecialModelName) + end + end + describe 'test attribute "special_property_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/string_boolean_map_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/string_boolean_map_spec.rb new file mode 100644 index 00000000000..49296ac3ce6 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/string_boolean_map_spec.rb @@ -0,0 +1,35 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::StringBooleanMap +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'StringBooleanMap' do + before do + # run before each test + @instance = Petstore::StringBooleanMap.new + end + + after do + # run after each test + end + + describe 'test an instance of StringBooleanMap' do + it 'should create an instance of StringBooleanMap' do + expect(@instance).to be_instance_of(Petstore::StringBooleanMap) + end + end +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/tag_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/tag_spec.rb new file mode 100644 index 00000000000..2fabaecb848 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/tag_spec.rb @@ -0,0 +1,47 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::Tag +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Tag' do + before do + # run before each test + @instance = Petstore::Tag.new + end + + after do + # run after each test + end + + describe 'test an instance of Tag' do + it 'should create an instance of Tag' do + expect(@instance).to be_instance_of(Petstore::Tag) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/user_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/user_spec.rb new file mode 100644 index 00000000000..220343859bc --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/user_spec.rb @@ -0,0 +1,83 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::User +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'User' do + before do + # run before each test + @instance = Petstore::User.new + end + + after do + # run after each test + end + + describe 'test an instance of User' do + it 'should create an instance of User' do + expect(@instance).to be_instance_of(Petstore::User) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "username"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "first_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "last_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "email"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "password"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "phone"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "user_status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/spec_helper.rb b/samples/client/petstore/ruby-faraday/spec/spec_helper.rb new file mode 100644 index 00000000000..bdda3fb7d02 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/spec_helper.rb @@ -0,0 +1,111 @@ +=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: \" \\ + +OpenAPI spec version: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 3.3.3-SNAPSHOT + +=end + +# load the gem +require 'petstore' + +# The following was generated by the `rspec --init` command. Conventionally, all +# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. +# The generated `.rspec` file contains `--require spec_helper` which will cause +# this file to always be loaded, without a need to explicitly require it in any +# files. +# +# Given that it is always loaded, you are encouraged to keep this file as +# light-weight as possible. Requiring heavyweight dependencies from this file +# will add to the boot time of your test suite on EVERY test run, even for an +# individual file that may not need all of that loaded. Instead, consider making +# a separate helper file that requires the additional dependencies and performs +# the additional setup, and require it from the spec files that actually need +# it. +# +# The `.rspec` file also contains a few flags that are not defaults but that +# users commonly want. +# +# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration +RSpec.configure do |config| + # rspec-expectations config goes here. You can use an alternate + # assertion/expectation library such as wrong or the stdlib/minitest + # assertions if you prefer. + config.expect_with :rspec do |expectations| + # This option will default to `true` in RSpec 4. It makes the `description` + # and `failure_message` of custom matchers include text for helper methods + # defined using `chain`, e.g.: + # be_bigger_than(2).and_smaller_than(4).description + # # => "be bigger than 2 and smaller than 4" + # ...rather than: + # # => "be bigger than 2" + expectations.include_chain_clauses_in_custom_matcher_descriptions = true + end + + # rspec-mocks config goes here. You can use an alternate test double + # library (such as bogus or mocha) by changing the `mock_with` option here. + config.mock_with :rspec do |mocks| + # Prevents you from mocking or stubbing a method that does not exist on + # a real object. This is generally recommended, and will default to + # `true` in RSpec 4. + mocks.verify_partial_doubles = true + end + +# The settings below are suggested to provide a good initial experience +# with RSpec, but feel free to customize to your heart's content. +=begin + # These two settings work together to allow you to limit a spec run + # to individual examples or groups you care about by tagging them with + # `:focus` metadata. When nothing is tagged with `:focus`, all examples + # get run. + config.filter_run :focus + config.run_all_when_everything_filtered = true + + # Allows RSpec to persist some state between runs in order to support + # the `--only-failures` and `--next-failure` CLI options. We recommend + # you configure your source control system to ignore this file. + config.example_status_persistence_file_path = "spec/examples.txt" + + # Limits the available syntax to the non-monkey patched syntax that is + # recommended. For more details, see: + # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ + # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ + # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode + config.disable_monkey_patching! + + # This setting enables warnings. It's recommended, but in some cases may + # be too noisy due to issues in dependencies. + config.warnings = true + + # Many RSpec users commonly either run the entire suite or an individual + # file, and it's useful to allow more verbose output when running an + # individual spec file. + if config.files_to_run.one? + # Use the documentation formatter for detailed output, + # unless a formatter has already been configured + # (e.g. via a command-line flag). + config.default_formatter = 'doc' + end + + # Print the 10 slowest examples and example groups at the + # end of the spec run, to help surface which specs are running + # particularly slow. + config.profile_examples = 10 + + # Run specs in random order to surface order dependencies. If you find an + # order dependency and want to debug it, you can fix the order by providing + # the seed, which is printed after each run. + # --seed 1234 + config.order = :random + + # Seed global randomization in this process using the `--seed` CLI option. + # Setting this allows you to use `--seed` to deterministically reproduce + # test failures related to randomization by passing the same `--seed` value + # as the one that triggered the failure. + Kernel.srand config.seed +=end +end From 0a7527b03e5ea9d56ea39862217294fd7db81f97 Mon Sep 17 00:00:00 2001 From: Marc Schlegel Date: Thu, 1 Aug 2019 06:39:47 +0200 Subject: [PATCH 26/75] [java-client][okhttp-gson] fixes for interceptors in ApiClient.java (#3502) ApiClient for Okhttp3 must not copy the interceptors when setting the HttpClient. Enforce invariant that the HttpClient must never be null. --- .../okhttp-gson/ApiClientTest.java | 25 ++++++++----------- .../libraries/okhttp-gson/ApiClient.mustache | 16 +++--------- .../org/openapitools/client/ApiClient.java | 16 +++--------- .../org/openapitools/client/ApiClient.java | 16 +++--------- .../openapitools/client/ApiClientTest.java | 25 ++++++++----------- 5 files changed, 29 insertions(+), 69 deletions(-) diff --git a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/ApiClientTest.java b/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/ApiClientTest.java index 6181e8afa2d..626901593bd 100644 --- a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/ApiClientTest.java +++ b/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/ApiClientTest.java @@ -10,6 +10,7 @@ import java.util.TimeZone; import org.junit.*; import static org.junit.Assert.*; +import static org.hamcrest.CoreMatchers.*; public class ApiClientTest { @@ -329,24 +330,18 @@ public class ApiClientTest { assertEquals("sun.gif", apiClient.sanitizeFilename(".\\sun.gif")); } - @Test - public void testInterceptorCleanupWithNewClient() { + public void testNewHttpClient() { OkHttpClient oldClient = apiClient.getHttpClient(); - assertEquals(1, oldClient.networkInterceptors().size()); - - OkHttpClient newClient = new OkHttpClient(); - apiClient.setHttpClient(newClient); - assertEquals(1, apiClient.getHttpClient().networkInterceptors().size()); - apiClient.setHttpClient(newClient); - assertEquals(1, apiClient.getHttpClient().networkInterceptors().size()); + apiClient.setHttpClient(oldClient.newBuilder().build()); + assertThat(apiClient.getHttpClient(), is(not(oldClient))); } - @Test - public void testInterceptorCleanupWithSameClient() { - OkHttpClient oldClient = apiClient.getHttpClient(); - assertEquals(1, oldClient.networkInterceptors().size()); - apiClient.setHttpClient(oldClient); - assertEquals(1, apiClient.getHttpClient().networkInterceptors().size()); + /** + * Tests the invariant that the HttpClient for the ApiClient must never be null + */ + @Test(expected = NullPointerException.class) + public void testNullHttpClient() { + apiClient.setHttpClient(null); } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache index cd173326c10..682bf945069 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache @@ -187,24 +187,14 @@ public class ApiClient { } /** - * Set HTTP client + * Set HTTP client, which must never be null. * * @param newHttpClient An instance of OkHttpClient * @return Api Client + * @throws NullPointerException when newHttpClient is null */ public ApiClient setHttpClient(OkHttpClient newHttpClient) { - if(!httpClient.equals(newHttpClient)) { - OkHttpClient.Builder builder = newHttpClient.newBuilder(); - Iterator networkInterceptorIterator = httpClient.networkInterceptors().iterator(); - while(networkInterceptorIterator.hasNext()) { - builder.addNetworkInterceptor(networkInterceptorIterator.next()); - } - Iterator interceptorIterator = httpClient.interceptors().iterator(); - while(interceptorIterator.hasNext()) { - builder.addInterceptor(interceptorIterator.next()); - } - this.httpClient = builder.build(); - } + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); return this; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java index 0934b6f1aa9..42fc1fa212a 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/ApiClient.java @@ -170,24 +170,14 @@ public class ApiClient { } /** - * Set HTTP client + * Set HTTP client, which must never be null. * * @param newHttpClient An instance of OkHttpClient * @return Api Client + * @throws NullPointerException when newHttpClient is null */ public ApiClient setHttpClient(OkHttpClient newHttpClient) { - if(!httpClient.equals(newHttpClient)) { - OkHttpClient.Builder builder = newHttpClient.newBuilder(); - Iterator networkInterceptorIterator = httpClient.networkInterceptors().iterator(); - while(networkInterceptorIterator.hasNext()) { - builder.addNetworkInterceptor(networkInterceptorIterator.next()); - } - Iterator interceptorIterator = httpClient.interceptors().iterator(); - while(interceptorIterator.hasNext()) { - builder.addInterceptor(interceptorIterator.next()); - } - this.httpClient = builder.build(); - } + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); return this; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java index 0934b6f1aa9..42fc1fa212a 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java @@ -170,24 +170,14 @@ public class ApiClient { } /** - * Set HTTP client + * Set HTTP client, which must never be null. * * @param newHttpClient An instance of OkHttpClient * @return Api Client + * @throws NullPointerException when newHttpClient is null */ public ApiClient setHttpClient(OkHttpClient newHttpClient) { - if(!httpClient.equals(newHttpClient)) { - OkHttpClient.Builder builder = newHttpClient.newBuilder(); - Iterator networkInterceptorIterator = httpClient.networkInterceptors().iterator(); - while(networkInterceptorIterator.hasNext()) { - builder.addNetworkInterceptor(networkInterceptorIterator.next()); - } - Iterator interceptorIterator = httpClient.interceptors().iterator(); - while(interceptorIterator.hasNext()) { - builder.addInterceptor(interceptorIterator.next()); - } - this.httpClient = builder.build(); - } + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); return this; } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ApiClientTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ApiClientTest.java index 6181e8afa2d..626901593bd 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ApiClientTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/ApiClientTest.java @@ -10,6 +10,7 @@ import java.util.TimeZone; import org.junit.*; import static org.junit.Assert.*; +import static org.hamcrest.CoreMatchers.*; public class ApiClientTest { @@ -329,24 +330,18 @@ public class ApiClientTest { assertEquals("sun.gif", apiClient.sanitizeFilename(".\\sun.gif")); } - @Test - public void testInterceptorCleanupWithNewClient() { + public void testNewHttpClient() { OkHttpClient oldClient = apiClient.getHttpClient(); - assertEquals(1, oldClient.networkInterceptors().size()); - - OkHttpClient newClient = new OkHttpClient(); - apiClient.setHttpClient(newClient); - assertEquals(1, apiClient.getHttpClient().networkInterceptors().size()); - apiClient.setHttpClient(newClient); - assertEquals(1, apiClient.getHttpClient().networkInterceptors().size()); + apiClient.setHttpClient(oldClient.newBuilder().build()); + assertThat(apiClient.getHttpClient(), is(not(oldClient))); } - @Test - public void testInterceptorCleanupWithSameClient() { - OkHttpClient oldClient = apiClient.getHttpClient(); - assertEquals(1, oldClient.networkInterceptors().size()); - apiClient.setHttpClient(oldClient); - assertEquals(1, apiClient.getHttpClient().networkInterceptors().size()); + /** + * Tests the invariant that the HttpClient for the ApiClient must never be null + */ + @Test(expected = NullPointerException.class) + public void testNullHttpClient() { + apiClient.setHttpClient(null); } } From eca8ec3cf83d29fb17b2f54d1466e39fb4b03458 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 1 Aug 2019 15:58:45 +0800 Subject: [PATCH 27/75] update doc --- docs/generators/ruby.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/generators/ruby.md b/docs/generators/ruby.md index 3a9f8266cbf..a6af465e75f 100644 --- a/docs/generators/ruby.md +++ b/docs/generators/ruby.md @@ -22,6 +22,4 @@ sidebar_label: ruby |gemAuthor|gem author (only one is supported).| |null| |gemAuthorEmail|gem author email (only one is supported).| |null| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| -|faraday|Faraday (https://github.com/lostisland/faraday)| |false| -|typhoeus|Typhoeus (https://github.com/typhoeus/typhoeus)| |false| -|library|HTTP library template (sub-template) to use|
**faraday**
Faraday (https://github.com/lostisland/faraday)
**typhoeus**
Typhoeus >= 1.0.1 (https://github.com/typhoeus/typhoeus)
|faraday| +|library|HTTP library template (sub-template) to use|
**faraday**
Faraday (https://github.com/lostisland/faraday) (Beta support)
**typhoeus**
Typhoeus >= 1.0.1 (https://github.com/typhoeus/typhoeus)
|typhoeus| From 4d285939a662312b99b238dc5385fea548253ba2 Mon Sep 17 00:00:00 2001 From: "Mateusz Szychowski (Muttley)" Date: Thu, 1 Aug 2019 13:49:17 +0200 Subject: [PATCH 28/75] [C++][Pistache] Do not use JSON for primitive types in request body (#3509) * [C++][Pistache] Do not use JSON for primitive types in request body Request body can contain any input, simple strings, CSV text or something else * [C++][Pistache] Update Petstore sample version --- .../main/resources/cpp-pistache-server/api-source.mustache | 5 +++++ .../server/petstore/cpp-pistache/.openapi-generator/VERSION | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache index 4e35d5f863e..31afee650ff 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache @@ -70,7 +70,12 @@ void {{classname}}::{{operationIdSnakeCase}}_handler(const Pistache::Rest::Reque try { {{#hasBodyParam}} {{#bodyParam}} + {{^isPrimitiveType}} nlohmann::json::parse(request.body()).get_to({{paramName}}); + {{/isPrimitiveType}} + {{#isPrimitiveType}} + {{paramName}} = request.body(); + {{/isPrimitiveType}} {{/bodyParam}} {{/hasBodyParam}} this->{{operationIdSnakeCase}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#hasParams}}, {{/hasParams}}response); diff --git a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION index 479c313e87b..83a328a9227 100644 --- a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION +++ b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.3-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file From 08415d1d838fc0447ec93a55e5b34ee7f3870cbd Mon Sep 17 00:00:00 2001 From: sunn <33183834+etherealjoy@users.noreply.github.com> Date: Thu, 1 Aug 2019 20:50:28 +0200 Subject: [PATCH 29/75] Remove QRandomGenerator (#3508) --- samples/client/petstore/cpp-qt5/PetStore/UserApiTests.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/samples/client/petstore/cpp-qt5/PetStore/UserApiTests.cpp b/samples/client/petstore/cpp-qt5/PetStore/UserApiTests.cpp index 9dc641b8592..3634efc81f8 100644 --- a/samples/client/petstore/cpp-qt5/PetStore/UserApiTests.cpp +++ b/samples/client/petstore/cpp-qt5/PetStore/UserApiTests.cpp @@ -1,10 +1,11 @@ #include "UserApiTests.h" +#include #include #include #include #include -#include + UserApiTests::UserApiTests () {} UserApiTests::~UserApiTests () { @@ -32,7 +33,7 @@ OAIUser UserApiTests::createRandomUser() { user.setPhone(QString("123456789")); user.setUsername(QString("janedoe")); user.setPassword(QString("secretPassword")); - user.setUserStatus(static_cast(QRandomGenerator::system()->generate())); + user.setUserStatus(static_cast(rand())); return user; } From 581131e0fe730d56ed2c65f0156c16ea6f4807ad Mon Sep 17 00:00:00 2001 From: Ivan Aksamentov <9403403+ivan-aksamentov@users.noreply.github.com> Date: Fri, 2 Aug 2019 00:54:13 +0200 Subject: [PATCH 30/75] Fix PHP Symfony non-primitive return type being forced to be an array (#3515) * Fix PHP Symfony non-primitive return type being forced to be an array https://github.com/OpenAPITools/openapi-generator/issues/3514 * Update PHP Symfony samples --- .../codegen/languages/PhpSymfonyServerCodegen.java | 2 +- .../php-symfony/SymfonyBundle-php/Api/PetApiInterface.php | 4 ++-- .../php-symfony/SymfonyBundle-php/Api/StoreApiInterface.php | 4 ++-- .../php-symfony/SymfonyBundle-php/Api/UserApiInterface.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java index 4a58052af4b..d6025d2bb2f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSymfonyServerCodegen.java @@ -406,7 +406,7 @@ public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements Codeg // Create a variable to display the correct return type in comments for interfaces if (op.returnType != null) { op.vendorExtensions.put("x-commentType", op.returnType); - if (!op.returnTypeIsPrimitive) { + if (op.returnContainer != null && op.returnContainer.equals("array")) { op.vendorExtensions.put("x-commentType", op.returnType + "[]"); } } else { diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Api/PetApiInterface.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Api/PetApiInterface.php index 0d64fe30cf4..864fa5cd80f 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Api/PetApiInterface.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Api/PetApiInterface.php @@ -127,7 +127,7 @@ interface PetApiInterface * @param integer $responseCode The HTTP response code to return * @param array $responseHeaders Additional HTTP headers to return with the response () * - * @return OpenAPI\Server\Model\Pet[] + * @return OpenAPI\Server\Model\Pet * */ public function getPetById($petId, &$responseCode, array &$responseHeaders); @@ -173,7 +173,7 @@ interface PetApiInterface * @param integer $responseCode The HTTP response code to return * @param array $responseHeaders Additional HTTP headers to return with the response () * - * @return OpenAPI\Server\Model\ApiResponse[] + * @return OpenAPI\Server\Model\ApiResponse * */ public function uploadFile($petId, $additionalMetadata = null, UploadedFile $file = null, &$responseCode, array &$responseHeaders); diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Api/StoreApiInterface.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Api/StoreApiInterface.php index e9cb20b9cb4..dc599f03ca7 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Api/StoreApiInterface.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Api/StoreApiInterface.php @@ -87,7 +87,7 @@ interface StoreApiInterface * @param integer $responseCode The HTTP response code to return * @param array $responseHeaders Additional HTTP headers to return with the response () * - * @return OpenAPI\Server\Model\Order[] + * @return OpenAPI\Server\Model\Order * */ public function getOrderById($orderId, &$responseCode, array &$responseHeaders); @@ -101,7 +101,7 @@ interface StoreApiInterface * @param integer $responseCode The HTTP response code to return * @param array $responseHeaders Additional HTTP headers to return with the response () * - * @return OpenAPI\Server\Model\Order[] + * @return OpenAPI\Server\Model\Order * */ public function placeOrder(Order $body, &$responseCode, array &$responseHeaders); diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/Api/UserApiInterface.php b/samples/server/petstore/php-symfony/SymfonyBundle-php/Api/UserApiInterface.php index 54b99510aad..10cc9466220 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/Api/UserApiInterface.php +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/Api/UserApiInterface.php @@ -107,7 +107,7 @@ interface UserApiInterface * @param integer $responseCode The HTTP response code to return * @param array $responseHeaders Additional HTTP headers to return with the response () * - * @return OpenAPI\Server\Model\User[] + * @return OpenAPI\Server\Model\User * */ public function getUserByName($username, &$responseCode, array &$responseHeaders); From ed82aaae978f158b1b6c6b7cb52d3d0ac40f7b36 Mon Sep 17 00:00:00 2001 From: Ivan Aksamentov <9403403+ivan-aksamentov@users.noreply.github.com> Date: Fri, 2 Aug 2019 00:55:58 +0200 Subject: [PATCH 31/75] Fix PHP Symfony OpenAPI 3 sample location. Fixes #3531 (#3532) * Fix PHP Symfony OpenAPI 3.0 sample location * Update PHP Symfony OpenAPI 3.0 sample --- bin/openapi3/php-symfony-petstore.sh | 2 +- .../php-symfony/SymfonyBundle-php/.gitignore | 54 ++ .../.openapi-generator-ignore | 23 + .../.openapi-generator/VERSION | 1 + .../php-symfony/SymfonyBundle-php/.php_cs | 18 + .../php-symfony/SymfonyBundle-php/.travis.yml | 10 + .../SymfonyBundle-php/Api/ApiServer.php | 80 ++ .../SymfonyBundle-php/Api/PetApiInterface.php | 190 +++++ .../Api/StoreApiInterface.php | 108 +++ .../Api/UserApiInterface.php | 166 ++++ .../Controller/Controller.php | 189 +++++ .../Controller/PetController.php | 771 ++++++++++++++++++ .../Controller/StoreController.php | 373 +++++++++ .../Controller/UserController.php | 710 ++++++++++++++++ .../Compiler/OpenAPIServerApiPass.php | 70 ++ .../OpenAPIServerExtension.php | 57 ++ .../SymfonyBundle-php/Model/ApiResponse.php | 154 ++++ .../SymfonyBundle-php/Model/Category.php | 122 +++ .../SymfonyBundle-php/Model/InlineObject.php | 123 +++ .../SymfonyBundle-php/Model/InlineObject1.php | 123 +++ .../SymfonyBundle-php/Model/Order.php | 256 ++++++ .../SymfonyBundle-php/Model/Pet.php | 262 ++++++ .../SymfonyBundle-php/Model/Tag.php | 121 +++ .../SymfonyBundle-php/Model/User.php | 321 ++++++++ .../SymfonyBundle-php/OpenAPIServerBundle.php | 50 ++ .../php-symfony/SymfonyBundle-php/README.md | 190 +++++ .../Resources/config/routing.yml | 145 ++++ .../Resources/config/services.yml | 50 ++ .../Resources/docs/Api/PetApiInterface.md | 520 ++++++++++++ .../Resources/docs/Api/StoreApiInterface.md | 243 ++++++ .../Resources/docs/Api/UserApiInterface.md | 497 +++++++++++ .../Resources/docs/Model/ApiResponse.md | 12 + .../Resources/docs/Model/Category.md | 11 + .../Resources/docs/Model/InlineObject.md | 11 + .../Resources/docs/Model/InlineObject1.md | 11 + .../Resources/docs/Model/Order.md | 15 + .../Resources/docs/Model/Pet.md | 15 + .../Resources/docs/Model/Tag.md | 11 + .../Resources/docs/Model/User.md | 17 + .../Service/JmsSerializer.php | 115 +++ .../Service/SerializerInterface.php | 27 + .../StrictJsonDeserializationVisitor.php | 72 ++ .../Service/SymfonyValidator.php | 20 + .../Service/TypeMismatchException.php | 52 ++ .../Service/ValidatorInterface.php | 25 + .../Tests/Api/PetApiInterfaceTest.php | 217 +++++ .../Tests/Api/StoreApiInterfaceTest.php | 151 ++++ .../Tests/Api/UserApiInterfaceTest.php | 214 +++++ .../SymfonyBundle-php/Tests/AppKernel.php | 21 + .../Tests/Model/ApiResponseTest.php | 101 +++ .../Tests/Model/CategoryTest.php | 94 +++ .../Tests/Model/InlineObject1Test.php | 94 +++ .../Tests/Model/InlineObjectTest.php | 94 +++ .../Tests/Model/OrderTest.php | 122 +++ .../SymfonyBundle-php/Tests/Model/PetTest.php | 122 +++ .../SymfonyBundle-php/Tests/Model/TagTest.php | 94 +++ .../Tests/Model/UserTest.php | 136 +++ .../SymfonyBundle-php/Tests/test_config.yml | 8 + .../SymfonyBundle-php/autoload.php | 54 ++ .../SymfonyBundle-php/composer.json | 38 + .../php-symfony/SymfonyBundle-php/git_push.sh | 52 ++ .../SymfonyBundle-php/phpunit.xml.dist | 24 + .../php-symfony/SymfonyBundle-php/pom.xml | 57 ++ 63 files changed, 8105 insertions(+), 1 deletion(-) create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/.gitignore create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator-ignore create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/.php_cs create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/.travis.yml create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Api/ApiServer.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Api/PetApiInterface.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Api/StoreApiInterface.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Api/UserApiInterface.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Controller/Controller.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Controller/PetController.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Controller/StoreController.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Controller/UserController.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/DependencyInjection/Compiler/OpenAPIServerApiPass.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/DependencyInjection/OpenAPIServerExtension.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/ApiResponse.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/Category.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/InlineObject.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/InlineObject1.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/Order.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/Pet.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/Tag.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/User.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/OpenAPIServerBundle.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/README.md create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Resources/config/routing.yml create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Resources/config/services.yml create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Api/PetApiInterface.md create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Api/StoreApiInterface.md create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Api/UserApiInterface.md create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Model/ApiResponse.md create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Model/Category.md create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Model/InlineObject.md create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Model/InlineObject1.md create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Model/Order.md create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Model/Pet.md create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Model/Tag.md create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Resources/docs/Model/User.md create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Service/JmsSerializer.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Service/SerializerInterface.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Service/StrictJsonDeserializationVisitor.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Service/SymfonyValidator.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Service/TypeMismatchException.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Service/ValidatorInterface.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Tests/Api/PetApiInterfaceTest.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Tests/Api/StoreApiInterfaceTest.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Tests/Api/UserApiInterfaceTest.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Tests/AppKernel.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Tests/Model/ApiResponseTest.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Tests/Model/CategoryTest.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Tests/Model/InlineObject1Test.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Tests/Model/InlineObjectTest.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Tests/Model/OrderTest.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Tests/Model/PetTest.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Tests/Model/TagTest.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Tests/Model/UserTest.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Tests/test_config.yml create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/autoload.php create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/composer.json create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/git_push.sh create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/phpunit.xml.dist create mode 100644 samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/pom.xml diff --git a/bin/openapi3/php-symfony-petstore.sh b/bin/openapi3/php-symfony-petstore.sh index 8e59eea2d40..8c6ce35bd0b 100755 --- a/bin/openapi3/php-symfony-petstore.sh +++ b/bin/openapi3/php-symfony-petstore.sh @@ -23,7 +23,7 @@ if [ ! -d "${APP_DIR}" ]; then fi # Make sure that we are regenerating the sample by removing any existing target directory -TARGET_DIR="$SCRIPT_DIR/../../samples/server/petstore/php-symfony/SymfonyBundle-php" +TARGET_DIR="$SCRIPT_DIR/../../samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php" if [ -d "$TARGET_DIR" ]; then rm -rf $TARGET_DIR fi diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/.gitignore b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/.gitignore new file mode 100644 index 00000000000..20b7b989760 --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/.gitignore @@ -0,0 +1,54 @@ +# ref: https://github.com/github/gitignore/blob/master/Symfony.gitignore + +# Cache and logs (Symfony2) +/app/cache/* +/app/logs/* +!app/cache/.gitkeep +!app/logs/.gitkeep + +# Email spool folder +/app/spool/* + +# Cache, session files and logs (Symfony3) +/var/cache/* +/var/logs/* +/var/sessions/* +!var/cache/.gitkeep +!var/logs/.gitkeep +!var/sessions/.gitkeep + +# Parameters +/app/config/parameters.yml +/app/config/parameters.ini + +# Managed by Composer +/app/bootstrap.php.cache +/var/bootstrap.php.cache +/bin/* +!bin/console +!bin/symfony_requirements +/vendor/ + +# Assets and user uploads +/web/bundles/ +/web/uploads/ + +# PHPUnit +/app/phpunit.xml +/phpunit.xml + +# Build data +/build/ + +# Composer PHAR +/composer.phar + +# Backup entities generated with doctrine:generate:entities command +**/Entity/*~ + +# Embedded web-server pid file +/.web-server-pid + +# From root gitignore +/Tests/cache/ +/Tests/logs/ \ No newline at end of file diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator-ignore b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION new file mode 100644 index 00000000000..83a328a9227 --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/.php_cs b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/.php_cs new file mode 100644 index 00000000000..6b8e23c818a --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/.php_cs @@ -0,0 +1,18 @@ +level(Symfony\CS\FixerInterface::PSR2_LEVEL) + ->setUsingCache(true) + ->fixers( + [ + 'ordered_use', + 'phpdoc_order', + 'short_array_syntax', + 'strict', + 'strict_param' + ] + ) + ->finder( + Symfony\CS\Finder\DefaultFinder::create() + ->in(__DIR__) + ); diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/.travis.yml b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/.travis.yml new file mode 100644 index 00000000000..d77f3825f6f --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/.travis.yml @@ -0,0 +1,10 @@ +language: php +sudo: false +php: + - 5.4 + - 5.5 + - 5.6 + - 7.0 + - hhvm +before_install: "composer install" +script: "vendor/bin/phpunit" diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Api/ApiServer.php b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Api/ApiServer.php new file mode 100644 index 00000000000..f57c47b342c --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Api/ApiServer.php @@ -0,0 +1,80 @@ +apis[$api])) { + throw new \InvalidArgumentException('API has already a handler: '.$api); + } + + $this->apis[$api] = $handler; + } + + /** + * Returns an API handler. + * + * @param string $api An API name of the handle + * @return mixed Returns a handler + * @throws \InvalidArgumentException When no such handler exists + */ + public function getApiHandler($api) + { + if (!isset($this->apis[$api])) { + throw new \InvalidArgumentException('No handler for '.$api.' implemented.'); + } + + return $this->apis[$api]; + } +} diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Api/PetApiInterface.php b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Api/PetApiInterface.php new file mode 100644 index 00000000000..ed2514bff96 --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Api/PetApiInterface.php @@ -0,0 +1,190 @@ +validator = $validator; + } + + public function setSerializer(SerializerInterface $serializer) + { + $this->serializer = $serializer; + } + + public function setApiServer($server) + { + $this->apiServer = $server; + } + + /** + * This will return a response with code 400. Usage example: + * return $this->createBadRequestResponse('Unable to access this page!'); + * + * @param string $message A message + * + * @return Response + */ + public function createBadRequestResponse($message = 'Bad Request.') + { + return new Response($message, 400); + } + + /** + * This will return an error response. Usage example: + * return $this->createErrorResponse(new UnauthorizedHttpException()); + * + * @param HttpException $exception An HTTP exception + * + * @return Response + */ + public function createErrorResponse(HttpException $exception) + { + $statusCode = $exception->getStatusCode(); + $headers = array_merge($exception->getHeaders(), ['Content-Type' => 'application/json']); + + $json = $this->exceptionToArray($exception); + $json['statusCode'] = $statusCode; + + return new Response(json_encode($json, 15, 512), $statusCode, $headers); + } + + /** + * Serializes data to a given type format. + * + * @param mixed $data The data to serialize. + * @param string $class The source data class. + * @param string $format The target serialization format. + * + * @return string A serialized data string. + */ + protected function serialize($data, $format) + { + return $this->serializer->serialize($data, $format); + } + + /** + * Deserializes data from a given type format. + * + * @param string $data The data to deserialize. + * @param string $class The target data class. + * @param string $format The source serialization format. + * + * @return mixed A deserialized data. + */ + protected function deserialize($data, $class, $format) + { + return $this->serializer->deserialize($data, $class, $format); + } + + protected function validate($data, $asserts = null) + { + $errors = $this->validator->validate($data, $asserts); + + if (count($errors) > 0) { + $errorsString = (string)$errors; + return $this->createBadRequestResponse($errorsString); + } + } + + /** + * Converts an exception to a serializable array. + * + * @param \Exception|null $exception + * + * @return array + */ + private function exceptionToArray(\Exception $exception = null) + { + if (null === $exception) { + return null; + } + + if (!$this->container->get('kernel')->isDebug()) { + return [ + 'message' => $exception->getMessage(), + ]; + } + + return [ + 'message' => $exception->getMessage(), + 'type' => get_class($exception), + 'previous' => $this->exceptionToArray($exception->getPrevious()), + ]; + } + + protected function getOutputFormat($accept, array $produced) + { + // Figure out what the client accepts + $accept = preg_split("/[\s,]+/", $accept); + + if (in_array('*/*', $accept) || in_array('application/*', $accept)) { + // Prefer JSON if the client has no preference + if (in_array('application/json', $produced)) { + return 'application/json'; + } + if (in_array('application/xml', $produced)) { + return 'application/xml'; + } + } + + if (in_array('application/json', $accept) && in_array('application/json', $produced)) { + return 'application/json'; + } + + if (in_array('application/xml', $accept) && in_array('application/xml', $produced)) { + return 'application/xml'; + } + + // If we reach this point, we don't have a common ground between server and client + return null; + } +} diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Controller/PetController.php b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Controller/PetController.php new file mode 100644 index 00000000000..c1189b0fd49 --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Controller/PetController.php @@ -0,0 +1,771 @@ +headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0]; + if (!in_array($inputFormat, $consumes)) { + // We can't consume the content that the client is sending us + return new Response('', 415); + } + + // Handle authentication + // Authentication 'petstore_auth' required + // Oauth required + $securitypetstore_auth = $request->headers->get('authorization'); + + // Read out all input parameter values into variables + $pet = $request->getContent(); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + try { + $pet = $this->deserialize($pet, 'OpenAPI\Server\Model\Pet', $inputFormat); + } catch (SerializerRuntimeException $exception) { + return $this->createBadRequestResponse($exception->getMessage()); + } + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("OpenAPI\Server\Model\Pet"); + $asserts[] = new Assert\Valid(); + $response = $this->validate($pet, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + // Set authentication method 'petstore_auth' + $handler->setpetstore_auth($securitypetstore_auth); + + // Make the call to the business logic + $responseCode = 204; + $responseHeaders = []; + $result = $handler->addPet($pet, $responseCode, $responseHeaders); + + // Find default response message + $message = ''; + + // Find a more specific message, if available + switch ($responseCode) { + case 405: + $message = 'Invalid input'; + break; + } + + return new Response( + '', + $responseCode, + array_merge( + $responseHeaders, + [ + 'X-OpenAPI-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation deletePet + * + * Deletes a pet + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function deletePetAction(Request $request, $petId) + { + // Handle authentication + // Authentication 'petstore_auth' required + // Oauth required + $securitypetstore_auth = $request->headers->get('authorization'); + + // Read out all input parameter values into variables + $apiKey = $request->headers->get('api_key'); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + try { + $petId = $this->deserialize($petId, 'int', 'string'); + $apiKey = $this->deserialize($apiKey, 'string', 'string'); + } catch (SerializerRuntimeException $exception) { + return $this->createBadRequestResponse($exception->getMessage()); + } + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("int"); + $response = $this->validate($petId, $asserts); + if ($response instanceof Response) { + return $response; + } + $asserts = []; + $asserts[] = new Assert\Type("string"); + $response = $this->validate($apiKey, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + // Set authentication method 'petstore_auth' + $handler->setpetstore_auth($securitypetstore_auth); + + // Make the call to the business logic + $responseCode = 204; + $responseHeaders = []; + $result = $handler->deletePet($petId, $apiKey, $responseCode, $responseHeaders); + + // Find default response message + $message = ''; + + // Find a more specific message, if available + switch ($responseCode) { + case 400: + $message = 'Invalid pet value'; + break; + } + + return new Response( + '', + $responseCode, + array_merge( + $responseHeaders, + [ + 'X-OpenAPI-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation findPetsByStatus + * + * Finds Pets by status + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function findPetsByStatusAction(Request $request) + { + // Figure out what data format to return to the client + $produces = ['application/xml', 'application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + // Authentication 'petstore_auth' required + // Oauth required + $securitypetstore_auth = $request->headers->get('authorization'); + + // Read out all input parameter values into variables + $status = $request->query->get('status'); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + try { + $status = $this->deserialize($status, 'array', 'string'); + } catch (SerializerRuntimeException $exception) { + return $this->createBadRequestResponse($exception->getMessage()); + } + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\All([ + new Assert\Choice([ "available", "pending", "sold" ]) + ]); + $asserts[] = new Assert\All([ + new Assert\Type("string"), + ]); + $response = $this->validate($status, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + // Set authentication method 'petstore_auth' + $handler->setpetstore_auth($securitypetstore_auth); + + // Make the call to the business logic + $responseCode = 200; + $responseHeaders = []; + $result = $handler->findPetsByStatus($status, $responseCode, $responseHeaders); + + // Find default response message + $message = 'successful operation'; + + // Find a more specific message, if available + switch ($responseCode) { + case 200: + $message = 'successful operation'; + break; + case 400: + $message = 'Invalid status value'; + break; + } + + return new Response( + $result !== null ?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-OpenAPI-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation findPetsByTags + * + * Finds Pets by tags + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function findPetsByTagsAction(Request $request) + { + // Figure out what data format to return to the client + $produces = ['application/xml', 'application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + // Authentication 'petstore_auth' required + // Oauth required + $securitypetstore_auth = $request->headers->get('authorization'); + + // Read out all input parameter values into variables + $tags = $request->query->get('tags'); + $maxCount = $request->query->get('maxCount'); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + try { + $tags = $this->deserialize($tags, 'array', 'string'); + $maxCount = $this->deserialize($maxCount, 'int', 'string'); + } catch (SerializerRuntimeException $exception) { + return $this->createBadRequestResponse($exception->getMessage()); + } + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\All([ + new Assert\Type("string"), + ]); + $response = $this->validate($tags, $asserts); + if ($response instanceof Response) { + return $response; + } + $asserts = []; + $asserts[] = new Assert\Type("int"); + $response = $this->validate($maxCount, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + // Set authentication method 'petstore_auth' + $handler->setpetstore_auth($securitypetstore_auth); + + // Make the call to the business logic + $responseCode = 200; + $responseHeaders = []; + $result = $handler->findPetsByTags($tags, $maxCount, $responseCode, $responseHeaders); + + // Find default response message + $message = 'successful operation'; + + // Find a more specific message, if available + switch ($responseCode) { + case 200: + $message = 'successful operation'; + break; + case 400: + $message = 'Invalid tag value'; + break; + } + + return new Response( + $result !== null ?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-OpenAPI-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation getPetById + * + * Find pet by ID + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function getPetByIdAction(Request $request, $petId) + { + // Figure out what data format to return to the client + $produces = ['application/xml', 'application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + // Authentication 'api_key' required + // Set key with prefix in header + $securityapi_key = $request->headers->get('api_key'); + + // Read out all input parameter values into variables + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + try { + $petId = $this->deserialize($petId, 'int', 'string'); + } catch (SerializerRuntimeException $exception) { + return $this->createBadRequestResponse($exception->getMessage()); + } + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("int"); + $response = $this->validate($petId, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + // Set authentication method 'api_key' + $handler->setapi_key($securityapi_key); + + // Make the call to the business logic + $responseCode = 200; + $responseHeaders = []; + $result = $handler->getPetById($petId, $responseCode, $responseHeaders); + + // Find default response message + $message = 'successful operation'; + + // Find a more specific message, if available + switch ($responseCode) { + case 200: + $message = 'successful operation'; + break; + case 400: + $message = 'Invalid ID supplied'; + break; + case 404: + $message = 'Pet not found'; + break; + } + + return new Response( + $result !== null ?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-OpenAPI-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation updatePet + * + * Update an existing pet + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function updatePetAction(Request $request) + { + // Make sure that the client is providing something that we can consume + $consumes = ['application/json', 'application/xml']; + $inputFormat = $request->headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0]; + if (!in_array($inputFormat, $consumes)) { + // We can't consume the content that the client is sending us + return new Response('', 415); + } + + // Handle authentication + // Authentication 'petstore_auth' required + // Oauth required + $securitypetstore_auth = $request->headers->get('authorization'); + + // Read out all input parameter values into variables + $pet = $request->getContent(); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + try { + $pet = $this->deserialize($pet, 'OpenAPI\Server\Model\Pet', $inputFormat); + } catch (SerializerRuntimeException $exception) { + return $this->createBadRequestResponse($exception->getMessage()); + } + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("OpenAPI\Server\Model\Pet"); + $asserts[] = new Assert\Valid(); + $response = $this->validate($pet, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + // Set authentication method 'petstore_auth' + $handler->setpetstore_auth($securitypetstore_auth); + + // Make the call to the business logic + $responseCode = 204; + $responseHeaders = []; + $result = $handler->updatePet($pet, $responseCode, $responseHeaders); + + // Find default response message + $message = ''; + + // Find a more specific message, if available + switch ($responseCode) { + case 400: + $message = 'Invalid ID supplied'; + break; + case 404: + $message = 'Pet not found'; + break; + case 405: + $message = 'Validation exception'; + break; + } + + return new Response( + '', + $responseCode, + array_merge( + $responseHeaders, + [ + 'X-OpenAPI-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation updatePetWithForm + * + * Updates a pet in the store with form data + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function updatePetWithFormAction(Request $request, $petId) + { + // Handle authentication + // Authentication 'petstore_auth' required + // Oauth required + $securitypetstore_auth = $request->headers->get('authorization'); + + // Read out all input parameter values into variables + $name = $request->request->get('name'); + $status = $request->request->get('status'); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + try { + $petId = $this->deserialize($petId, 'int', 'string'); + $name = $this->deserialize($name, 'string', 'string'); + $status = $this->deserialize($status, 'string', 'string'); + } catch (SerializerRuntimeException $exception) { + return $this->createBadRequestResponse($exception->getMessage()); + } + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("int"); + $response = $this->validate($petId, $asserts); + if ($response instanceof Response) { + return $response; + } + $asserts = []; + $asserts[] = new Assert\Type("string"); + $response = $this->validate($name, $asserts); + if ($response instanceof Response) { + return $response; + } + $asserts = []; + $asserts[] = new Assert\Type("string"); + $response = $this->validate($status, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + // Set authentication method 'petstore_auth' + $handler->setpetstore_auth($securitypetstore_auth); + + // Make the call to the business logic + $responseCode = 204; + $responseHeaders = []; + $result = $handler->updatePetWithForm($petId, $name, $status, $responseCode, $responseHeaders); + + // Find default response message + $message = ''; + + // Find a more specific message, if available + switch ($responseCode) { + case 405: + $message = 'Invalid input'; + break; + } + + return new Response( + '', + $responseCode, + array_merge( + $responseHeaders, + [ + 'X-OpenAPI-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation uploadFile + * + * uploads an image + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function uploadFileAction(Request $request, $petId) + { + // Figure out what data format to return to the client + $produces = ['application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + // Authentication 'petstore_auth' required + // Oauth required + $securitypetstore_auth = $request->headers->get('authorization'); + + // Read out all input parameter values into variables + $additionalMetadata = $request->request->get('additionalMetadata'); + $file = $request->files->get('file'); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + try { + $petId = $this->deserialize($petId, 'int', 'string'); + $additionalMetadata = $this->deserialize($additionalMetadata, 'string', 'string'); + } catch (SerializerRuntimeException $exception) { + return $this->createBadRequestResponse($exception->getMessage()); + } + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("int"); + $response = $this->validate($petId, $asserts); + if ($response instanceof Response) { + return $response; + } + $asserts = []; + $asserts[] = new Assert\Type("string"); + $response = $this->validate($additionalMetadata, $asserts); + if ($response instanceof Response) { + return $response; + } + $asserts = []; + $asserts[] = new Assert\File(); + $response = $this->validate($file, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + // Set authentication method 'petstore_auth' + $handler->setpetstore_auth($securitypetstore_auth); + + // Make the call to the business logic + $responseCode = 200; + $responseHeaders = []; + $result = $handler->uploadFile($petId, $additionalMetadata, $file, $responseCode, $responseHeaders); + + // Find default response message + $message = 'successful operation'; + + // Find a more specific message, if available + switch ($responseCode) { + case 200: + $message = 'successful operation'; + break; + } + + return new Response( + $result !== null ?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-OpenAPI-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Returns the handler for this API controller. + * @return PetApiInterface + */ + public function getApiHandler() + { + return $this->apiServer->getApiHandler('pet'); + } +} diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Controller/StoreController.php b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Controller/StoreController.php new file mode 100644 index 00000000000..bb80ccb66d5 --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Controller/StoreController.php @@ -0,0 +1,373 @@ +deserialize($orderId, 'string', 'string'); + } catch (SerializerRuntimeException $exception) { + return $this->createBadRequestResponse($exception->getMessage()); + } + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("string"); + $response = $this->validate($orderId, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + + // Make the call to the business logic + $responseCode = 204; + $responseHeaders = []; + $result = $handler->deleteOrder($orderId, $responseCode, $responseHeaders); + + // Find default response message + $message = ''; + + // Find a more specific message, if available + switch ($responseCode) { + case 400: + $message = 'Invalid ID supplied'; + break; + case 404: + $message = 'Order not found'; + break; + } + + return new Response( + '', + $responseCode, + array_merge( + $responseHeaders, + [ + 'X-OpenAPI-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation getInventory + * + * Returns pet inventories by status + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function getInventoryAction(Request $request) + { + // Figure out what data format to return to the client + $produces = ['application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + // Authentication 'api_key' required + // Set key with prefix in header + $securityapi_key = $request->headers->get('api_key'); + + // Read out all input parameter values into variables + + // Use the default value if no value was provided + + // Validate the input values + + + try { + $handler = $this->getApiHandler(); + + // Set authentication method 'api_key' + $handler->setapi_key($securityapi_key); + + // Make the call to the business logic + $responseCode = 200; + $responseHeaders = []; + $result = $handler->getInventory($responseCode, $responseHeaders); + + // Find default response message + $message = 'successful operation'; + + // Find a more specific message, if available + switch ($responseCode) { + case 200: + $message = 'successful operation'; + break; + } + + return new Response( + $result !== null ?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-OpenAPI-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation getOrderById + * + * Find purchase order by ID + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function getOrderByIdAction(Request $request, $orderId) + { + // Figure out what data format to return to the client + $produces = ['application/xml', 'application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + + // Read out all input parameter values into variables + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + try { + $orderId = $this->deserialize($orderId, 'int', 'string'); + } catch (SerializerRuntimeException $exception) { + return $this->createBadRequestResponse($exception->getMessage()); + } + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("int"); + $asserts[] = new Assert\GreaterThanOrEqual(1); + $asserts[] = new Assert\LessThanOrEqual(1); + $response = $this->validate($orderId, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + + // Make the call to the business logic + $responseCode = 200; + $responseHeaders = []; + $result = $handler->getOrderById($orderId, $responseCode, $responseHeaders); + + // Find default response message + $message = 'successful operation'; + + // Find a more specific message, if available + switch ($responseCode) { + case 200: + $message = 'successful operation'; + break; + case 400: + $message = 'Invalid ID supplied'; + break; + case 404: + $message = 'Order not found'; + break; + } + + return new Response( + $result !== null ?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-OpenAPI-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation placeOrder + * + * Place an order for a pet + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function placeOrderAction(Request $request) + { + // Make sure that the client is providing something that we can consume + $consumes = ['application/json']; + $inputFormat = $request->headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0]; + if (!in_array($inputFormat, $consumes)) { + // We can't consume the content that the client is sending us + return new Response('', 415); + } + + // Figure out what data format to return to the client + $produces = ['application/xml', 'application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + + // Read out all input parameter values into variables + $order = $request->getContent(); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + try { + $order = $this->deserialize($order, 'OpenAPI\Server\Model\Order', $inputFormat); + } catch (SerializerRuntimeException $exception) { + return $this->createBadRequestResponse($exception->getMessage()); + } + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("OpenAPI\Server\Model\Order"); + $asserts[] = new Assert\Valid(); + $response = $this->validate($order, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + + // Make the call to the business logic + $responseCode = 200; + $responseHeaders = []; + $result = $handler->placeOrder($order, $responseCode, $responseHeaders); + + // Find default response message + $message = 'successful operation'; + + // Find a more specific message, if available + switch ($responseCode) { + case 200: + $message = 'successful operation'; + break; + case 400: + $message = 'Invalid Order'; + break; + } + + return new Response( + $result !== null ?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-OpenAPI-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Returns the handler for this API controller. + * @return StoreApiInterface + */ + public function getApiHandler() + { + return $this->apiServer->getApiHandler('store'); + } +} diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Controller/UserController.php b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Controller/UserController.php new file mode 100644 index 00000000000..736c755ded2 --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Controller/UserController.php @@ -0,0 +1,710 @@ +headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0]; + if (!in_array($inputFormat, $consumes)) { + // We can't consume the content that the client is sending us + return new Response('', 415); + } + + // Handle authentication + // Authentication 'auth_cookie' required + // Set key with prefix in cookies + $securityauth_cookie = $request->cookies->get('AUTH_KEY'); + + // Read out all input parameter values into variables + $user = $request->getContent(); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + try { + $user = $this->deserialize($user, 'OpenAPI\Server\Model\User', $inputFormat); + } catch (SerializerRuntimeException $exception) { + return $this->createBadRequestResponse($exception->getMessage()); + } + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("OpenAPI\Server\Model\User"); + $asserts[] = new Assert\Valid(); + $response = $this->validate($user, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + // Set authentication method 'auth_cookie' + $handler->setauth_cookie($securityauth_cookie); + + // Make the call to the business logic + $responseCode = 204; + $responseHeaders = []; + $result = $handler->createUser($user, $responseCode, $responseHeaders); + + // Find default response message + $message = 'successful operation'; + + // Find a more specific message, if available + switch ($responseCode) { + case 0: + $message = 'successful operation'; + break; + } + + return new Response( + '', + $responseCode, + array_merge( + $responseHeaders, + [ + 'X-OpenAPI-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation createUsersWithArrayInput + * + * Creates list of users with given input array + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function createUsersWithArrayInputAction(Request $request) + { + // Make sure that the client is providing something that we can consume + $consumes = ['application/json']; + $inputFormat = $request->headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0]; + if (!in_array($inputFormat, $consumes)) { + // We can't consume the content that the client is sending us + return new Response('', 415); + } + + // Handle authentication + // Authentication 'auth_cookie' required + // Set key with prefix in cookies + $securityauth_cookie = $request->cookies->get('AUTH_KEY'); + + // Read out all input parameter values into variables + $user = $request->getContent(); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + try { + $user = $this->deserialize($user, 'array', $inputFormat); + } catch (SerializerRuntimeException $exception) { + return $this->createBadRequestResponse($exception->getMessage()); + } + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\All([ + new Assert\Type("OpenAPI\Server\Model\User"), + new Assert\Valid(), + ]); + $response = $this->validate($user, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + // Set authentication method 'auth_cookie' + $handler->setauth_cookie($securityauth_cookie); + + // Make the call to the business logic + $responseCode = 204; + $responseHeaders = []; + $result = $handler->createUsersWithArrayInput($user, $responseCode, $responseHeaders); + + // Find default response message + $message = 'successful operation'; + + // Find a more specific message, if available + switch ($responseCode) { + case 0: + $message = 'successful operation'; + break; + } + + return new Response( + '', + $responseCode, + array_merge( + $responseHeaders, + [ + 'X-OpenAPI-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation createUsersWithListInput + * + * Creates list of users with given input array + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function createUsersWithListInputAction(Request $request) + { + // Make sure that the client is providing something that we can consume + $consumes = ['application/json']; + $inputFormat = $request->headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0]; + if (!in_array($inputFormat, $consumes)) { + // We can't consume the content that the client is sending us + return new Response('', 415); + } + + // Handle authentication + // Authentication 'auth_cookie' required + // Set key with prefix in cookies + $securityauth_cookie = $request->cookies->get('AUTH_KEY'); + + // Read out all input parameter values into variables + $user = $request->getContent(); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + try { + $user = $this->deserialize($user, 'array', $inputFormat); + } catch (SerializerRuntimeException $exception) { + return $this->createBadRequestResponse($exception->getMessage()); + } + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\All([ + new Assert\Type("OpenAPI\Server\Model\User"), + new Assert\Valid(), + ]); + $response = $this->validate($user, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + // Set authentication method 'auth_cookie' + $handler->setauth_cookie($securityauth_cookie); + + // Make the call to the business logic + $responseCode = 204; + $responseHeaders = []; + $result = $handler->createUsersWithListInput($user, $responseCode, $responseHeaders); + + // Find default response message + $message = 'successful operation'; + + // Find a more specific message, if available + switch ($responseCode) { + case 0: + $message = 'successful operation'; + break; + } + + return new Response( + '', + $responseCode, + array_merge( + $responseHeaders, + [ + 'X-OpenAPI-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation deleteUser + * + * Delete user + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function deleteUserAction(Request $request, $username) + { + // Handle authentication + // Authentication 'auth_cookie' required + // Set key with prefix in cookies + $securityauth_cookie = $request->cookies->get('AUTH_KEY'); + + // Read out all input parameter values into variables + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + try { + $username = $this->deserialize($username, 'string', 'string'); + } catch (SerializerRuntimeException $exception) { + return $this->createBadRequestResponse($exception->getMessage()); + } + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("string"); + $response = $this->validate($username, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + // Set authentication method 'auth_cookie' + $handler->setauth_cookie($securityauth_cookie); + + // Make the call to the business logic + $responseCode = 204; + $responseHeaders = []; + $result = $handler->deleteUser($username, $responseCode, $responseHeaders); + + // Find default response message + $message = ''; + + // Find a more specific message, if available + switch ($responseCode) { + case 400: + $message = 'Invalid username supplied'; + break; + case 404: + $message = 'User not found'; + break; + } + + return new Response( + '', + $responseCode, + array_merge( + $responseHeaders, + [ + 'X-OpenAPI-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation getUserByName + * + * Get user by user name + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function getUserByNameAction(Request $request, $username) + { + // Figure out what data format to return to the client + $produces = ['application/xml', 'application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + + // Read out all input parameter values into variables + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + try { + $username = $this->deserialize($username, 'string', 'string'); + } catch (SerializerRuntimeException $exception) { + return $this->createBadRequestResponse($exception->getMessage()); + } + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("string"); + $response = $this->validate($username, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + + // Make the call to the business logic + $responseCode = 200; + $responseHeaders = []; + $result = $handler->getUserByName($username, $responseCode, $responseHeaders); + + // Find default response message + $message = 'successful operation'; + + // Find a more specific message, if available + switch ($responseCode) { + case 200: + $message = 'successful operation'; + break; + case 400: + $message = 'Invalid username supplied'; + break; + case 404: + $message = 'User not found'; + break; + } + + return new Response( + $result !== null ?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-OpenAPI-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation loginUser + * + * Logs user into the system + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function loginUserAction(Request $request) + { + // Figure out what data format to return to the client + $produces = ['application/xml', 'application/json']; + // Figure out what the client accepts + $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*'; + $responseFormat = $this->getOutputFormat($clientAccepts, $produces); + if ($responseFormat === null) { + return new Response('', 406); + } + + // Handle authentication + + // Read out all input parameter values into variables + $username = $request->query->get('username'); + $password = $request->query->get('password'); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + try { + $username = $this->deserialize($username, 'string', 'string'); + $password = $this->deserialize($password, 'string', 'string'); + } catch (SerializerRuntimeException $exception) { + return $this->createBadRequestResponse($exception->getMessage()); + } + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("string"); + $asserts[] = new Assert\Regex("/^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$/"); + $response = $this->validate($username, $asserts); + if ($response instanceof Response) { + return $response; + } + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("string"); + $response = $this->validate($password, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + + // Make the call to the business logic + $responseCode = 200; + $responseHeaders = []; + $result = $handler->loginUser($username, $password, $responseCode, $responseHeaders); + + // Find default response message + $message = 'successful operation'; + + // Find a more specific message, if available + switch ($responseCode) { + case 200: + $message = 'successful operation'; + break; + case 400: + $message = 'Invalid username/password supplied'; + break; + } + + return new Response( + $result !== null ?$this->serialize($result, $responseFormat):'', + $responseCode, + array_merge( + $responseHeaders, + [ + 'Content-Type' => $responseFormat, + 'X-OpenAPI-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation logoutUser + * + * Logs out current logged in user session + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function logoutUserAction(Request $request) + { + // Handle authentication + // Authentication 'auth_cookie' required + // Set key with prefix in cookies + $securityauth_cookie = $request->cookies->get('AUTH_KEY'); + + // Read out all input parameter values into variables + + // Use the default value if no value was provided + + // Validate the input values + + + try { + $handler = $this->getApiHandler(); + + // Set authentication method 'auth_cookie' + $handler->setauth_cookie($securityauth_cookie); + + // Make the call to the business logic + $responseCode = 204; + $responseHeaders = []; + $result = $handler->logoutUser($responseCode, $responseHeaders); + + // Find default response message + $message = 'successful operation'; + + // Find a more specific message, if available + switch ($responseCode) { + case 0: + $message = 'successful operation'; + break; + } + + return new Response( + '', + $responseCode, + array_merge( + $responseHeaders, + [ + 'X-OpenAPI-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Operation updateUser + * + * Updated user + * + * @param Request $request The Symfony request to handle. + * @return Response The Symfony response. + */ + public function updateUserAction(Request $request, $username) + { + // Make sure that the client is providing something that we can consume + $consumes = ['application/json']; + $inputFormat = $request->headers->has('Content-Type')?$request->headers->get('Content-Type'):$consumes[0]; + if (!in_array($inputFormat, $consumes)) { + // We can't consume the content that the client is sending us + return new Response('', 415); + } + + // Handle authentication + // Authentication 'auth_cookie' required + // Set key with prefix in cookies + $securityauth_cookie = $request->cookies->get('AUTH_KEY'); + + // Read out all input parameter values into variables + $user = $request->getContent(); + + // Use the default value if no value was provided + + // Deserialize the input values that needs it + try { + $username = $this->deserialize($username, 'string', 'string'); + $user = $this->deserialize($user, 'OpenAPI\Server\Model\User', $inputFormat); + } catch (SerializerRuntimeException $exception) { + return $this->createBadRequestResponse($exception->getMessage()); + } + + // Validate the input values + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("string"); + $response = $this->validate($username, $asserts); + if ($response instanceof Response) { + return $response; + } + $asserts = []; + $asserts[] = new Assert\NotNull(); + $asserts[] = new Assert\Type("OpenAPI\Server\Model\User"); + $asserts[] = new Assert\Valid(); + $response = $this->validate($user, $asserts); + if ($response instanceof Response) { + return $response; + } + + + try { + $handler = $this->getApiHandler(); + + // Set authentication method 'auth_cookie' + $handler->setauth_cookie($securityauth_cookie); + + // Make the call to the business logic + $responseCode = 204; + $responseHeaders = []; + $result = $handler->updateUser($username, $user, $responseCode, $responseHeaders); + + // Find default response message + $message = ''; + + // Find a more specific message, if available + switch ($responseCode) { + case 400: + $message = 'Invalid user supplied'; + break; + case 404: + $message = 'User not found'; + break; + } + + return new Response( + '', + $responseCode, + array_merge( + $responseHeaders, + [ + 'X-OpenAPI-Message' => $message + ] + ) + ); + } catch (Exception $fallthrough) { + return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); + } + } + + /** + * Returns the handler for this API controller. + * @return UserApiInterface + */ + public function getApiHandler() + { + return $this->apiServer->getApiHandler('user'); + } +} diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/DependencyInjection/Compiler/OpenAPIServerApiPass.php b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/DependencyInjection/Compiler/OpenAPIServerApiPass.php new file mode 100644 index 00000000000..62d9bb86716 --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/DependencyInjection/Compiler/OpenAPIServerApiPass.php @@ -0,0 +1,70 @@ +has('open_api_server.api.api_server')) { + return; + } + + $definition = $container->findDefinition('open_api_server.api.api_server'); + + // find all service IDs with the open_api_server.api tag + $taggedServices = $container->findTaggedServiceIds('open_api_server.api'); + + foreach ($taggedServices as $id => $tags) { + foreach ($tags as $tag) { + // add the transport service to the ChainTransport service + $definition->addMethodCall('addApiHandler', [$tag['api'], new Reference($id)]); + } + } + } +} diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/DependencyInjection/OpenAPIServerExtension.php b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/DependencyInjection/OpenAPIServerExtension.php new file mode 100644 index 00000000000..ca829865f97 --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/DependencyInjection/OpenAPIServerExtension.php @@ -0,0 +1,57 @@ +load('services.yml'); + } + + public function getAlias() + { + return 'open_api_server'; + } +} diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/ApiResponse.php b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/ApiResponse.php new file mode 100644 index 00000000000..3c541cc76f9 --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/ApiResponse.php @@ -0,0 +1,154 @@ +code = isset($data['code']) ? $data['code'] : null; + $this->type = isset($data['type']) ? $data['type'] : null; + $this->message = isset($data['message']) ? $data['message'] : null; + } + + /** + * Gets code. + * + * @return int|null + */ + public function getCode() + { + return $this->code; + } + + /** + * Sets code. + * + * @param int|null $code + * + * @return $this + */ + public function setCode($code = null) + { + $this->code = $code; + + return $this; + } + + /** + * Gets type. + * + * @return string|null + */ + public function getType() + { + return $this->type; + } + + /** + * Sets type. + * + * @param string|null $type + * + * @return $this + */ + public function setType($type = null) + { + $this->type = $type; + + return $this; + } + + /** + * Gets message. + * + * @return string|null + */ + public function getMessage() + { + return $this->message; + } + + /** + * Sets message. + * + * @param string|null $message + * + * @return $this + */ + public function setMessage($message = null) + { + $this->message = $message; + + return $this; + } +} + + diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/Category.php b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/Category.php new file mode 100644 index 00000000000..cbaceb8d16e --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/Category.php @@ -0,0 +1,122 @@ +id = isset($data['id']) ? $data['id'] : null; + $this->name = isset($data['name']) ? $data['name'] : null; + } + + /** + * Gets id. + * + * @return int|null + */ + public function getId() + { + return $this->id; + } + + /** + * Sets id. + * + * @param int|null $id + * + * @return $this + */ + public function setId($id = null) + { + $this->id = $id; + + return $this; + } + + /** + * Gets name. + * + * @return string|null + */ + public function getName() + { + return $this->name; + } + + /** + * Sets name. + * + * @param string|null $name + * + * @return $this + */ + public function setName($name = null) + { + $this->name = $name; + + return $this; + } +} + + diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/InlineObject.php b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/InlineObject.php new file mode 100644 index 00000000000..3f5e8ff7339 --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/InlineObject.php @@ -0,0 +1,123 @@ +name = isset($data['name']) ? $data['name'] : null; + $this->status = isset($data['status']) ? $data['status'] : null; + } + + /** + * Gets name. + * + * @return string|null + */ + public function getName() + { + return $this->name; + } + + /** + * Sets name. + * + * @param string|null $name Updated name of the pet + * + * @return $this + */ + public function setName($name = null) + { + $this->name = $name; + + return $this; + } + + /** + * Gets status. + * + * @return string|null + */ + public function getStatus() + { + return $this->status; + } + + /** + * Sets status. + * + * @param string|null $status Updated status of the pet + * + * @return $this + */ + public function setStatus($status = null) + { + $this->status = $status; + + return $this; + } +} + + diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/InlineObject1.php b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/InlineObject1.php new file mode 100644 index 00000000000..577331c4675 --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/InlineObject1.php @@ -0,0 +1,123 @@ +additionalMetadata = isset($data['additionalMetadata']) ? $data['additionalMetadata'] : null; + $this->file = isset($data['file']) ? $data['file'] : null; + } + + /** + * Gets additionalMetadata. + * + * @return string|null + */ + public function getAdditionalMetadata() + { + return $this->additionalMetadata; + } + + /** + * Sets additionalMetadata. + * + * @param string|null $additionalMetadata Additional data to pass to server + * + * @return $this + */ + public function setAdditionalMetadata($additionalMetadata = null) + { + $this->additionalMetadata = $additionalMetadata; + + return $this; + } + + /** + * Gets file. + * + * @return UploadedFile|null + */ + public function getFile() + { + return $this->file; + } + + /** + * Sets file. + * + * @param UploadedFile|null $file file to upload + * + * @return $this + */ + public function setFile(UploadedFile $file = null) + { + $this->file = $file; + + return $this; + } +} + + diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/Order.php b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/Order.php new file mode 100644 index 00000000000..2f8ecf8c140 --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/Order.php @@ -0,0 +1,256 @@ +id = isset($data['id']) ? $data['id'] : null; + $this->petId = isset($data['petId']) ? $data['petId'] : null; + $this->quantity = isset($data['quantity']) ? $data['quantity'] : null; + $this->shipDate = isset($data['shipDate']) ? $data['shipDate'] : null; + $this->status = isset($data['status']) ? $data['status'] : null; + $this->complete = isset($data['complete']) ? $data['complete'] : false; + } + + /** + * Gets id. + * + * @return int|null + */ + public function getId() + { + return $this->id; + } + + /** + * Sets id. + * + * @param int|null $id + * + * @return $this + */ + public function setId($id = null) + { + $this->id = $id; + + return $this; + } + + /** + * Gets petId. + * + * @return int|null + */ + public function getPetId() + { + return $this->petId; + } + + /** + * Sets petId. + * + * @param int|null $petId + * + * @return $this + */ + public function setPetId($petId = null) + { + $this->petId = $petId; + + return $this; + } + + /** + * Gets quantity. + * + * @return int|null + */ + public function getQuantity() + { + return $this->quantity; + } + + /** + * Sets quantity. + * + * @param int|null $quantity + * + * @return $this + */ + public function setQuantity($quantity = null) + { + $this->quantity = $quantity; + + return $this; + } + + /** + * Gets shipDate. + * + * @return \DateTime|null + */ + public function getShipDate() + { + return $this->shipDate; + } + + /** + * Sets shipDate. + * + * @param \DateTime|null $shipDate + * + * @return $this + */ + public function setShipDate(\DateTime $shipDate = null) + { + $this->shipDate = $shipDate; + + return $this; + } + + /** + * Gets status. + * + * @return string|null + */ + public function getStatus() + { + return $this->status; + } + + /** + * Sets status. + * + * @param string|null $status Order Status + * + * @return $this + */ + public function setStatus($status = null) + { + $this->status = $status; + + return $this; + } + + /** + * Gets complete. + * + * @return bool|null + */ + public function isComplete() + { + return $this->complete; + } + + /** + * Sets complete. + * + * @param bool|null $complete + * + * @return $this + */ + public function setComplete($complete = null) + { + $this->complete = $complete; + + return $this; + } +} + + diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/Pet.php b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/Pet.php new file mode 100644 index 00000000000..7c627be0439 --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/Pet.php @@ -0,0 +1,262 @@ +") + */ + protected $photoUrls; + + /** + * @var OpenAPI\Server\Model\Tag[]|null + * @SerializedName("tags") + * @Assert\All({ + * @Assert\Type("OpenAPI\Server\Model\Tag") + * }) + * @Type("array") + */ + protected $tags; + + /** + * pet status in the store + * + * @var string|null + * @SerializedName("status") + * @Assert\Choice({ "available", "pending", "sold" }) + * @Assert\Type("string") + * @Type("string") + */ + protected $status; + + /** + * Constructor + * @param mixed[] $data Associated array of property values initializing the model + */ + public function __construct(array $data = null) + { + $this->id = isset($data['id']) ? $data['id'] : null; + $this->category = isset($data['category']) ? $data['category'] : null; + $this->name = isset($data['name']) ? $data['name'] : null; + $this->photoUrls = isset($data['photoUrls']) ? $data['photoUrls'] : null; + $this->tags = isset($data['tags']) ? $data['tags'] : null; + $this->status = isset($data['status']) ? $data['status'] : null; + } + + /** + * Gets id. + * + * @return int|null + */ + public function getId() + { + return $this->id; + } + + /** + * Sets id. + * + * @param int|null $id + * + * @return $this + */ + public function setId($id = null) + { + $this->id = $id; + + return $this; + } + + /** + * Gets category. + * + * @return OpenAPI\Server\Model\Category|null + */ + public function getCategory() + { + return $this->category; + } + + /** + * Sets category. + * + * @param OpenAPI\Server\Model\Category|null $category + * + * @return $this + */ + public function setCategory(Category $category = null) + { + $this->category = $category; + + return $this; + } + + /** + * Gets name. + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Sets name. + * + * @param string $name + * + * @return $this + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * Gets photoUrls. + * + * @return string[] + */ + public function getPhotoUrls() + { + return $this->photoUrls; + } + + /** + * Sets photoUrls. + * + * @param string[] $photoUrls + * + * @return $this + */ + public function setPhotoUrls(array $photoUrls) + { + $this->photoUrls = $photoUrls; + + return $this; + } + + /** + * Gets tags. + * + * @return OpenAPI\Server\Model\Tag[]|null + */ + public function getTags() + { + return $this->tags; + } + + /** + * Sets tags. + * + * @param OpenAPI\Server\Model\Tag[]|null $tags + * + * @return $this + */ + public function setTags(array $tags = null) + { + $this->tags = $tags; + + return $this; + } + + /** + * Gets status. + * + * @return string|null + */ + public function getStatus() + { + return $this->status; + } + + /** + * Sets status. + * + * @param string|null $status pet status in the store + * + * @return $this + */ + public function setStatus($status = null) + { + $this->status = $status; + + return $this; + } +} + + diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/Tag.php b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/Tag.php new file mode 100644 index 00000000000..404309c8261 --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/Tag.php @@ -0,0 +1,121 @@ +id = isset($data['id']) ? $data['id'] : null; + $this->name = isset($data['name']) ? $data['name'] : null; + } + + /** + * Gets id. + * + * @return int|null + */ + public function getId() + { + return $this->id; + } + + /** + * Sets id. + * + * @param int|null $id + * + * @return $this + */ + public function setId($id = null) + { + $this->id = $id; + + return $this; + } + + /** + * Gets name. + * + * @return string|null + */ + public function getName() + { + return $this->name; + } + + /** + * Sets name. + * + * @param string|null $name + * + * @return $this + */ + public function setName($name = null) + { + $this->name = $name; + + return $this; + } +} + + diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/User.php b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/User.php new file mode 100644 index 00000000000..b79d83bf0c2 --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Model/User.php @@ -0,0 +1,321 @@ +id = isset($data['id']) ? $data['id'] : null; + $this->username = isset($data['username']) ? $data['username'] : null; + $this->firstName = isset($data['firstName']) ? $data['firstName'] : null; + $this->lastName = isset($data['lastName']) ? $data['lastName'] : null; + $this->email = isset($data['email']) ? $data['email'] : null; + $this->password = isset($data['password']) ? $data['password'] : null; + $this->phone = isset($data['phone']) ? $data['phone'] : null; + $this->userStatus = isset($data['userStatus']) ? $data['userStatus'] : null; + } + + /** + * Gets id. + * + * @return int|null + */ + public function getId() + { + return $this->id; + } + + /** + * Sets id. + * + * @param int|null $id + * + * @return $this + */ + public function setId($id = null) + { + $this->id = $id; + + return $this; + } + + /** + * Gets username. + * + * @return string|null + */ + public function getUsername() + { + return $this->username; + } + + /** + * Sets username. + * + * @param string|null $username + * + * @return $this + */ + public function setUsername($username = null) + { + $this->username = $username; + + return $this; + } + + /** + * Gets firstName. + * + * @return string|null + */ + public function getFirstName() + { + return $this->firstName; + } + + /** + * Sets firstName. + * + * @param string|null $firstName + * + * @return $this + */ + public function setFirstName($firstName = null) + { + $this->firstName = $firstName; + + return $this; + } + + /** + * Gets lastName. + * + * @return string|null + */ + public function getLastName() + { + return $this->lastName; + } + + /** + * Sets lastName. + * + * @param string|null $lastName + * + * @return $this + */ + public function setLastName($lastName = null) + { + $this->lastName = $lastName; + + return $this; + } + + /** + * Gets email. + * + * @return string|null + */ + public function getEmail() + { + return $this->email; + } + + /** + * Sets email. + * + * @param string|null $email + * + * @return $this + */ + public function setEmail($email = null) + { + $this->email = $email; + + return $this; + } + + /** + * Gets password. + * + * @return string|null + */ + public function getPassword() + { + return $this->password; + } + + /** + * Sets password. + * + * @param string|null $password + * + * @return $this + */ + public function setPassword($password = null) + { + $this->password = $password; + + return $this; + } + + /** + * Gets phone. + * + * @return string|null + */ + public function getPhone() + { + return $this->phone; + } + + /** + * Sets phone. + * + * @param string|null $phone + * + * @return $this + */ + public function setPhone($phone = null) + { + $this->phone = $phone; + + return $this; + } + + /** + * Gets userStatus. + * + * @return int|null + */ + public function getUserStatus() + { + return $this->userStatus; + } + + /** + * Sets userStatus. + * + * @param int|null $userStatus User Status + * + * @return $this + */ + public function setUserStatus($userStatus = null) + { + $this->userStatus = $userStatus; + + return $this; + } +} + + diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/OpenAPIServerBundle.php b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/OpenAPIServerBundle.php new file mode 100644 index 00000000000..ff92f1c78a4 --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/OpenAPIServerBundle.php @@ -0,0 +1,50 @@ +addCompilerPass(new OpenAPIServerApiPass()); + } +} diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/README.md b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/README.md new file mode 100644 index 00000000000..8bf887799e0 --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/README.md @@ -0,0 +1,190 @@ +# OpenAPIServer +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + +This [Symfony](https://symfony.com/) bundle is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- Build package: org.openapitools.codegen.languages.PhpSymfonyServerCodegen + +## Requirements + +PHP 5.4.0 and later + +## Installation & Usage + +To install the dependencies via [Composer](http://getcomposer.org/), add the following repository to `composer.json` of your Symfony project: + +```json +{ + "repositories": [{ + "type": "path", + "url": "//Path to your generated openapi bundle" + }], +} +``` + +Then run: + +``` +composer require GIT_USER_ID/GIT_REPO_ID:dev-master +``` + +to add the generated openapi bundle as a dependency. + +## Tests + +To run the unit tests for the generated bundle, first navigate to the directory containing the code, then run the following commands: + +``` +composer install +./vendor/bin/phpunit +``` + + +## Getting Started + +Step 1: Please follow the [installation procedure](#installation--usage) first. + +Step 2: Enable the bundle in the kernel: + +```php + addPet($pet) + +Add a new pet to the store + +### Example Implementation +```php + deletePet($petId, $apiKey) + +Deletes a pet + +### Example Implementation +```php + OpenAPI\Server\Model\Pet findPetsByStatus($status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example Implementation +```php + OpenAPI\Server\Model\Pet findPetsByTags($tags, $maxCount) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example Implementation +```php + OpenAPI\Server\Model\Pet getPetById($petId) + +Find pet by ID + +Returns a single pet + +### Example Implementation +```php + updatePet($pet) + +Update an existing pet + +### Example Implementation +```php + updatePetWithForm($petId, $name, $status) + +Updates a pet in the store with form data + +### Example Implementation +```php + OpenAPI\Server\Model\ApiResponse uploadFile($petId, $additionalMetadata, $file) + +uploads an image + +### Example Implementation +```php + deleteOrder($orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example Implementation +```php + int getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example Implementation +```php + OpenAPI\Server\Model\Order getOrderById($orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example Implementation +```php + OpenAPI\Server\Model\Order placeOrder($order) + +Place an order for a pet + +### Example Implementation +```php + createUser($user) + +Create user + +This can only be done by the logged in user. + +### Example Implementation +```php + createUsersWithArrayInput($user) + +Creates list of users with given input array + +### Example Implementation +```php + createUsersWithListInput($user) + +Creates list of users with given input array + +### Example Implementation +```php + deleteUser($username) + +Delete user + +This can only be done by the logged in user. + +### Example Implementation +```php + OpenAPI\Server\Model\User getUserByName($username) + +Get user by user name + +### Example Implementation +```php + string loginUser($username, $password) + +Logs user into the system + +### Example Implementation +```php + logoutUser() + +Logs out current logged in user session + +### Example Implementation +```php + updateUser($username, $user) + +Updated user + +This can only be done by the logged in user. + +### Example Implementation +```php +serializer = SerializerBuilder::create() + ->setDeserializationVisitor('json', new StrictJsonDeserializationVisitor($naming_strategy)) + ->setDeserializationVisitor('xml', new XmlDeserializationVisitor($naming_strategy)) + ->build(); + } + + public function serialize($data, $format) + { + return SerializerBuilder::create()->build()->serialize($data, $this->convertFormat($format)); + } + + public function deserialize($data, $type, $format) + { + if ($format == 'string') { + return $this->deserializeString($data, $type); + } + + // If we end up here, let JMS serializer handle the deserialization + return $this->serializer->deserialize($data, $type, $this->convertFormat($format)); + } + + private function convertFormat($format) + { + switch ($format) { + case 'application/json': + return 'json'; + case 'application/xml': + return 'xml'; + } + + return null; + } + + private function deserializeString($data, $type) + { + // Figure out if we have an array format + if (1 === preg_match('/array<(csv|ssv|tsv|pipes),(int|string)>/i', $type, $matches)) { + return $this->deserializeArrayString($matches[1], $matches[2], $data); + } + + switch ($type) { + case 'int': + case 'integer': + if (is_int($data)) { + return $data; + } + + if (is_numeric($data)) { + return $data + 0; + } + + break; + case 'string': + break; + case 'boolean': + case 'bool': + if (strtolower($data) === 'true') { + return true; + } + + if (strtolower($data) === 'false') { + return false; + } + + break; + } + + // If we end up here, just return data + return $data; + } + + private function deserializeArrayString($format, $type, $data) + { + // Parse the string using the correct separator + switch ($format) { + case 'csv': + $data = explode(',', $data); + break; + case 'ssv': + $data = explode(' ', $data); + break; + case 'tsv': + $data = explode("\t", $data); + break; + case 'pipes': + $data = explode('|', $data); + break; + default; + $data = []; + } + + // Deserialize each of the array elements + foreach ($data as $key => $item) { + $data[$key] = $this->deserializeString($item, $type); + } + + return $data; + } +} diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Service/SerializerInterface.php b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Service/SerializerInterface.php new file mode 100644 index 00000000000..40ef08f44c9 --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Service/SerializerInterface.php @@ -0,0 +1,27 @@ +validator = $validator; + } + + public function validate($value, $constraints = null, $groups = null) + { + return $this->validator->validate($value, $constraints, $groups); + } +} diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Service/TypeMismatchException.php b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Service/TypeMismatchException.php new file mode 100644 index 00000000000..33c9cb7ab74 --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Service/TypeMismatchException.php @@ -0,0 +1,52 @@ +getCurrentPath()) > 0) { + $property = sprintf('property "%s" to be ', implode('.', $context->getCurrentPath())); + } else { + $property = ''; + } + + return new static(sprintf( + 'Expected %s%s, but got %s: %s', + $property, + $expected_type, + gettype($actual_value), + json_encode($actual_value) + )); + } +} diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Service/ValidatorInterface.php b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Service/ValidatorInterface.php new file mode 100644 index 00000000000..dea54184733 --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Service/ValidatorInterface.php @@ -0,0 +1,25 @@ +request('POST', $path); + } + + /** + * Test case for deletePet + * + * Deletes a pet. + * + */ + public function testDeletePet() + { + $client = static::createClient(); + + $path = '/pet/{petId}'; + $pattern = '{petId}'; + $data = $this->genTestData('\d+'); + $path = str_replace($pattern, $data, $path); + + $crawler = $client->request('DELETE', $path); + } + + /** + * Test case for findPetsByStatus + * + * Finds Pets by status. + * + */ + public function testFindPetsByStatus() + { + $client = static::createClient(); + + $path = '/pet/findByStatus'; + + $crawler = $client->request('GET', $path); + } + + /** + * Test case for findPetsByTags + * + * Finds Pets by tags. + * + */ + public function testFindPetsByTags() + { + $client = static::createClient(); + + $path = '/pet/findByTags'; + + $crawler = $client->request('GET', $path); + } + + /** + * Test case for getPetById + * + * Find pet by ID. + * + */ + public function testGetPetById() + { + $client = static::createClient(); + + $path = '/pet/{petId}'; + $pattern = '{petId}'; + $data = $this->genTestData('\d+'); + $path = str_replace($pattern, $data, $path); + + $crawler = $client->request('GET', $path); + } + + /** + * Test case for updatePet + * + * Update an existing pet. + * + */ + public function testUpdatePet() + { + $client = static::createClient(); + + $path = '/pet'; + + $crawler = $client->request('PUT', $path); + } + + /** + * Test case for updatePetWithForm + * + * Updates a pet in the store with form data. + * + */ + public function testUpdatePetWithForm() + { + $client = static::createClient(); + + $path = '/pet/{petId}'; + $pattern = '{petId}'; + $data = $this->genTestData('\d+'); + $path = str_replace($pattern, $data, $path); + + $crawler = $client->request('POST', $path); + } + + /** + * Test case for uploadFile + * + * uploads an image. + * + */ + public function testUploadFile() + { + $client = static::createClient(); + + $path = '/pet/{petId}/uploadImage'; + $pattern = '{petId}'; + $data = $this->genTestData('\d+'); + $path = str_replace($pattern, $data, $path); + + $crawler = $client->request('POST', $path); + } + + protected function genTestData($regexp) + { + $grammar = new \Hoa\File\Read('hoa://Library/Regex/Grammar.pp'); + $compiler = \Hoa\Compiler\Llk\Llk::load($grammar); + $ast = $compiler->parse($regexp); + $generator = new \Hoa\Regex\Visitor\Isotropic(new \Hoa\Math\Sampler\Random()); + + return $generator->visit($ast); + } +} diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Tests/Api/StoreApiInterfaceTest.php b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Tests/Api/StoreApiInterfaceTest.php new file mode 100644 index 00000000000..919d30cf9a1 --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Tests/Api/StoreApiInterfaceTest.php @@ -0,0 +1,151 @@ +genTestData('[a-z0-9]+'); + $path = str_replace($pattern, $data, $path); + + $crawler = $client->request('DELETE', $path); + } + + /** + * Test case for getInventory + * + * Returns pet inventories by status. + * + */ + public function testGetInventory() + { + $client = static::createClient(); + + $path = '/store/inventory'; + + $crawler = $client->request('GET', $path); + } + + /** + * Test case for getOrderById + * + * Find purchase order by ID. + * + */ + public function testGetOrderById() + { + $client = static::createClient(); + + $path = '/store/order/{orderId}'; + $pattern = '{orderId}'; + $data = $this->genTestData('\d+'); + $path = str_replace($pattern, $data, $path); + + $crawler = $client->request('GET', $path); + } + + /** + * Test case for placeOrder + * + * Place an order for a pet. + * + */ + public function testPlaceOrder() + { + $client = static::createClient(); + + $path = '/store/order'; + + $crawler = $client->request('POST', $path); + } + + protected function genTestData($regexp) + { + $grammar = new \Hoa\File\Read('hoa://Library/Regex/Grammar.pp'); + $compiler = \Hoa\Compiler\Llk\Llk::load($grammar); + $ast = $compiler->parse($regexp); + $generator = new \Hoa\Regex\Visitor\Isotropic(new \Hoa\Math\Sampler\Random()); + + return $generator->visit($ast); + } +} diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Tests/Api/UserApiInterfaceTest.php b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Tests/Api/UserApiInterfaceTest.php new file mode 100644 index 00000000000..6f2e3ba0b6c --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Tests/Api/UserApiInterfaceTest.php @@ -0,0 +1,214 @@ +request('POST', $path); + } + + /** + * Test case for createUsersWithArrayInput + * + * Creates list of users with given input array. + * + */ + public function testCreateUsersWithArrayInput() + { + $client = static::createClient(); + + $path = '/user/createWithArray'; + + $crawler = $client->request('POST', $path); + } + + /** + * Test case for createUsersWithListInput + * + * Creates list of users with given input array. + * + */ + public function testCreateUsersWithListInput() + { + $client = static::createClient(); + + $path = '/user/createWithList'; + + $crawler = $client->request('POST', $path); + } + + /** + * Test case for deleteUser + * + * Delete user. + * + */ + public function testDeleteUser() + { + $client = static::createClient(); + + $path = '/user/{username}'; + $pattern = '{username}'; + $data = $this->genTestData('[a-z0-9]+'); + $path = str_replace($pattern, $data, $path); + + $crawler = $client->request('DELETE', $path); + } + + /** + * Test case for getUserByName + * + * Get user by user name. + * + */ + public function testGetUserByName() + { + $client = static::createClient(); + + $path = '/user/{username}'; + $pattern = '{username}'; + $data = $this->genTestData('[a-z0-9]+'); + $path = str_replace($pattern, $data, $path); + + $crawler = $client->request('GET', $path); + } + + /** + * Test case for loginUser + * + * Logs user into the system. + * + */ + public function testLoginUser() + { + $client = static::createClient(); + + $path = '/user/login'; + + $crawler = $client->request('GET', $path); + } + + /** + * Test case for logoutUser + * + * Logs out current logged in user session. + * + */ + public function testLogoutUser() + { + $client = static::createClient(); + + $path = '/user/logout'; + + $crawler = $client->request('GET', $path); + } + + /** + * Test case for updateUser + * + * Updated user. + * + */ + public function testUpdateUser() + { + $client = static::createClient(); + + $path = '/user/{username}'; + $pattern = '{username}'; + $data = $this->genTestData('[a-z0-9]+'); + $path = str_replace($pattern, $data, $path); + + $crawler = $client->request('PUT', $path); + } + + protected function genTestData($regexp) + { + $grammar = new \Hoa\File\Read('hoa://Library/Regex/Grammar.pp'); + $compiler = \Hoa\Compiler\Llk\Llk::load($grammar); + $ast = $compiler->parse($regexp); + $generator = new \Hoa\Regex\Visitor\Isotropic(new \Hoa\Math\Sampler\Random()); + + return $generator->visit($ast); + } +} diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Tests/AppKernel.php b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Tests/AppKernel.php new file mode 100644 index 00000000000..631690bc978 --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Tests/AppKernel.php @@ -0,0 +1,21 @@ +load(__DIR__.'/test_config.yml'); + } +} diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Tests/Model/ApiResponseTest.php b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Tests/Model/ApiResponseTest.php new file mode 100644 index 00000000000..3bbfe7c96e5 --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/Tests/Model/ApiResponseTest.php @@ -0,0 +1,101 @@ +=5.4", + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "symfony/validator": "*", + "jms/serializer-bundle": "^2.0", + "symfony/framework-bundle": "^3.3|^4.1" + }, + "require-dev": { + "phpunit/phpunit": "~4.8", + "satooshi/php-coveralls": "~1.0", + "squizlabs/php_codesniffer": "~2.6", + "friendsofphp/php-cs-fixer": "~1.12", + "symfony/browser-kit": "*", + "hoa/regex": "~1.0" + }, + "autoload": { + "psr-4": { "OpenAPI\\Server\\" : "./" } + } +} diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/git_push.sh b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/git_push.sh new file mode 100644 index 00000000000..4d22bfef4d7 --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/git_push.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/phpunit.xml.dist b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/phpunit.xml.dist new file mode 100644 index 00000000000..6f8b5ca0f93 --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/phpunit.xml.dist @@ -0,0 +1,24 @@ + + + + + ./Tests/Api + ./Tests/Model + + + + + ././Api + ././Model + + + + + + + diff --git a/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/pom.xml b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/pom.xml new file mode 100644 index 00000000000..672956a1b51 --- /dev/null +++ b/samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/pom.xml @@ -0,0 +1,57 @@ + + 4.0.0 + com.penneo + PhpSymfonyPetstoreServerTests + pom + 1.0-SNAPSHOT + PHP Symfony Petstore Server + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + bundle-install + pre-integration-test + + exec + + + composer + + install + + + + + bundle-test + integration-test + + exec + + + vendor/bin/phpunit + + + + + + + + From 93ddf6e2ef195a3a68ea68fb15508221ce2c91ad Mon Sep 17 00:00:00 2001 From: "Juang, Yi-Lin" Date: Fri, 2 Aug 2019 06:58:32 +0800 Subject: [PATCH 32/75] Fix DateTimeOffset nullable issue (#3530) --- .../codegen/languages/AbstractCSharpCodegen.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java index d39c6c07ab4..fb4a9c861b8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java @@ -153,7 +153,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co "DateTime?", "DateTime", "DateTimeOffset?", - "DataTimeOffset", + "DateTimeOffset", "Boolean", "Double", "Int32", @@ -192,7 +192,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co // nullable type nullableType = new HashSet( - Arrays.asList("decimal", "bool", "int", "float", "long", "double", "DateTime", "Guid") + Arrays.asList("decimal", "bool", "int", "float", "long", "double", "DateTime", "DateTimeOffset", "Guid") ); // value Types valueTypes = new HashSet( @@ -226,9 +226,9 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co public void useDateTimeOffset(boolean flag) { this.useDateTimeOffsetFlag = flag; if (flag) { - typeMapping.put("DateTime", "DateTimeOffset?"); + typeMapping.put("DateTime", "DateTimeOffset"); } else { - typeMapping.put("DateTime", "DateTime?"); + typeMapping.put("DateTime", "DateTime"); } } From ca85ecb283088a5ef9081dbd393262a19ee64b7c Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 2 Aug 2019 07:00:29 +0800 Subject: [PATCH 33/75] [Ruby][Faraday] Various improvements (#3520) * update ruby faraday oas v2 samples * skip some default tests in faraday * add ruby faraday oas v3 client * add tests, fix url * add tests to CI * fix file upload * undo changes to ruby-client-petstore.sh * test faraday first * combine gemspec tempaltes * test ruby faraday in drone.io * use smaller image * update bundler * use official ruby image * skip bundler installation * skip autotest * install make * use different image * skip ruby tests in drone.io --- bin/openapi3/ruby-client-faraday-petstore.sh | 43 + bin/openapi3/ruby-petstore-faraday.json | 6 + bin/ruby-petstore-faraday.json | 1 + .../codegen/languages/RubyClientCodegen.java | 4 +- .../ruby-client/api_client_spec.mustache | 2 + .../ruby-client/faraday_api_client.mustache | 50 +- .../ruby-client/faraday_gemspec.mustache | 38 - .../resources/ruby-client/gemspec.mustache | 5 + .../ruby-faraday/.openapi-generator/VERSION | 2 +- .../client/petstore/ruby-faraday/.rubocop.yml | 4 +- .../client/petstore/ruby-faraday/.travis.yml | 11 + samples/client/petstore/ruby-faraday/Gemfile | 1 + .../client/petstore/ruby-faraday/README.md | 24 +- .../docs/AdditionalPropertiesAnyType.md | 17 + .../docs/AdditionalPropertiesArray.md | 17 + .../docs/AdditionalPropertiesBoolean.md | 17 + .../docs/AdditionalPropertiesClass.md | 32 +- .../docs/AdditionalPropertiesInteger.md | 17 + .../docs/AdditionalPropertiesNumber.md | 17 + .../docs/AdditionalPropertiesObject.md | 17 + .../docs/AdditionalPropertiesString.md | 17 + .../petstore/ruby-faraday/docs/Animal.md | 10 + .../ruby-faraday/docs/AnotherFakeApi.md | 20 +- .../petstore/ruby-faraday/docs/ApiResponse.md | 11 + .../docs/ArrayOfArrayOfNumberOnly.md | 9 + .../ruby-faraday/docs/ArrayOfNumberOnly.md | 9 + .../petstore/ruby-faraday/docs/ArrayTest.md | 11 + .../ruby-faraday/docs/Capitalization.md | 14 + .../client/petstore/ruby-faraday/docs/Cat.md | 13 +- .../petstore/ruby-faraday/docs/CatAllOf.md | 17 + .../petstore/ruby-faraday/docs/Category.md | 10 + .../petstore/ruby-faraday/docs/ClassModel.md | 9 + .../petstore/ruby-faraday/docs/Client.md | 9 + .../client/petstore/ruby-faraday/docs/Dog.md | 11 +- .../petstore/ruby-faraday/docs/DogAllOf.md | 17 + .../petstore/ruby-faraday/docs/EnumArrays.md | 10 + .../petstore/ruby-faraday/docs/EnumClass.md | 9 + .../petstore/ruby-faraday/docs/EnumTest.md | 13 + .../petstore/ruby-faraday/docs/FakeApi.md | 199 ++-- .../docs/FakeClassnameTags123Api.md | 20 +- .../client/petstore/ruby-faraday/docs/File.md | 9 + .../ruby-faraday/docs/FileSchemaTestClass.md | 10 + .../petstore/ruby-faraday/docs/FormatTest.md | 21 + .../ruby-faraday/docs/HasOnlyReadOnly.md | 10 + .../client/petstore/ruby-faraday/docs/List.md | 9 + .../petstore/ruby-faraday/docs/MapTest.md | 16 +- ...dPropertiesAndAdditionalPropertiesClass.md | 11 + .../ruby-faraday/docs/Model200Response.md | 10 + .../petstore/ruby-faraday/docs/ModelReturn.md | 9 + .../client/petstore/ruby-faraday/docs/Name.md | 12 + .../petstore/ruby-faraday/docs/NumberOnly.md | 9 + .../petstore/ruby-faraday/docs/Order.md | 16 +- .../ruby-faraday/docs/OuterComposite.md | 13 +- .../petstore/ruby-faraday/docs/OuterEnum.md | 9 + .../client/petstore/ruby-faraday/docs/Pet.md | 14 + .../petstore/ruby-faraday/docs/PetApi.md | 92 +- .../ruby-faraday/docs/ReadOnlyFirst.md | 10 + .../ruby-faraday/docs/SpecialModelName.md | 9 + .../petstore/ruby-faraday/docs/StoreApi.md | 44 +- .../client/petstore/ruby-faraday/docs/Tag.md | 10 + .../ruby-faraday/docs/TypeHolderDefault.md | 25 + .../ruby-faraday/docs/TypeHolderExample.md | 25 + .../client/petstore/ruby-faraday/docs/User.md | 16 + .../petstore/ruby-faraday/docs/UserApi.md | 100 +- .../petstore/ruby-faraday/docs/XmlItem.md | 73 ++ .../petstore/ruby-faraday/lib/petstore.rb | 18 +- .../lib/petstore/api/another_fake_api.rb | 48 +- .../ruby-faraday/lib/petstore/api/fake_api.rb | 544 ++++++---- .../api/fake_classname_tags123_api.rb | 48 +- .../ruby-faraday/lib/petstore/api/pet_api.rb | 310 ++++-- .../lib/petstore/api/store_api.rb | 136 ++- .../ruby-faraday/lib/petstore/api/user_api.rb | 303 ++++-- .../ruby-faraday/lib/petstore/api_client.rb | 387 +++++-- .../ruby-faraday/lib/petstore/api_error.rb | 23 +- .../lib/petstore/configuration.rb | 15 +- .../models/additional_properties_any_type.rb | 196 ++++ .../models/additional_properties_array.rb | 196 ++++ .../models/additional_properties_boolean.rb | 196 ++++ .../models/additional_properties_class.rb | 156 ++- .../models/additional_properties_integer.rb | 196 ++++ .../models/additional_properties_number.rb | 196 ++++ .../models/additional_properties_object.rb | 196 ++++ .../models/additional_properties_string.rb | 196 ++++ .../lib/petstore/models/animal.rb | 48 +- .../lib/petstore/models/api_response.rb | 39 +- .../models/array_of_array_of_number_only.rb | 37 +- .../petstore/models/array_of_number_only.rb | 37 +- .../lib/petstore/models/array_test.rb | 39 +- .../lib/petstore/models/capitalization.rb | 61 +- .../ruby-faraday/lib/petstore/models/cat.rb | 84 +- .../lib/petstore/models/cat_all_of.rb | 196 ++++ .../lib/petstore/models/category.rb | 37 +- .../lib/petstore/models/class_model.rb | 35 +- .../lib/petstore/models/client.rb | 35 +- .../ruby-faraday/lib/petstore/models/dog.rb | 82 +- .../lib/petstore/models/dog_all_of.rb | 196 ++++ .../lib/petstore/models/enum_arrays.rb | 43 +- .../lib/petstore/models/enum_class.rb | 18 +- .../lib/petstore/models/enum_test.rb | 69 +- .../ruby-faraday/lib/petstore/models/file.rb | 37 +- .../petstore/models/file_schema_test_class.rb | 37 +- .../lib/petstore/models/format_test.rb | 83 +- .../lib/petstore/models/has_only_read_only.rb | 37 +- .../ruby-faraday/lib/petstore/models/list.rb | 37 +- .../lib/petstore/models/map_test.rb | 45 +- ...perties_and_additional_properties_class.rb | 41 +- .../lib/petstore/models/model200_response.rb | 39 +- .../lib/petstore/models/model_return.rb | 37 +- .../ruby-faraday/lib/petstore/models/name.rb | 43 +- .../lib/petstore/models/number_only.rb | 37 +- .../ruby-faraday/lib/petstore/models/order.rb | 57 +- .../lib/petstore/models/outer_composite.rb | 41 +- .../lib/petstore/models/outer_enum.rb | 18 +- .../ruby-faraday/lib/petstore/models/pet.rb | 53 +- .../lib/petstore/models/read_only_first.rb | 37 +- .../lib/petstore/models/special_model_name.rb | 37 +- .../ruby-faraday/lib/petstore/models/tag.rb | 37 +- .../petstore/models/type_holder_default.rb | 263 +++++ .../petstore/models/type_holder_example.rb | 259 +++++ .../ruby-faraday/lib/petstore/models/user.rb | 55 +- .../lib/petstore/models/xml_item.rb | 466 +++++++++ .../ruby-faraday/lib/petstore/version.rb | 4 +- .../petstore/ruby-faraday/petstore.gemspec | 4 +- .../additional_properties_any_type_spec.rb | 41 + .../additional_properties_array_spec.rb | 41 + .../additional_properties_boolean_spec.rb | 41 + .../additional_properties_integer_spec.rb | 41 + .../additional_properties_number_spec.rb | 41 + .../additional_properties_object_spec.rb | 41 + .../additional_properties_string_spec.rb | 41 + .../spec/models/cat_all_of_spec.rb | 41 + .../spec/models/dog_all_of_spec.rb | 41 + .../spec/models/type_holder_default_spec.rb | 65 ++ .../spec/models/type_holder_example_spec.rb | 65 ++ .../ruby-faraday/spec/models/xml_item_spec.rb | 209 ++++ .../client/petstore/ruby-faraday/.gitignore | 39 + .../ruby-faraday/.openapi-generator-ignore | 23 + .../ruby-faraday/.openapi-generator/VERSION | 1 + .../client/petstore/ruby-faraday/.rspec | 2 + .../client/petstore/ruby-faraday/.rubocop.yml | 154 +++ .../client/petstore/ruby-faraday/.travis.yml | 11 + .../client/petstore/ruby-faraday/Gemfile | 9 + .../client/petstore/ruby-faraday/README.md | 204 ++++ .../client/petstore/ruby-faraday/Rakefile | 10 + .../docs/AdditionalPropertiesClass.md | 19 + .../petstore/ruby-faraday/docs/Animal.md | 19 + .../ruby-faraday/docs/AnotherFakeApi.md | 56 + .../petstore/ruby-faraday/docs/ApiResponse.md | 21 + .../docs/ArrayOfArrayOfNumberOnly.md | 17 + .../ruby-faraday/docs/ArrayOfNumberOnly.md | 17 + .../petstore/ruby-faraday/docs/ArrayTest.md | 21 + .../ruby-faraday/docs/Capitalization.md | 27 + .../client/petstore/ruby-faraday/docs/Cat.md | 17 + .../petstore/ruby-faraday/docs/CatAllOf.md | 17 + .../petstore/ruby-faraday/docs/Category.md | 19 + .../petstore/ruby-faraday/docs/ClassModel.md | 17 + .../petstore/ruby-faraday/docs/Client.md | 17 + .../petstore/ruby-faraday/docs/DefaultApi.md | 49 + .../client/petstore/ruby-faraday/docs/Dog.md | 17 + .../petstore/ruby-faraday/docs/DogAllOf.md | 17 + .../petstore/ruby-faraday/docs/EnumArrays.md | 19 + .../petstore/ruby-faraday/docs/EnumClass.md | 16 + .../petstore/ruby-faraday/docs/EnumTest.md | 31 + .../petstore/ruby-faraday/docs/FakeApi.md | 686 ++++++++++++ .../docs/FakeClassnameTags123Api.md | 63 ++ .../client/petstore/ruby-faraday/docs/File.md | 17 + .../ruby-faraday/docs/FileSchemaTestClass.md | 19 + .../client/petstore/ruby-faraday/docs/Foo.md | 17 + .../petstore/ruby-faraday/docs/FormatTest.md | 45 + .../ruby-faraday/docs/HasOnlyReadOnly.md | 19 + .../ruby-faraday/docs/HealthCheckResult.md | 17 + .../ruby-faraday/docs/InlineObject.md | 19 + .../ruby-faraday/docs/InlineObject1.md | 19 + .../ruby-faraday/docs/InlineObject2.md | 19 + .../ruby-faraday/docs/InlineObject3.md | 43 + .../ruby-faraday/docs/InlineObject4.md | 19 + .../ruby-faraday/docs/InlineObject5.md | 19 + .../docs/InlineResponseDefault.md | 17 + .../client/petstore/ruby-faraday/docs/List.md | 17 + .../petstore/ruby-faraday/docs/MapTest.md | 23 + ...dPropertiesAndAdditionalPropertiesClass.md | 21 + .../ruby-faraday/docs/Model200Response.md | 19 + .../petstore/ruby-faraday/docs/ModelReturn.md | 17 + .../client/petstore/ruby-faraday/docs/Name.md | 23 + .../ruby-faraday/docs/NullableClass.md | 39 + .../petstore/ruby-faraday/docs/NumberOnly.md | 17 + .../petstore/ruby-faraday/docs/Order.md | 27 + .../ruby-faraday/docs/OuterComposite.md | 21 + .../petstore/ruby-faraday/docs/OuterEnum.md | 16 + .../docs/OuterEnumDefaultValue.md | 16 + .../ruby-faraday/docs/OuterEnumInteger.md | 16 + .../docs/OuterEnumIntegerDefaultValue.md | 16 + .../client/petstore/ruby-faraday/docs/Pet.md | 27 + .../petstore/ruby-faraday/docs/PetApi.md | 493 +++++++++ .../ruby-faraday/docs/ReadOnlyFirst.md | 19 + .../ruby-faraday/docs/SpecialModelName.md | 17 + .../petstore/ruby-faraday/docs/StoreApi.md | 200 ++++ .../client/petstore/ruby-faraday/docs/Tag.md | 19 + .../client/petstore/ruby-faraday/docs/User.md | 31 + .../petstore/ruby-faraday/docs/UserApi.md | 376 +++++++ .../client/petstore/ruby-faraday/git_push.sh | 55 + .../client/petstore/ruby-faraday/hello.txt | 1 + .../petstore/ruby-faraday/lib/petstore.rb | 95 ++ .../lib/petstore/api/another_fake_api.rb | 86 ++ .../lib/petstore/api/default_api.rb | 74 ++ .../ruby-faraday/lib/petstore/api/fake_api.rb | 989 ++++++++++++++++++ .../api/fake_classname_tags123_api.rb | 86 ++ .../ruby-faraday/lib/petstore/api/pet_api.rb | 597 +++++++++++ .../lib/petstore/api/store_api.rb | 270 +++++ .../ruby-faraday/lib/petstore/api/user_api.rb | 512 +++++++++ .../ruby-faraday/lib/petstore/api_client.rb | 403 +++++++ .../ruby-faraday/lib/petstore/api_error.rb | 57 + .../lib/petstore/configuration.rb | 310 ++++++ .../models/additional_properties_class.rb | 209 ++++ .../lib/petstore/models/animal.rb | 217 ++++ .../lib/petstore/models/api_response.rb | 214 ++++ .../models/array_of_array_of_number_only.rb | 198 ++++ .../petstore/models/array_of_number_only.rb | 198 ++++ .../lib/petstore/models/array_test.rb | 220 ++++ .../lib/petstore/models/capitalization.rb | 242 +++++ .../ruby-faraday/lib/petstore/models/cat.rb | 208 ++++ .../lib/petstore/models/cat_all_of.rb | 196 ++++ .../lib/petstore/models/category.rb | 212 ++++ .../lib/petstore/models/class_model.rb | 197 ++++ .../lib/petstore/models/client.rb | 196 ++++ .../ruby-faraday/lib/petstore/models/dog.rb | 208 ++++ .../lib/petstore/models/dog_all_of.rb | 196 ++++ .../lib/petstore/models/enum_arrays.rb | 241 +++++ .../lib/petstore/models/enum_class.rb | 37 + .../lib/petstore/models/enum_test.rb | 334 ++++++ .../ruby-faraday/lib/petstore/models/file.rb | 198 ++++ .../petstore/models/file_schema_test_class.rb | 207 ++++ .../ruby-faraday/lib/petstore/models/foo.rb | 198 ++++ .../lib/petstore/models/format_test.rb | 547 ++++++++++ .../lib/petstore/models/has_only_read_only.rb | 205 ++++ .../petstore/models/health_check_result.rb | 197 ++++ .../lib/petstore/models/inline_object.rb | 207 ++++ .../lib/petstore/models/inline_object1.rb | 207 ++++ .../lib/petstore/models/inline_object2.rb | 245 +++++ .../lib/petstore/models/inline_object3.rb | 528 ++++++++++ .../lib/petstore/models/inline_object4.rb | 217 ++++ .../lib/petstore/models/inline_object5.rb | 212 ++++ .../models/inline_response_default.rb | 196 ++++ .../ruby-faraday/lib/petstore/models/list.rb | 196 ++++ .../lib/petstore/models/map_test.rb | 253 +++++ ...perties_and_additional_properties_class.rb | 216 ++++ .../lib/petstore/models/model200_response.rb | 206 ++++ .../lib/petstore/models/model_return.rb | 197 ++++ .../ruby-faraday/lib/petstore/models/name.rb | 229 ++++ .../lib/petstore/models/nullable_class.rb | 307 ++++++ .../lib/petstore/models/number_only.rb | 196 ++++ .../ruby-faraday/lib/petstore/models/order.rb | 278 +++++ .../lib/petstore/models/outer_composite.rb | 214 ++++ .../lib/petstore/models/outer_enum.rb | 37 + .../models/outer_enum_default_value.rb | 37 + .../lib/petstore/models/outer_enum_integer.rb | 37 + .../outer_enum_integer_default_value.rb | 37 + .../ruby-faraday/lib/petstore/models/pet.rb | 290 +++++ .../lib/petstore/models/read_only_first.rb | 205 ++++ .../lib/petstore/models/special_model_name.rb | 196 ++++ .../ruby-faraday/lib/petstore/models/tag.rb | 205 ++++ .../ruby-faraday/lib/petstore/models/user.rb | 260 +++++ .../ruby-faraday/lib/petstore/version.rb | 15 + .../petstore/ruby-faraday/petstore.gemspec | 41 + .../client/petstore/ruby-faraday/pom.xml | 62 ++ .../spec/api/another_fake_api_spec.rb | 47 + .../ruby-faraday/spec/api/default_api_spec.rb | 44 + .../ruby-faraday/spec/api/fake_api_spec.rb | 207 ++++ .../api/fake_classname_tags123_api_spec.rb | 47 + .../ruby-faraday/spec/api/pet_api_spec.rb | 144 +++ .../ruby-faraday/spec/api/store_api_spec.rb | 81 ++ .../ruby-faraday/spec/api/user_api_spec.rb | 127 +++ .../ruby-faraday/spec/api_client_spec.rb | 188 ++++ .../ruby-faraday/spec/configuration_spec.rb | 42 + .../spec/custom/api_error_spec.rb | 20 + .../spec/custom/base_object_spec.rb | 109 ++ .../ruby-faraday/spec/custom/pet_spec.rb | 219 ++++ .../ruby-faraday/spec/custom/store_spec.rb | 39 + .../additional_properties_class_spec.rb | 47 + .../ruby-faraday/spec/models/animal_spec.rb | 47 + .../spec/models/api_response_spec.rb | 53 + .../array_of_array_of_number_only_spec.rb | 41 + .../spec/models/array_of_number_only_spec.rb | 41 + .../spec/models/array_test_spec.rb | 53 + .../spec/models/capitalization_spec.rb | 71 ++ .../spec/models/cat_all_of_spec.rb | 41 + .../ruby-faraday/spec/models/cat_spec.rb | 41 + .../ruby-faraday/spec/models/category_spec.rb | 47 + .../spec/models/class_model_spec.rb | 41 + .../ruby-faraday/spec/models/client_spec.rb | 41 + .../spec/models/dog_all_of_spec.rb | 41 + .../ruby-faraday/spec/models/dog_spec.rb | 41 + .../spec/models/enum_arrays_spec.rb | 55 + .../spec/models/enum_class_spec.rb | 35 + .../spec/models/enum_test_spec.rb | 99 ++ .../models/file_schema_test_class_spec.rb | 47 + .../ruby-faraday/spec/models/file_spec.rb | 41 + .../ruby-faraday/spec/models/foo_spec.rb | 41 + .../spec/models/format_test_spec.rb | 125 +++ .../spec/models/has_only_read_only_spec.rb | 47 + .../spec/models/health_check_result_spec.rb | 41 + .../spec/models/inline_object1_spec.rb | 47 + .../spec/models/inline_object2_spec.rb | 55 + .../spec/models/inline_object3_spec.rb | 119 +++ .../spec/models/inline_object4_spec.rb | 47 + .../spec/models/inline_object5_spec.rb | 47 + .../spec/models/inline_object_spec.rb | 47 + .../models/inline_response_default_spec.rb | 41 + .../ruby-faraday/spec/models/list_spec.rb | 41 + .../ruby-faraday/spec/models/map_test_spec.rb | 63 ++ ...es_and_additional_properties_class_spec.rb | 53 + .../spec/models/model200_response_spec.rb | 47 + .../spec/models/model_return_spec.rb | 41 + .../ruby-faraday/spec/models/name_spec.rb | 59 ++ .../spec/models/nullable_class_spec.rb | 107 ++ .../spec/models/number_only_spec.rb | 41 + .../ruby-faraday/spec/models/order_spec.rb | 75 ++ .../spec/models/outer_composite_spec.rb | 53 + .../models/outer_enum_default_value_spec.rb | 35 + .../outer_enum_integer_default_value_spec.rb | 35 + .../spec/models/outer_enum_integer_spec.rb | 35 + .../spec/models/outer_enum_spec.rb | 35 + .../ruby-faraday/spec/models/pet_spec.rb | 75 ++ .../spec/models/read_only_first_spec.rb | 47 + .../spec/models/special_model_name_spec.rb | 41 + .../ruby-faraday/spec/models/tag_spec.rb | 47 + .../ruby-faraday/spec/models/user_spec.rb | 83 ++ .../ruby-faraday/spec/petstore_helper.rb | 52 + .../petstore/ruby-faraday/spec/spec_helper.rb | 111 ++ .../petstore/ruby/spec/custom/store_spec.rb | 1 + 330 files changed, 28442 insertions(+), 1432 deletions(-) create mode 100755 bin/openapi3/ruby-client-faraday-petstore.sh create mode 100644 bin/openapi3/ruby-petstore-faraday.json delete mode 100644 modules/openapi-generator/src/main/resources/ruby-client/faraday_gemspec.mustache create mode 100644 samples/client/petstore/ruby-faraday/.travis.yml create mode 100644 samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesAnyType.md create mode 100644 samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesArray.md create mode 100644 samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesBoolean.md create mode 100644 samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesInteger.md create mode 100644 samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesNumber.md create mode 100644 samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesObject.md create mode 100644 samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesString.md create mode 100644 samples/client/petstore/ruby-faraday/docs/CatAllOf.md create mode 100644 samples/client/petstore/ruby-faraday/docs/DogAllOf.md create mode 100644 samples/client/petstore/ruby-faraday/docs/TypeHolderDefault.md create mode 100644 samples/client/petstore/ruby-faraday/docs/TypeHolderExample.md create mode 100644 samples/client/petstore/ruby-faraday/docs/XmlItem.md create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_any_type.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_array.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_boolean.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_integer.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_number.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_object.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_string.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_default.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_example.rb create mode 100644 samples/client/petstore/ruby-faraday/lib/petstore/models/xml_item.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/additional_properties_any_type_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/additional_properties_array_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/additional_properties_boolean_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/additional_properties_integer_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/additional_properties_number_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/additional_properties_object_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/additional_properties_string_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/type_holder_default_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/type_holder_example_spec.rb create mode 100644 samples/client/petstore/ruby-faraday/spec/models/xml_item_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/.gitignore create mode 100644 samples/openapi3/client/petstore/ruby-faraday/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/ruby-faraday/.rspec create mode 100644 samples/openapi3/client/petstore/ruby-faraday/.rubocop.yml create mode 100644 samples/openapi3/client/petstore/ruby-faraday/.travis.yml create mode 100644 samples/openapi3/client/petstore/ruby-faraday/Gemfile create mode 100644 samples/openapi3/client/petstore/ruby-faraday/README.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/Rakefile create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/AdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/Animal.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/AnotherFakeApi.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/ApiResponse.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/ArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/ArrayTest.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/Capitalization.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/Cat.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/CatAllOf.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/Category.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/ClassModel.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/Client.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/DefaultApi.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/Dog.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/DogAllOf.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/EnumArrays.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/EnumClass.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/EnumTest.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/FakeApi.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/File.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/FileSchemaTestClass.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/Foo.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/FormatTest.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/HasOnlyReadOnly.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/HealthCheckResult.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject1.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject2.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject3.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject4.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject5.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/InlineResponseDefault.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/List.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/MapTest.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/Model200Response.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/ModelReturn.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/Name.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/NullableClass.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/NumberOnly.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/Order.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/OuterComposite.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/OuterEnum.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/OuterEnumDefaultValue.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/OuterEnumInteger.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/OuterEnumIntegerDefaultValue.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/Pet.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/PetApi.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/ReadOnlyFirst.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/SpecialModelName.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/StoreApi.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/Tag.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/User.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/docs/UserApi.md create mode 100644 samples/openapi3/client/petstore/ruby-faraday/git_push.sh create mode 100644 samples/openapi3/client/petstore/ruby-faraday/hello.txt create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_client.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_error.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/configuration.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/animal.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/category.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/client.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/foo.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/list.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/name.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/order.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/pet.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/tag.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/user.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/lib/petstore/version.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec create mode 100644 samples/openapi3/client/petstore/ruby-faraday/pom.xml create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/api/default_api_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/api/store_api_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/api/user_api_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/api_client_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/configuration_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/custom/api_error_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/custom/base_object_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/custom/pet_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/custom/store_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/animal_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/api_response_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/array_test_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/category_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/class_model_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/client_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/file_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/foo_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/format_test_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/health_check_result_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object1_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object2_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object3_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object4_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object5_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_response_default_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/list_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/map_test_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/model_return_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/name_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/nullable_class_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/number_only_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/order_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_default_value_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_default_value_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/pet_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/tag_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/models/user_spec.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/petstore_helper.rb create mode 100644 samples/openapi3/client/petstore/ruby-faraday/spec/spec_helper.rb diff --git a/bin/openapi3/ruby-client-faraday-petstore.sh b/bin/openapi3/ruby-client-faraday-petstore.sh new file mode 100755 index 00000000000..4110205ea15 --- /dev/null +++ b/bin/openapi3/ruby-client-faraday-petstore.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# purge lib/doc folder +echo "purge ruby petstore lib, docs folder" +rm -Rf samples/openapi3/client/petstore/ruby-faraday/lib +rm -Rf samples/openapi3/client/petstore/ruby-faraday/docs + +# purge test files other than integration test +# NOTE: spec/custom/*.rb and spec/petstore_helper.rb are not generated files +echo "purge ruby petstore spec" +find samples/openapi3/client/petstore/ruby-faraday/spec -type d -not -name spec -not -name custom | xargs rm -Rf +find samples/openapi3/client/petstore/ruby-faraday/spec -type f -not -name petstore_helper.rb -not -iwholename '*/spec/custom/*' | xargs rm -Rf + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/openapi3/ruby-petstore-faraday.json -o samples/openapi3/client/petstore/ruby-faraday --additional-properties skipFormModel=true $@" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/ruby-petstore-faraday.json b/bin/openapi3/ruby-petstore-faraday.json new file mode 100644 index 00000000000..21974c307f2 --- /dev/null +++ b/bin/openapi3/ruby-petstore-faraday.json @@ -0,0 +1,6 @@ +{ + "gemName": "petstore", + "moduleName": "Petstore", + "library": "faraday", + "gemVersion": "1.0.0" +} diff --git a/bin/ruby-petstore-faraday.json b/bin/ruby-petstore-faraday.json index ddb753471a1..21974c307f2 100644 --- a/bin/ruby-petstore-faraday.json +++ b/bin/ruby-petstore-faraday.json @@ -1,5 +1,6 @@ { "gemName": "petstore", "moduleName": "Petstore", + "library": "faraday", "gemVersion": "1.0.0" } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java index 6ac5ee26800..8395c045944 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java @@ -232,14 +232,14 @@ public class RubyClientCodegen extends AbstractRubyCodegen { supportingFiles.add(new SupportingFile("Gemfile.mustache", "", "Gemfile")); supportingFiles.add(new SupportingFile("rubocop.mustache", "", ".rubocop.yml")); supportingFiles.add(new SupportingFile("travis.mustache", "", ".travis.yml")); + supportingFiles.add(new SupportingFile("gemspec.mustache", "", gemName + ".gemspec")); if (TYPHOEUS.equals(getLibrary())) { supportingFiles.add(new SupportingFile("api_client.mustache", gemFolder, "api_client.rb")); - supportingFiles.add(new SupportingFile("gemspec.mustache", "", gemName + ".gemspec")); supportingFiles.add(new SupportingFile("Gemfile.lock.mustache", "", "Gemfile.lock")); } else if (FARADAY.equals(getLibrary())) { supportingFiles.add(new SupportingFile("faraday_api_client.mustache", gemFolder, "api_client.rb")); - supportingFiles.add(new SupportingFile("faraday_gemspec.mustache", "", gemName + ".gemspec")); + additionalProperties.put("isFaraday", Boolean.TRUE); } else { throw new RuntimeException("Invalid HTTP library " + getLibrary() + ". Only faraday, typhoeus are supported."); } diff --git a/modules/openapi-generator/src/main/resources/ruby-client/api_client_spec.mustache b/modules/openapi-generator/src/main/resources/ruby-client/api_client_spec.mustache index b887b92f31a..3e8d070ef9f 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/api_client_spec.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/api_client_spec.mustache @@ -43,6 +43,7 @@ describe {{moduleName}}::ApiClient do end end +{{^isFaraday}} describe 'params_encoding in #build_request' do let(:config) { {{moduleName}}::Configuration.new } let(:api_client) { {{moduleName}}::ApiClient.new(config) } @@ -81,6 +82,7 @@ describe {{moduleName}}::ApiClient do end end +{{/isFaraday}} describe '#deserialize' do it "handles Array" do api_client = {{moduleName}}::ApiClient.new diff --git a/modules/openapi-generator/src/main/resources/ruby-client/faraday_api_client.mustache b/modules/openapi-generator/src/main/resources/ruby-client/faraday_api_client.mustache index bfe0ad907f3..58b36c179d4 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/faraday_api_client.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/faraday_api_client.mustache @@ -41,34 +41,34 @@ module {{moduleName}} connection = Faraday.new(:url => config.base_url) do |conn| conn.basic_auth(config.username, config.password) if opts[:header_params]["Content-Type"] == "multipart/form-data" - conn.request :multipart - conn.request :url_encoded + conn.request :multipart + conn.request :url_encoded end conn.adapter(Faraday.default_adapter) end begin - response = connection.public_send(http_method.to_sym.downcase) do |req| - build_request(http_method, path, req, opts) - end + response = connection.public_send(http_method.to_sym.downcase) do |req| + build_request(http_method, path, req, opts) + end - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end + if @config.debugging + @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" + end - unless response.success? - if response.status == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.status, - :response_headers => response.headers, - :response_body => response.body), - response.reason_phrase - end + unless response.success? + if response.status == 0 + # Errors from libcurl will be made visible here + fail ApiError.new(:code => 0, + :message => response.return_message) + else + fail ApiError.new(:code => response.status, + :response_headers => response.headers, + :response_body => response.body), + response.reason_phrase end + end rescue Faraday::TimeoutError - fail ApiError.new('Connection timed out') + fail ApiError.new('Connection timed out') end if opts[:return_type] @@ -126,7 +126,7 @@ module {{moduleName}} end request.headers = header_params request.body = req_body - request.url path + request.url url request.params = query_params download_file(request) if opts[:return_type] == 'File' request @@ -277,13 +277,15 @@ module {{moduleName}} # @return [String] HTTP body data in the form of string def build_request_body(header_params, form_params, body) # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' + if header_params['Content-Type'] == 'application/x-www-form-urlencoded' + data = URI.encode_www_form(form_params) + elsif header_params['Content-Type'] == 'multipart/form-data' data = {} form_params.each do |key, value| case value when ::File, ::Tempfile - data[key] = Faraday::UploadIO.new(value.path, '') + # TODO hardcode to application/octet-stream, need better way to detect content type + data[key] = Faraday::UploadIO.new(value.path, 'application/octet-stream', value.path) when ::Array, nil # let Faraday handle Array and nil parameters data[key] = value diff --git a/modules/openapi-generator/src/main/resources/ruby-client/faraday_gemspec.mustache b/modules/openapi-generator/src/main/resources/ruby-client/faraday_gemspec.mustache deleted file mode 100644 index 09046b7f28e..00000000000 --- a/modules/openapi-generator/src/main/resources/ruby-client/faraday_gemspec.mustache +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -{{> api_info}} -=end - -$:.push File.expand_path("../lib", __FILE__) -require "{{gemName}}/version" - -Gem::Specification.new do |s| - s.name = "{{gemName}}{{^gemName}}{{{appName}}}{{/gemName}}" - s.version = {{moduleName}}::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["{{gemAuthor}}{{^gemAuthor}}OpenAPI-Generator{{/gemAuthor}}"] - s.email = ["{{gemAuthorEmail}}{{^gemAuthorEmail}}{{infoEmail}}{{/gemAuthorEmail}}"] - s.homepage = "{{gemHomepage}}{{^gemHomepage}}https://openapi-generator.tech{{/gemHomepage}}" - s.summary = "{{gemSummary}}{{^gemSummary}}{{{appName}}} Ruby Gem{{/gemSummary}}" - s.description = "{{gemDescription}}{{^gemDescription}}{{{appDescription}}}{{^appDescription}}{{{appName}}} Ruby Gem{{/appDescription}}{{/gemDescription}}" - {{#gemLicense}} - s.license = '{{{gemLicense}}}' - {{/gemLicense}} - {{^gemLicense}} - s.license = "Unlicense" - {{/gemLicense}} - s.required_ruby_version = "{{{gemRequiredRubyVersion}}}{{^gemRequiredRubyVersion}}>= 1.9{{/gemRequiredRubyVersion}}" - - s.add_runtime_dependency 'faraday', '>= 0.14.0' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1' - s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/modules/openapi-generator/src/main/resources/ruby-client/gemspec.mustache b/modules/openapi-generator/src/main/resources/ruby-client/gemspec.mustache index b77bbb50367..e4a486855c5 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/gemspec.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/gemspec.mustache @@ -24,7 +24,12 @@ Gem::Specification.new do |s| {{/gemLicense}} s.required_ruby_version = "{{{gemRequiredRubyVersion}}}{{^gemRequiredRubyVersion}}>= 1.9{{/gemRequiredRubyVersion}}" + {{#isFaraday}} + s.add_runtime_dependency 'faraday', '>= 0.14.0' + {{/isFaraday}} + {{^isFaraday}} s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' + {{/isFaraday}} s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' diff --git a/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION b/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION index e24c1f857e0..83a328a9227 100644 --- a/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION +++ b/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.3-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ruby-faraday/.rubocop.yml b/samples/client/petstore/ruby-faraday/.rubocop.yml index 98c7e3c7e51..0ef33ce5e32 100644 --- a/samples/client/petstore/ruby-faraday/.rubocop.yml +++ b/samples/client/petstore/ruby-faraday/.rubocop.yml @@ -1,7 +1,7 @@ # This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) # Automatically generated by OpenAPI Generator (https://openapi-generator.tech) AllCops: - TargetRubyVersion: 2.2 + TargetRubyVersion: 2.4 # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop # to ignore them, so only the ones explicitly set in this file are enabled. DisabledByDefault: true @@ -46,7 +46,7 @@ Layout/EmptyLinesAroundMethodBody: Layout/EmptyLinesAroundModuleBody: Enabled: true -Layout/FirstParameterIndentation: +Layout/IndentFirstArgument: Enabled: true # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. diff --git a/samples/client/petstore/ruby-faraday/.travis.yml b/samples/client/petstore/ruby-faraday/.travis.yml new file mode 100644 index 00000000000..d2d526df594 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/.travis.yml @@ -0,0 +1,11 @@ +language: ruby +cache: bundler +rvm: + - 2.3 + - 2.4 + - 2.5 +script: + - bundle install --path vendor/bundle + - bundle exec rspec + - gem build petstore.gemspec + - gem install ./petstore-1.0.0.gem diff --git a/samples/client/petstore/ruby-faraday/Gemfile b/samples/client/petstore/ruby-faraday/Gemfile index 01ba313fe12..69255e559f7 100644 --- a/samples/client/petstore/ruby-faraday/Gemfile +++ b/samples/client/petstore/ruby-faraday/Gemfile @@ -5,4 +5,5 @@ gemspec group :development, :test do gem 'rake', '~> 12.0.0' gem 'pry-byebug' + gem 'rubocop', '~> 0.66.0' end diff --git a/samples/client/petstore/ruby-faraday/README.md b/samples/client/petstore/ruby-faraday/README.md index 9e3a1180a6b..e7b6b2ae402 100644 --- a/samples/client/petstore/ruby-faraday/README.md +++ b/samples/client/petstore/ruby-faraday/README.md @@ -25,6 +25,7 @@ Then either install the gem locally: ```shell gem install ./petstore-1.0.0.gem ``` + (for development, run `gem install --dev ./petstore-1.0.0.gem` to install the development dependencies) or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). @@ -50,16 +51,17 @@ ruby -Ilib script.rb ## Getting Started Please follow the [installation](#installation) procedure and then run the following code: + ```ruby # Load the gem require 'petstore' api_instance = Petstore::AnotherFakeApi.new -client = Petstore::Client.new # Client | client model +body = Petstore::Client.new # Client | client model begin #To test special tags - result = api_instance.call_123_test_special_tags(client) + result = api_instance.call_123_test_special_tags(body) p result rescue Petstore::ApiError => e puts "Exception when calling AnotherFakeApi->call_123_test_special_tags: #{e}" @@ -74,6 +76,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *Petstore::AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags +*Petstore::FakeApi* | [**create_xml_item**](docs/FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem *Petstore::FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | *Petstore::FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | *Petstore::FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | @@ -112,19 +115,27 @@ Class | Method | HTTP request | Description ## Documentation for Models + - [Petstore::AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) + - [Petstore::AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) + - [Petstore::AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) - [Petstore::AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [Petstore::AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) + - [Petstore::AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) + - [Petstore::AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) + - [Petstore::AdditionalPropertiesString](docs/AdditionalPropertiesString.md) - [Petstore::Animal](docs/Animal.md) - - [Petstore::AnimalFarm](docs/AnimalFarm.md) - [Petstore::ApiResponse](docs/ApiResponse.md) - [Petstore::ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [Petstore::ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [Petstore::ArrayTest](docs/ArrayTest.md) - [Petstore::Capitalization](docs/Capitalization.md) - [Petstore::Cat](docs/Cat.md) + - [Petstore::CatAllOf](docs/CatAllOf.md) - [Petstore::Category](docs/Category.md) - [Petstore::ClassModel](docs/ClassModel.md) - [Petstore::Client](docs/Client.md) - [Petstore::Dog](docs/Dog.md) + - [Petstore::DogAllOf](docs/DogAllOf.md) - [Petstore::EnumArrays](docs/EnumArrays.md) - [Petstore::EnumClass](docs/EnumClass.md) - [Petstore::EnumTest](docs/EnumTest.md) @@ -145,9 +156,11 @@ Class | Method | HTTP request | Description - [Petstore::Pet](docs/Pet.md) - [Petstore::ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Petstore::SpecialModelName](docs/SpecialModelName.md) - - [Petstore::StringBooleanMap](docs/StringBooleanMap.md) - [Petstore::Tag](docs/Tag.md) + - [Petstore::TypeHolderDefault](docs/TypeHolderDefault.md) + - [Petstore::TypeHolderExample](docs/TypeHolderExample.md) - [Petstore::User](docs/User.md) + - [Petstore::XmlItem](docs/XmlItem.md) ## Documentation for Authorization @@ -155,12 +168,14 @@ Class | Method | HTTP request | Description ### api_key + - **Type**: API key - **API key parameter name**: api_key - **Location**: HTTP header ### api_key_query + - **Type**: API key - **API key parameter name**: api_key_query - **Location**: URL query string @@ -171,6 +186,7 @@ Class | Method | HTTP request | Description ### petstore_auth + - **Type**: OAuth - **Flow**: implicit - **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog diff --git a/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesAnyType.md new file mode 100644 index 00000000000..d61613cab35 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesAnyType.md @@ -0,0 +1,17 @@ +# Petstore::AdditionalPropertiesAnyType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::AdditionalPropertiesAnyType.new(name: null) +``` + + diff --git a/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesArray.md b/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesArray.md new file mode 100644 index 00000000000..27b9024ef27 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesArray.md @@ -0,0 +1,17 @@ +# Petstore::AdditionalPropertiesArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::AdditionalPropertiesArray.new(name: null) +``` + + diff --git a/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesBoolean.md new file mode 100644 index 00000000000..8e64a21f91e --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesBoolean.md @@ -0,0 +1,17 @@ +# Petstore::AdditionalPropertiesBoolean + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::AdditionalPropertiesBoolean.new(name: null) +``` + + diff --git a/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesClass.md b/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesClass.md index c3ee2cdf637..31c329ccdc3 100644 --- a/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesClass.md @@ -1,9 +1,37 @@ # Petstore::AdditionalPropertiesClass ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**map_property** | **Hash<String, String>** | | [optional] -**map_of_map_property** | **Hash<String, Hash<String, String>>** | | [optional] +**map_string** | **Hash<String, String>** | | [optional] +**map_number** | **Hash<String, Float>** | | [optional] +**map_integer** | **Hash<String, Integer>** | | [optional] +**map_boolean** | **Hash<String, Boolean>** | | [optional] +**map_array_integer** | **Hash<String, Array<Integer>>** | | [optional] +**map_array_anytype** | **Hash<String, Array<Object>>** | | [optional] +**map_map_string** | **Hash<String, Hash<String, String>>** | | [optional] +**map_map_anytype** | **Hash<String, Hash<String, Object>>** | | [optional] +**anytype_1** | [**Object**](.md) | | [optional] +**anytype_2** | [**Object**](.md) | | [optional] +**anytype_3** | [**Object**](.md) | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::AdditionalPropertiesClass.new(map_string: null, + map_number: null, + map_integer: null, + map_boolean: null, + map_array_integer: null, + map_array_anytype: null, + map_map_string: null, + map_map_anytype: null, + anytype_1: null, + anytype_2: null, + anytype_3: null) +``` diff --git a/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesInteger.md new file mode 100644 index 00000000000..2e198d2814a --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesInteger.md @@ -0,0 +1,17 @@ +# Petstore::AdditionalPropertiesInteger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::AdditionalPropertiesInteger.new(name: null) +``` + + diff --git a/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesNumber.md new file mode 100644 index 00000000000..419cec4a56d --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesNumber.md @@ -0,0 +1,17 @@ +# Petstore::AdditionalPropertiesNumber + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::AdditionalPropertiesNumber.new(name: null) +``` + + diff --git a/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesObject.md b/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesObject.md new file mode 100644 index 00000000000..bd6525eac26 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesObject.md @@ -0,0 +1,17 @@ +# Petstore::AdditionalPropertiesObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::AdditionalPropertiesObject.new(name: null) +``` + + diff --git a/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesString.md b/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesString.md new file mode 100644 index 00000000000..e6941073f28 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/AdditionalPropertiesString.md @@ -0,0 +1,17 @@ +# Petstore::AdditionalPropertiesString + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::AdditionalPropertiesString.new(name: null) +``` + + diff --git a/samples/client/petstore/ruby-faraday/docs/Animal.md b/samples/client/petstore/ruby-faraday/docs/Animal.md index 077e6c2d87c..80e132d13e4 100644 --- a/samples/client/petstore/ruby-faraday/docs/Animal.md +++ b/samples/client/petstore/ruby-faraday/docs/Animal.md @@ -1,9 +1,19 @@ # Petstore::Animal ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **class_name** | **String** | | **color** | **String** | | [optional] [default to 'red'] +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::Animal.new(class_name: null, + color: null) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md b/samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md index 2d4891e0660..71a7a54d991 100644 --- a/samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md +++ b/samples/client/petstore/ruby-faraday/docs/AnotherFakeApi.md @@ -7,24 +7,27 @@ Method | HTTP request | Description [**call_123_test_special_tags**](AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags -# **call_123_test_special_tags** -> Client call_123_test_special_tags(client) + +## call_123_test_special_tags + +> Client call_123_test_special_tags(body) To test special tags To test special tags and operation ID starting with number ### Example + ```ruby # load the gem require 'petstore' api_instance = Petstore::AnotherFakeApi.new -client = Petstore::Client.new # Client | client model +body = Petstore::Client.new # Client | client model begin #To test special tags - result = api_instance.call_123_test_special_tags(client) + result = api_instance.call_123_test_special_tags(body) p result rescue Petstore::ApiError => e puts "Exception when calling AnotherFakeApi->call_123_test_special_tags: #{e}" @@ -33,9 +36,10 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md)| client model | + **body** | [**Client**](Client.md)| client model | ### Return type @@ -47,8 +51,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json - - +- **Content-Type**: application/json +- **Accept**: application/json diff --git a/samples/client/petstore/ruby-faraday/docs/ApiResponse.md b/samples/client/petstore/ruby-faraday/docs/ApiResponse.md index 843f9cc525b..c0ac7c4b4c1 100644 --- a/samples/client/petstore/ruby-faraday/docs/ApiResponse.md +++ b/samples/client/petstore/ruby-faraday/docs/ApiResponse.md @@ -1,10 +1,21 @@ # Petstore::ApiResponse ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **Integer** | | [optional] **type** | **String** | | [optional] **message** | **String** | | [optional] +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::ApiResponse.new(code: null, + type: null, + message: null) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/ruby-faraday/docs/ArrayOfArrayOfNumberOnly.md index 003cf9a8d6d..5bb9ff33be2 100644 --- a/samples/client/petstore/ruby-faraday/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/ruby-faraday/docs/ArrayOfArrayOfNumberOnly.md @@ -1,8 +1,17 @@ # Petstore::ArrayOfArrayOfNumberOnly ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **array_array_number** | **Array<Array<Float>>** | | [optional] +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::ArrayOfArrayOfNumberOnly.new(array_array_number: null) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/ArrayOfNumberOnly.md b/samples/client/petstore/ruby-faraday/docs/ArrayOfNumberOnly.md index c2b9fada4f8..8adb00978ac 100644 --- a/samples/client/petstore/ruby-faraday/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/ruby-faraday/docs/ArrayOfNumberOnly.md @@ -1,8 +1,17 @@ # Petstore::ArrayOfNumberOnly ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **array_number** | **Array<Float>** | | [optional] +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::ArrayOfNumberOnly.new(array_number: null) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/ArrayTest.md b/samples/client/petstore/ruby-faraday/docs/ArrayTest.md index 5fbfd67159b..76e3866ba9c 100644 --- a/samples/client/petstore/ruby-faraday/docs/ArrayTest.md +++ b/samples/client/petstore/ruby-faraday/docs/ArrayTest.md @@ -1,10 +1,21 @@ # Petstore::ArrayTest ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **array_of_string** | **Array<String>** | | [optional] **array_array_of_integer** | **Array<Array<Integer>>** | | [optional] **array_array_of_model** | **Array<Array<ReadOnlyFirst>>** | | [optional] +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::ArrayTest.new(array_of_string: null, + array_array_of_integer: null, + array_array_of_model: null) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/Capitalization.md b/samples/client/petstore/ruby-faraday/docs/Capitalization.md index d99c603f54a..d1ac69ceb18 100644 --- a/samples/client/petstore/ruby-faraday/docs/Capitalization.md +++ b/samples/client/petstore/ruby-faraday/docs/Capitalization.md @@ -1,6 +1,7 @@ # Petstore::Capitalization ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **small_camel** | **String** | | [optional] @@ -10,4 +11,17 @@ Name | Type | Description | Notes **sca_eth_flow_points** | **String** | | [optional] **att_name** | **String** | Name of the pet | [optional] +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::Capitalization.new(small_camel: null, + capital_camel: null, + small_snake: null, + capital_snake: null, + sca_eth_flow_points: null, + att_name: null) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/Cat.md b/samples/client/petstore/ruby-faraday/docs/Cat.md index d0fc50e4da8..054fbfadafd 100644 --- a/samples/client/petstore/ruby-faraday/docs/Cat.md +++ b/samples/client/petstore/ruby-faraday/docs/Cat.md @@ -1,10 +1,17 @@ # Petstore::Cat ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**class_name** | **String** | | -**color** | **String** | | [optional] [default to 'red'] -**declawed** | **BOOLEAN** | | [optional] +**declawed** | **Boolean** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::Cat.new(declawed: null) +``` diff --git a/samples/client/petstore/ruby-faraday/docs/CatAllOf.md b/samples/client/petstore/ruby-faraday/docs/CatAllOf.md new file mode 100644 index 00000000000..a83a6f75662 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/CatAllOf.md @@ -0,0 +1,17 @@ +# Petstore::CatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **Boolean** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::CatAllOf.new(declawed: null) +``` + + diff --git a/samples/client/petstore/ruby-faraday/docs/Category.md b/samples/client/petstore/ruby-faraday/docs/Category.md index 4500de105b2..942f88759ea 100644 --- a/samples/client/petstore/ruby-faraday/docs/Category.md +++ b/samples/client/petstore/ruby-faraday/docs/Category.md @@ -1,9 +1,19 @@ # Petstore::Category ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Integer** | | [optional] **name** | **String** | | [default to 'default-name'] +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::Category.new(id: null, + name: null) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/ClassModel.md b/samples/client/petstore/ruby-faraday/docs/ClassModel.md index cd4de850633..faf38fde16d 100644 --- a/samples/client/petstore/ruby-faraday/docs/ClassModel.md +++ b/samples/client/petstore/ruby-faraday/docs/ClassModel.md @@ -1,8 +1,17 @@ # Petstore::ClassModel ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **_class** | **String** | | [optional] +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::ClassModel.new(_class: null) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/Client.md b/samples/client/petstore/ruby-faraday/docs/Client.md index 2b8e400aaee..da87ce113cb 100644 --- a/samples/client/petstore/ruby-faraday/docs/Client.md +++ b/samples/client/petstore/ruby-faraday/docs/Client.md @@ -1,8 +1,17 @@ # Petstore::Client ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **client** | **String** | | [optional] +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::Client.new(client: null) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/Dog.md b/samples/client/petstore/ruby-faraday/docs/Dog.md index 1e66990d593..68c2e5d7e0e 100644 --- a/samples/client/petstore/ruby-faraday/docs/Dog.md +++ b/samples/client/petstore/ruby-faraday/docs/Dog.md @@ -1,10 +1,17 @@ # Petstore::Dog ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**class_name** | **String** | | -**color** | **String** | | [optional] [default to 'red'] **breed** | **String** | | [optional] +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::Dog.new(breed: null) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/DogAllOf.md b/samples/client/petstore/ruby-faraday/docs/DogAllOf.md new file mode 100644 index 00000000000..6107fd0c10f --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/DogAllOf.md @@ -0,0 +1,17 @@ +# Petstore::DogAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **String** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::DogAllOf.new(breed: null) +``` + + diff --git a/samples/client/petstore/ruby-faraday/docs/EnumArrays.md b/samples/client/petstore/ruby-faraday/docs/EnumArrays.md index ef6a935fbd7..18efa20299d 100644 --- a/samples/client/petstore/ruby-faraday/docs/EnumArrays.md +++ b/samples/client/petstore/ruby-faraday/docs/EnumArrays.md @@ -1,9 +1,19 @@ # Petstore::EnumArrays ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **just_symbol** | **String** | | [optional] **array_enum** | **Array<String>** | | [optional] +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::EnumArrays.new(just_symbol: null, + array_enum: null) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/EnumClass.md b/samples/client/petstore/ruby-faraday/docs/EnumClass.md index 8d56e1f8873..0fca9b27f5c 100644 --- a/samples/client/petstore/ruby-faraday/docs/EnumClass.md +++ b/samples/client/petstore/ruby-faraday/docs/EnumClass.md @@ -1,7 +1,16 @@ # Petstore::EnumClass ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::EnumClass.new() +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/EnumTest.md b/samples/client/petstore/ruby-faraday/docs/EnumTest.md index 87297ac476e..41059ae76e6 100644 --- a/samples/client/petstore/ruby-faraday/docs/EnumTest.md +++ b/samples/client/petstore/ruby-faraday/docs/EnumTest.md @@ -1,6 +1,7 @@ # Petstore::EnumTest ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enum_string** | **String** | | [optional] @@ -9,4 +10,16 @@ Name | Type | Description | Notes **enum_number** | **Float** | | [optional] **outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::EnumTest.new(enum_string: null, + enum_string_required: null, + enum_integer: null, + enum_number: null, + outer_enum: null) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/FakeApi.md b/samples/client/petstore/ruby-faraday/docs/FakeApi.md index e7e99549266..227bb2bf788 100644 --- a/samples/client/petstore/ruby-faraday/docs/FakeApi.md +++ b/samples/client/petstore/ruby-faraday/docs/FakeApi.md @@ -4,6 +4,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**create_xml_item**](FakeApi.md#create_xml_item) | **POST** /fake/create_xml_item | creates an XmlItem [**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | [**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | [**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | @@ -18,21 +19,70 @@ Method | HTTP request | Description [**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data -# **fake_outer_boolean_serialize** -> BOOLEAN fake_outer_boolean_serialize(opts) + +## create_xml_item + +> create_xml_item(xml_item) + +creates an XmlItem + +this route creates an XmlItem + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +xml_item = Petstore::XmlItem.new # XmlItem | XmlItem Body + +begin + #creates an XmlItem + api_instance.create_xml_item(xml_item) +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->create_xml_item: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xml_item** | [**XmlItem**](XmlItem.md)| XmlItem Body | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### 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 +- **Accept**: Not defined + + +## fake_outer_boolean_serialize + +> Boolean fake_outer_boolean_serialize(opts) Test serialization of outer boolean types ### Example + ```ruby # load the gem require 'petstore' api_instance = Petstore::FakeApi.new opts = { - body: true # BOOLEAN | Input boolean as post body + body: true # Boolean | Input boolean as post body } begin @@ -45,13 +95,14 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **BOOLEAN**| Input boolean as post body | [optional] + **body** | **Boolean**| Input boolean as post body | [optional] ### Return type -**BOOLEAN** +**Boolean** ### Authorization @@ -59,12 +110,12 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: */* +- **Content-Type**: Not defined +- **Accept**: */* +## fake_outer_composite_serialize -# **fake_outer_composite_serialize** > OuterComposite fake_outer_composite_serialize(opts) @@ -72,13 +123,14 @@ No authorization required Test serialization of object with outer number type ### Example + ```ruby # load the gem require 'petstore' api_instance = Petstore::FakeApi.new opts = { - outer_composite: Petstore::OuterComposite.new # OuterComposite | Input composite as post body + body: Petstore::OuterComposite.new # OuterComposite | Input composite as post body } begin @@ -91,9 +143,10 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **outer_composite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -105,12 +158,12 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: */* +- **Content-Type**: Not defined +- **Accept**: */* +## fake_outer_number_serialize -# **fake_outer_number_serialize** > Float fake_outer_number_serialize(opts) @@ -118,6 +171,7 @@ No authorization required Test serialization of outer number types ### Example + ```ruby # load the gem require 'petstore' @@ -137,6 +191,7 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | **Float**| Input number as post body | [optional] @@ -151,12 +206,12 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: */* +- **Content-Type**: Not defined +- **Accept**: */* +## fake_outer_string_serialize -# **fake_outer_string_serialize** > String fake_outer_string_serialize(opts) @@ -164,6 +219,7 @@ No authorization required Test serialization of outer string types ### Example + ```ruby # load the gem require 'petstore' @@ -183,6 +239,7 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | **String**| Input string as post body | [optional] @@ -197,28 +254,29 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: */* +- **Content-Type**: Not defined +- **Accept**: */* +## test_body_with_file_schema -# **test_body_with_file_schema** -> test_body_with_file_schema(file_schema_test_class) +> test_body_with_file_schema(body) For this test, the body for this request much reference a schema named `File`. ### Example + ```ruby # load the gem require 'petstore' api_instance = Petstore::FakeApi.new -file_schema_test_class = Petstore::FileSchemaTestClass.new # FileSchemaTestClass | +body = Petstore::FileSchemaTestClass.new # FileSchemaTestClass | begin - api_instance.test_body_with_file_schema(file_schema_test_class) + api_instance.test_body_with_file_schema(body) rescue Petstore::ApiError => e puts "Exception when calling FakeApi->test_body_with_file_schema: #{e}" end @@ -226,9 +284,10 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **file_schema_test_class** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | ### Return type @@ -240,27 +299,28 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined +## test_body_with_query_params -# **test_body_with_query_params** -> test_body_with_query_params(query, user) +> test_body_with_query_params(query, body) ### Example + ```ruby # load the gem require 'petstore' api_instance = Petstore::FakeApi.new query = 'query_example' # String | -user = Petstore::User.new # User | +body = Petstore::User.new # User | begin - api_instance.test_body_with_query_params(query, user) + api_instance.test_body_with_query_params(query, body) rescue Petstore::ApiError => e puts "Exception when calling FakeApi->test_body_with_query_params: #{e}" end @@ -268,10 +328,11 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **query** | **String**| | - **user** | [**User**](User.md)| | + **body** | [**User**](User.md)| | ### Return type @@ -283,29 +344,30 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined +## test_client_model -# **test_client_model** -> Client test_client_model(client) +> Client test_client_model(body) To test \"client\" model To test \"client\" model ### Example + ```ruby # load the gem require 'petstore' api_instance = Petstore::FakeApi.new -client = Petstore::Client.new # Client | client model +body = Petstore::Client.new # Client | client model begin #To test \"client\" model - result = api_instance.test_client_model(client) + result = api_instance.test_client_model(body) p result rescue Petstore::ApiError => e puts "Exception when calling FakeApi->test_client_model: #{e}" @@ -314,9 +376,10 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md)| client model | + **body** | [**Client**](Client.md)| client model | ### Return type @@ -328,12 +391,12 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## test_endpoint_parameters -# **test_endpoint_parameters** > test_endpoint_parameters(number, double, pattern_without_delimiter, byte, opts) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -341,6 +404,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example + ```ruby # load the gem require 'petstore' @@ -379,6 +443,7 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **number** | **Float**| None | @@ -406,12 +471,12 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined +## test_enum_parameters -# **test_enum_parameters** > test_enum_parameters(opts) To test enum parameters @@ -419,6 +484,7 @@ To test enum parameters To test enum parameters ### Example + ```ruby # load the gem require 'petstore' @@ -445,6 +511,7 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **enum_header_string_array** | [**Array<String>**](String.md)| Header parameter enum test (string array) | [optional] @@ -466,12 +533,12 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined +## test_group_parameters -# **test_group_parameters** > test_group_parameters(required_string_group, required_boolean_group, required_int64_group, opts) Fake endpoint to test group parameters (optional) @@ -479,17 +546,18 @@ Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) ### Example + ```ruby # load the gem require 'petstore' api_instance = Petstore::FakeApi.new required_string_group = 56 # Integer | Required String in group parameters -required_boolean_group = true # BOOLEAN | Required Boolean in group parameters +required_boolean_group = true # Boolean | Required Boolean in group parameters required_int64_group = 56 # Integer | Required Integer in group parameters opts = { string_group: 56, # Integer | String in group parameters - boolean_group: true, # BOOLEAN | Boolean in group parameters + boolean_group: true, # Boolean | Boolean in group parameters int64_group: 56 # Integer | Integer in group parameters } @@ -503,13 +571,14 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **required_string_group** | **Integer**| Required String in group parameters | - **required_boolean_group** | **BOOLEAN**| Required Boolean in group parameters | + **required_boolean_group** | **Boolean**| Required Boolean in group parameters | **required_int64_group** | **Integer**| Required Integer in group parameters | **string_group** | **Integer**| String in group parameters | [optional] - **boolean_group** | **BOOLEAN**| Boolean in group parameters | [optional] + **boolean_group** | **Boolean**| Boolean in group parameters | [optional] **int64_group** | **Integer**| Integer in group parameters | [optional] ### Return type @@ -522,27 +591,28 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined +## test_inline_additional_properties -# **test_inline_additional_properties** -> test_inline_additional_properties(request_body) +> test_inline_additional_properties(param) test inline additionalProperties ### Example + ```ruby # load the gem require 'petstore' api_instance = Petstore::FakeApi.new -request_body = {'key' => 'request_body_example'} # Hash | request body +param = {'key' => 'param_example'} # Hash | request body begin #test inline additionalProperties - api_instance.test_inline_additional_properties(request_body) + api_instance.test_inline_additional_properties(param) rescue Petstore::ApiError => e puts "Exception when calling FakeApi->test_inline_additional_properties: #{e}" end @@ -550,9 +620,10 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **request_body** | [**Hash<String, String>**](String.md)| request body | + **param** | [**Hash<String, String>**](String.md)| request body | ### Return type @@ -564,17 +635,18 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined +## test_json_form_data -# **test_json_form_data** > test_json_form_data(param, param2) test json serialization of form data ### Example + ```ruby # load the gem require 'petstore' @@ -593,6 +665,7 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **param** | **String**| field1 | @@ -608,8 +681,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - - +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined diff --git a/samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md b/samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md index a6153f02926..97f8ea959a7 100644 --- a/samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md @@ -7,14 +7,17 @@ Method | HTTP request | Description [**test_classname**](FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case -# **test_classname** -> Client test_classname(client) + +## test_classname + +> Client test_classname(body) To test class name in snake case To test class name in snake case ### Example + ```ruby # load the gem require 'petstore' @@ -27,11 +30,11 @@ Petstore.configure do |config| end api_instance = Petstore::FakeClassnameTags123Api.new -client = Petstore::Client.new # Client | client model +body = Petstore::Client.new # Client | client model begin #To test class name in snake case - result = api_instance.test_classname(client) + result = api_instance.test_classname(body) p result rescue Petstore::ApiError => e puts "Exception when calling FakeClassnameTags123Api->test_classname: #{e}" @@ -40,9 +43,10 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md)| client model | + **body** | [**Client**](Client.md)| client model | ### Return type @@ -54,8 +58,6 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json - - +- **Content-Type**: application/json +- **Accept**: application/json diff --git a/samples/client/petstore/ruby-faraday/docs/File.md b/samples/client/petstore/ruby-faraday/docs/File.md index 428a5a04188..ca8a6e9c313 100644 --- a/samples/client/petstore/ruby-faraday/docs/File.md +++ b/samples/client/petstore/ruby-faraday/docs/File.md @@ -1,8 +1,17 @@ # Petstore::File ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **source_uri** | **String** | Test capitalization | [optional] +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::File.new(source_uri: null) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/FileSchemaTestClass.md b/samples/client/petstore/ruby-faraday/docs/FileSchemaTestClass.md index d32819b3578..03ee5f7e803 100644 --- a/samples/client/petstore/ruby-faraday/docs/FileSchemaTestClass.md +++ b/samples/client/petstore/ruby-faraday/docs/FileSchemaTestClass.md @@ -1,9 +1,19 @@ # Petstore::FileSchemaTestClass ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **file** | **File** | | [optional] **files** | **Array<File>** | | [optional] +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::FileSchemaTestClass.new(file: null, + files: null) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/FormatTest.md b/samples/client/petstore/ruby-faraday/docs/FormatTest.md index ad9b8191dce..46f739ae786 100644 --- a/samples/client/petstore/ruby-faraday/docs/FormatTest.md +++ b/samples/client/petstore/ruby-faraday/docs/FormatTest.md @@ -1,6 +1,7 @@ # Petstore::FormatTest ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **integer** | **Integer** | | [optional] @@ -17,4 +18,24 @@ Name | Type | Description | Notes **uuid** | **String** | | [optional] **password** | **String** | | +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::FormatTest.new(integer: null, + int32: null, + int64: null, + number: null, + float: null, + double: null, + string: null, + byte: null, + binary: null, + date: null, + date_time: null, + uuid: 72f98069-206d-4f12-9f12-3d1e525a8e84, + password: null) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/HasOnlyReadOnly.md b/samples/client/petstore/ruby-faraday/docs/HasOnlyReadOnly.md index 16de3c060cc..eb82d6b113f 100644 --- a/samples/client/petstore/ruby-faraday/docs/HasOnlyReadOnly.md +++ b/samples/client/petstore/ruby-faraday/docs/HasOnlyReadOnly.md @@ -1,9 +1,19 @@ # Petstore::HasOnlyReadOnly ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **bar** | **String** | | [optional] **foo** | **String** | | [optional] +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::HasOnlyReadOnly.new(bar: null, + foo: null) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/List.md b/samples/client/petstore/ruby-faraday/docs/List.md index 211d299f671..4add9c3fd23 100644 --- a/samples/client/petstore/ruby-faraday/docs/List.md +++ b/samples/client/petstore/ruby-faraday/docs/List.md @@ -1,8 +1,17 @@ # Petstore::List ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **_123_list** | **String** | | [optional] +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::List.new(_123_list: null) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/MapTest.md b/samples/client/petstore/ruby-faraday/docs/MapTest.md index 54e16e1933e..9bf1793ec08 100644 --- a/samples/client/petstore/ruby-faraday/docs/MapTest.md +++ b/samples/client/petstore/ruby-faraday/docs/MapTest.md @@ -1,11 +1,23 @@ # Petstore::MapTest ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **map_map_of_string** | **Hash<String, Hash<String, String>>** | | [optional] **map_of_enum_string** | **Hash<String, String>** | | [optional] -**direct_map** | **Hash<String, BOOLEAN>** | | [optional] -**indirect_map** | **Hash<String, BOOLEAN>** | | [optional] +**direct_map** | **Hash<String, Boolean>** | | [optional] +**indirect_map** | **Hash<String, Boolean>** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::MapTest.new(map_map_of_string: null, + map_of_enum_string: null, + direct_map: null, + indirect_map: null) +``` diff --git a/samples/client/petstore/ruby-faraday/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/ruby-faraday/docs/MixedPropertiesAndAdditionalPropertiesClass.md index dcb02e2ffa6..a0d78f1d0b8 100644 --- a/samples/client/petstore/ruby-faraday/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/ruby-faraday/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -1,10 +1,21 @@ # Petstore::MixedPropertiesAndAdditionalPropertiesClass ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **uuid** | **String** | | [optional] **date_time** | **DateTime** | | [optional] **map** | [**Hash<String, Animal>**](Animal.md) | | [optional] +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::MixedPropertiesAndAdditionalPropertiesClass.new(uuid: null, + date_time: null, + map: null) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/Model200Response.md b/samples/client/petstore/ruby-faraday/docs/Model200Response.md index e745da1a756..07a53b60334 100644 --- a/samples/client/petstore/ruby-faraday/docs/Model200Response.md +++ b/samples/client/petstore/ruby-faraday/docs/Model200Response.md @@ -1,9 +1,19 @@ # Petstore::Model200Response ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **Integer** | | [optional] **_class** | **String** | | [optional] +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::Model200Response.new(name: null, + _class: null) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/ModelReturn.md b/samples/client/petstore/ruby-faraday/docs/ModelReturn.md index dfcfff1dd06..2e155936c89 100644 --- a/samples/client/petstore/ruby-faraday/docs/ModelReturn.md +++ b/samples/client/petstore/ruby-faraday/docs/ModelReturn.md @@ -1,8 +1,17 @@ # Petstore::ModelReturn ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **_return** | **Integer** | | [optional] +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::ModelReturn.new(_return: null) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/Name.md b/samples/client/petstore/ruby-faraday/docs/Name.md index 1ae49f8ee1b..bf4f381fe8a 100644 --- a/samples/client/petstore/ruby-faraday/docs/Name.md +++ b/samples/client/petstore/ruby-faraday/docs/Name.md @@ -1,6 +1,7 @@ # Petstore::Name ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **Integer** | | @@ -8,4 +9,15 @@ Name | Type | Description | Notes **property** | **String** | | [optional] **_123_number** | **Integer** | | [optional] +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::Name.new(name: null, + snake_case: null, + property: null, + _123_number: null) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/NumberOnly.md b/samples/client/petstore/ruby-faraday/docs/NumberOnly.md index 4be8a12a79d..73c5d0a3ab2 100644 --- a/samples/client/petstore/ruby-faraday/docs/NumberOnly.md +++ b/samples/client/petstore/ruby-faraday/docs/NumberOnly.md @@ -1,8 +1,17 @@ # Petstore::NumberOnly ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **just_number** | **Float** | | [optional] +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::NumberOnly.new(just_number: null) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/Order.md b/samples/client/petstore/ruby-faraday/docs/Order.md index 52a832c5106..e8f38005ae1 100644 --- a/samples/client/petstore/ruby-faraday/docs/Order.md +++ b/samples/client/petstore/ruby-faraday/docs/Order.md @@ -1,6 +1,7 @@ # Petstore::Order ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Integer** | | [optional] @@ -8,6 +9,19 @@ Name | Type | Description | Notes **quantity** | **Integer** | | [optional] **ship_date** | **DateTime** | | [optional] **status** | **String** | Order Status | [optional] -**complete** | **BOOLEAN** | | [optional] [default to false] +**complete** | **Boolean** | | [optional] [default to false] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::Order.new(id: null, + pet_id: null, + quantity: null, + ship_date: null, + status: null, + complete: null) +``` diff --git a/samples/client/petstore/ruby-faraday/docs/OuterComposite.md b/samples/client/petstore/ruby-faraday/docs/OuterComposite.md index e1548870a7b..2716cd29808 100644 --- a/samples/client/petstore/ruby-faraday/docs/OuterComposite.md +++ b/samples/client/petstore/ruby-faraday/docs/OuterComposite.md @@ -1,10 +1,21 @@ # Petstore::OuterComposite ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **my_number** | **Float** | | [optional] **my_string** | **String** | | [optional] -**my_boolean** | **BOOLEAN** | | [optional] +**my_boolean** | **Boolean** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::OuterComposite.new(my_number: null, + my_string: null, + my_boolean: null) +``` diff --git a/samples/client/petstore/ruby-faraday/docs/OuterEnum.md b/samples/client/petstore/ruby-faraday/docs/OuterEnum.md index 60d87c12381..e919b6bc78b 100644 --- a/samples/client/petstore/ruby-faraday/docs/OuterEnum.md +++ b/samples/client/petstore/ruby-faraday/docs/OuterEnum.md @@ -1,7 +1,16 @@ # Petstore::OuterEnum ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::OuterEnum.new() +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/Pet.md b/samples/client/petstore/ruby-faraday/docs/Pet.md index f4320a0b72b..efee63091e4 100644 --- a/samples/client/petstore/ruby-faraday/docs/Pet.md +++ b/samples/client/petstore/ruby-faraday/docs/Pet.md @@ -1,6 +1,7 @@ # Petstore::Pet ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Integer** | | [optional] @@ -10,4 +11,17 @@ Name | Type | Description | Notes **tags** | [**Array<Tag>**](Tag.md) | | [optional] **status** | **String** | pet status in the store | [optional] +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::Pet.new(id: null, + category: null, + name: doggie, + photo_urls: null, + tags: null, + status: null) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/PetApi.md b/samples/client/petstore/ruby-faraday/docs/PetApi.md index 61adf80830b..aa85e3e5bd2 100644 --- a/samples/client/petstore/ruby-faraday/docs/PetApi.md +++ b/samples/client/petstore/ruby-faraday/docs/PetApi.md @@ -15,12 +15,15 @@ Method | HTTP request | Description [**upload_file_with_required_file**](PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -# **add_pet** -> add_pet(pet) + +## add_pet + +> add_pet(body) Add a new pet to the store ### Example + ```ruby # load the gem require 'petstore' @@ -31,11 +34,11 @@ Petstore.configure do |config| end api_instance = Petstore::PetApi.new -pet = Petstore::Pet.new # Pet | Pet object that needs to be added to the store +body = Petstore::Pet.new # Pet | Pet object that needs to be added to the store begin #Add a new pet to the store - api_instance.add_pet(pet) + api_instance.add_pet(body) rescue Petstore::ApiError => e puts "Exception when calling PetApi->add_pet: #{e}" end @@ -43,9 +46,10 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -57,17 +61,18 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined +## delete_pet -# **delete_pet** > delete_pet(pet_id, opts) Deletes a pet ### Example + ```ruby # load the gem require 'petstore' @@ -93,6 +98,7 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pet_id** | **Integer**| Pet id to delete | @@ -108,12 +114,12 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined +## find_pets_by_status -# **find_pets_by_status** > Array<Pet> find_pets_by_status(status) Finds Pets by status @@ -121,6 +127,7 @@ Finds Pets by status Multiple status values can be provided with comma separated strings ### Example + ```ruby # load the gem require 'petstore' @@ -144,6 +151,7 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **status** | [**Array<String>**](String.md)| Status values that need to be considered for filter | @@ -158,12 +166,12 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json +## find_pets_by_tags -# **find_pets_by_tags** > Array<Pet> find_pets_by_tags(tags) Finds Pets by tags @@ -171,6 +179,7 @@ Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. ### Example + ```ruby # load the gem require 'petstore' @@ -194,6 +203,7 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**Array<String>**](String.md)| Tags to filter by | @@ -208,12 +218,12 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json +## get_pet_by_id -# **get_pet_by_id** > Pet get_pet_by_id(pet_id) Find pet by ID @@ -221,6 +231,7 @@ Find pet by ID Returns a single pet ### Example + ```ruby # load the gem require 'petstore' @@ -246,6 +257,7 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pet_id** | **Integer**| ID of pet to return | @@ -260,17 +272,18 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json +## update_pet -# **update_pet** -> update_pet(pet) +> update_pet(body) Update an existing pet ### Example + ```ruby # load the gem require 'petstore' @@ -281,11 +294,11 @@ Petstore.configure do |config| end api_instance = Petstore::PetApi.new -pet = Petstore::Pet.new # Pet | Pet object that needs to be added to the store +body = Petstore::Pet.new # Pet | Pet object that needs to be added to the store begin #Update an existing pet - api_instance.update_pet(pet) + api_instance.update_pet(body) rescue Petstore::ApiError => e puts "Exception when calling PetApi->update_pet: #{e}" end @@ -293,9 +306,10 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -307,17 +321,18 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined +## update_pet_with_form -# **update_pet_with_form** > update_pet_with_form(pet_id, opts) Updates a pet in the store with form data ### Example + ```ruby # load the gem require 'petstore' @@ -344,6 +359,7 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pet_id** | **Integer**| ID of pet that needs to be updated | @@ -360,17 +376,18 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined +## upload_file -# **upload_file** > ApiResponse upload_file(pet_id, opts) uploads an image ### Example + ```ruby # load the gem require 'petstore' @@ -398,6 +415,7 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pet_id** | **Integer**| ID of pet to update | @@ -414,17 +432,18 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: multipart/form-data - - **Accept**: application/json +- **Content-Type**: multipart/form-data +- **Accept**: application/json +## upload_file_with_required_file -# **upload_file_with_required_file** > ApiResponse upload_file_with_required_file(pet_id, required_file, opts) uploads an image (required) ### Example + ```ruby # load the gem require 'petstore' @@ -452,6 +471,7 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pet_id** | **Integer**| ID of pet to update | @@ -468,8 +488,6 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: multipart/form-data - - **Accept**: application/json - - +- **Content-Type**: multipart/form-data +- **Accept**: application/json diff --git a/samples/client/petstore/ruby-faraday/docs/ReadOnlyFirst.md b/samples/client/petstore/ruby-faraday/docs/ReadOnlyFirst.md index e49b5119478..af6644b78aa 100644 --- a/samples/client/petstore/ruby-faraday/docs/ReadOnlyFirst.md +++ b/samples/client/petstore/ruby-faraday/docs/ReadOnlyFirst.md @@ -1,9 +1,19 @@ # Petstore::ReadOnlyFirst ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **bar** | **String** | | [optional] **baz** | **String** | | [optional] +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::ReadOnlyFirst.new(bar: null, + baz: null) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/SpecialModelName.md b/samples/client/petstore/ruby-faraday/docs/SpecialModelName.md index 581ab6907ef..498ab811683 100644 --- a/samples/client/petstore/ruby-faraday/docs/SpecialModelName.md +++ b/samples/client/petstore/ruby-faraday/docs/SpecialModelName.md @@ -1,8 +1,17 @@ # Petstore::SpecialModelName ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **special_property_name** | **Integer** | | [optional] +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::SpecialModelName.new(special_property_name: null) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/StoreApi.md b/samples/client/petstore/ruby-faraday/docs/StoreApi.md index 2ebdc4ddc0e..83cb89664a6 100644 --- a/samples/client/petstore/ruby-faraday/docs/StoreApi.md +++ b/samples/client/petstore/ruby-faraday/docs/StoreApi.md @@ -10,7 +10,9 @@ Method | HTTP request | Description [**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet -# **delete_order** + +## delete_order + > delete_order(order_id) Delete purchase order by ID @@ -18,6 +20,7 @@ Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors ### Example + ```ruby # load the gem require 'petstore' @@ -35,6 +38,7 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **order_id** | **String**| ID of the order that needs to be deleted | @@ -49,12 +53,12 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined +## get_inventory -# **get_inventory** > Hash<String, Integer> get_inventory Returns pet inventories by status @@ -62,6 +66,7 @@ Returns pet inventories by status Returns a map of status codes to quantities ### Example + ```ruby # load the gem require 'petstore' @@ -85,6 +90,7 @@ end ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -97,12 +103,12 @@ This endpoint does not need any parameter. ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_order_by_id -# **get_order_by_id** > Order get_order_by_id(order_id) Find purchase order by ID @@ -110,6 +116,7 @@ Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions ### Example + ```ruby # load the gem require 'petstore' @@ -128,6 +135,7 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **order_id** | **Integer**| ID of pet that needs to be fetched | @@ -142,27 +150,28 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json +## place_order -# **place_order** -> Order place_order(order) +> Order place_order(body) Place an order for a pet ### Example + ```ruby # load the gem require 'petstore' api_instance = Petstore::StoreApi.new -order = Petstore::Order.new # Order | order placed for purchasing the pet +body = Petstore::Order.new # Order | order placed for purchasing the pet begin #Place an order for a pet - result = api_instance.place_order(order) + result = api_instance.place_order(body) p result rescue Petstore::ApiError => e puts "Exception when calling StoreApi->place_order: #{e}" @@ -171,9 +180,10 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | + **body** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -185,8 +195,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json diff --git a/samples/client/petstore/ruby-faraday/docs/Tag.md b/samples/client/petstore/ruby-faraday/docs/Tag.md index 5bd94d6c04e..54a66a3f294 100644 --- a/samples/client/petstore/ruby-faraday/docs/Tag.md +++ b/samples/client/petstore/ruby-faraday/docs/Tag.md @@ -1,9 +1,19 @@ # Petstore::Tag ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Integer** | | [optional] **name** | **String** | | [optional] +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::Tag.new(id: null, + name: null) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/TypeHolderDefault.md b/samples/client/petstore/ruby-faraday/docs/TypeHolderDefault.md new file mode 100644 index 00000000000..5abe52ff5c5 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/TypeHolderDefault.md @@ -0,0 +1,25 @@ +# Petstore::TypeHolderDefault + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string_item** | **String** | | [default to 'what'] +**number_item** | **Float** | | +**integer_item** | **Integer** | | +**bool_item** | **Boolean** | | [default to true] +**array_item** | **Array<Integer>** | | + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::TypeHolderDefault.new(string_item: null, + number_item: null, + integer_item: null, + bool_item: null, + array_item: null) +``` + + diff --git a/samples/client/petstore/ruby-faraday/docs/TypeHolderExample.md b/samples/client/petstore/ruby-faraday/docs/TypeHolderExample.md new file mode 100644 index 00000000000..92dfed0300c --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/TypeHolderExample.md @@ -0,0 +1,25 @@ +# Petstore::TypeHolderExample + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string_item** | **String** | | +**number_item** | **Float** | | +**integer_item** | **Integer** | | +**bool_item** | **Boolean** | | +**array_item** | **Array<Integer>** | | + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::TypeHolderExample.new(string_item: what, + number_item: 1.234, + integer_item: -2, + bool_item: true, + array_item: [0, 1, 2, 3]) +``` + + diff --git a/samples/client/petstore/ruby-faraday/docs/User.md b/samples/client/petstore/ruby-faraday/docs/User.md index bd76116e023..263e9604662 100644 --- a/samples/client/petstore/ruby-faraday/docs/User.md +++ b/samples/client/petstore/ruby-faraday/docs/User.md @@ -1,6 +1,7 @@ # Petstore::User ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Integer** | | [optional] @@ -12,4 +13,19 @@ Name | Type | Description | Notes **phone** | **String** | | [optional] **user_status** | **Integer** | User Status | [optional] +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::User.new(id: null, + username: null, + first_name: null, + last_name: null, + email: null, + password: null, + phone: null, + user_status: null) +``` + diff --git a/samples/client/petstore/ruby-faraday/docs/UserApi.md b/samples/client/petstore/ruby-faraday/docs/UserApi.md index ae8f3fad0f1..49a57ef5849 100644 --- a/samples/client/petstore/ruby-faraday/docs/UserApi.md +++ b/samples/client/petstore/ruby-faraday/docs/UserApi.md @@ -14,24 +14,27 @@ Method | HTTP request | Description [**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user -# **create_user** -> create_user(user) + +## create_user + +> create_user(body) Create user This can only be done by the logged in user. ### Example + ```ruby # load the gem require 'petstore' api_instance = Petstore::UserApi.new -user = Petstore::User.new # User | Created user object +body = Petstore::User.new # User | Created user object begin #Create user - api_instance.create_user(user) + api_instance.create_user(body) rescue Petstore::ApiError => e puts "Exception when calling UserApi->create_user: #{e}" end @@ -39,9 +42,10 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | + **body** | [**User**](User.md)| Created user object | ### Return type @@ -53,27 +57,28 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined +## create_users_with_array_input -# **create_users_with_array_input** -> create_users_with_array_input(user) +> create_users_with_array_input(body) Creates list of users with given input array ### Example + ```ruby # load the gem require 'petstore' api_instance = Petstore::UserApi.new -user = nil # Array | List of user object +body = [Petstore::User.new] # Array | List of user object begin #Creates list of users with given input array - api_instance.create_users_with_array_input(user) + api_instance.create_users_with_array_input(body) rescue Petstore::ApiError => e puts "Exception when calling UserApi->create_users_with_array_input: #{e}" end @@ -81,9 +86,10 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**Array<User>**](Array.md)| List of user object | + **body** | [**Array<User>**](User.md)| List of user object | ### Return type @@ -95,27 +101,28 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined +## create_users_with_list_input -# **create_users_with_list_input** -> create_users_with_list_input(user) +> create_users_with_list_input(body) Creates list of users with given input array ### Example + ```ruby # load the gem require 'petstore' api_instance = Petstore::UserApi.new -user = nil # Array | List of user object +body = [Petstore::User.new] # Array | List of user object begin #Creates list of users with given input array - api_instance.create_users_with_list_input(user) + api_instance.create_users_with_list_input(body) rescue Petstore::ApiError => e puts "Exception when calling UserApi->create_users_with_list_input: #{e}" end @@ -123,9 +130,10 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**Array<User>**](Array.md)| List of user object | + **body** | [**Array<User>**](User.md)| List of user object | ### Return type @@ -137,12 +145,12 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined +## delete_user -# **delete_user** > delete_user(username) Delete user @@ -150,6 +158,7 @@ Delete user This can only be done by the logged in user. ### Example + ```ruby # load the gem require 'petstore' @@ -167,6 +176,7 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The name that needs to be deleted | @@ -181,17 +191,18 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined +## get_user_by_name -# **get_user_by_name** > User get_user_by_name(username) Get user by user name ### Example + ```ruby # load the gem require 'petstore' @@ -210,6 +221,7 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The name that needs to be fetched. Use user1 for testing. | @@ -224,17 +236,18 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json +## login_user -# **login_user** > String login_user(username, password) Logs user into the system ### Example + ```ruby # load the gem require 'petstore' @@ -254,6 +267,7 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The user name for login | @@ -269,17 +283,18 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json +## logout_user -# **logout_user** > logout_user Logs out current logged in user session ### Example + ```ruby # load the gem require 'petstore' @@ -295,6 +310,7 @@ end ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -307,30 +323,31 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined +## update_user -# **update_user** -> update_user(username, user) +> update_user(username, body) Updated user This can only be done by the logged in user. ### Example + ```ruby # load the gem require 'petstore' api_instance = Petstore::UserApi.new username = 'username_example' # String | name that need to be deleted -user = Petstore::User.new # User | Updated user object +body = Petstore::User.new # User | Updated user object begin #Updated user - api_instance.update_user(username, user) + api_instance.update_user(username, body) rescue Petstore::ApiError => e puts "Exception when calling UserApi->update_user: #{e}" end @@ -338,10 +355,11 @@ end ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | - **user** | [**User**](User.md)| Updated user object | + **body** | [**User**](User.md)| Updated user object | ### Return type @@ -353,8 +371,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined - - +- **Content-Type**: Not defined +- **Accept**: Not defined diff --git a/samples/client/petstore/ruby-faraday/docs/XmlItem.md b/samples/client/petstore/ruby-faraday/docs/XmlItem.md new file mode 100644 index 00000000000..5520ae0c2bc --- /dev/null +++ b/samples/client/petstore/ruby-faraday/docs/XmlItem.md @@ -0,0 +1,73 @@ +# Petstore::XmlItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attribute_string** | **String** | | [optional] +**attribute_number** | **Float** | | [optional] +**attribute_integer** | **Integer** | | [optional] +**attribute_boolean** | **Boolean** | | [optional] +**wrapped_array** | **Array<Integer>** | | [optional] +**name_string** | **String** | | [optional] +**name_number** | **Float** | | [optional] +**name_integer** | **Integer** | | [optional] +**name_boolean** | **Boolean** | | [optional] +**name_array** | **Array<Integer>** | | [optional] +**name_wrapped_array** | **Array<Integer>** | | [optional] +**prefix_string** | **String** | | [optional] +**prefix_number** | **Float** | | [optional] +**prefix_integer** | **Integer** | | [optional] +**prefix_boolean** | **Boolean** | | [optional] +**prefix_array** | **Array<Integer>** | | [optional] +**prefix_wrapped_array** | **Array<Integer>** | | [optional] +**namespace_string** | **String** | | [optional] +**namespace_number** | **Float** | | [optional] +**namespace_integer** | **Integer** | | [optional] +**namespace_boolean** | **Boolean** | | [optional] +**namespace_array** | **Array<Integer>** | | [optional] +**namespace_wrapped_array** | **Array<Integer>** | | [optional] +**prefix_ns_string** | **String** | | [optional] +**prefix_ns_number** | **Float** | | [optional] +**prefix_ns_integer** | **Integer** | | [optional] +**prefix_ns_boolean** | **Boolean** | | [optional] +**prefix_ns_array** | **Array<Integer>** | | [optional] +**prefix_ns_wrapped_array** | **Array<Integer>** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::XmlItem.new(attribute_string: string, + attribute_number: 1.234, + attribute_integer: -2, + attribute_boolean: true, + wrapped_array: null, + name_string: string, + name_number: 1.234, + name_integer: -2, + name_boolean: true, + name_array: null, + name_wrapped_array: null, + prefix_string: string, + prefix_number: 1.234, + prefix_integer: -2, + prefix_boolean: true, + prefix_array: null, + prefix_wrapped_array: null, + namespace_string: string, + namespace_number: 1.234, + namespace_integer: -2, + namespace_boolean: true, + namespace_array: null, + namespace_wrapped_array: null, + prefix_ns_string: string, + prefix_ns_number: 1.234, + prefix_ns_integer: -2, + prefix_ns_boolean: true, + prefix_ns_array: null, + prefix_ns_wrapped_array: null) +``` + + diff --git a/samples/client/petstore/ruby-faraday/lib/petstore.rb b/samples/client/petstore/ruby-faraday/lib/petstore.rb index 63c881c52fd..52e3ec87247 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -17,19 +17,27 @@ require 'petstore/version' require 'petstore/configuration' # Models +require 'petstore/models/additional_properties_any_type' +require 'petstore/models/additional_properties_array' +require 'petstore/models/additional_properties_boolean' require 'petstore/models/additional_properties_class' +require 'petstore/models/additional_properties_integer' +require 'petstore/models/additional_properties_number' +require 'petstore/models/additional_properties_object' +require 'petstore/models/additional_properties_string' require 'petstore/models/animal' -require 'petstore/models/animal_farm' require 'petstore/models/api_response' require 'petstore/models/array_of_array_of_number_only' require 'petstore/models/array_of_number_only' require 'petstore/models/array_test' require 'petstore/models/capitalization' require 'petstore/models/cat' +require 'petstore/models/cat_all_of' require 'petstore/models/category' require 'petstore/models/class_model' require 'petstore/models/client' require 'petstore/models/dog' +require 'petstore/models/dog_all_of' require 'petstore/models/enum_arrays' require 'petstore/models/enum_class' require 'petstore/models/enum_test' @@ -50,9 +58,11 @@ require 'petstore/models/outer_enum' require 'petstore/models/pet' require 'petstore/models/read_only_first' require 'petstore/models/special_model_name' -require 'petstore/models/string_boolean_map' require 'petstore/models/tag' +require 'petstore/models/type_holder_default' +require 'petstore/models/type_holder_example' require 'petstore/models/user' +require 'petstore/models/xml_item' # APIs require 'petstore/api/another_fake_api' diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb index 71fb17eeb8a..36e3ce59b85 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb @@ -3,14 +3,14 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end -require 'uri' +require 'cgi' module Petstore class AnotherFakeApi @@ -21,58 +21,66 @@ module Petstore end # To test special tags # To test special tags and operation ID starting with number - # @param client client model + # @param body [Client] client model # @param [Hash] opts the optional parameters # @return [Client] - def call_123_test_special_tags(client, opts = {}) - data, _status_code, _headers = call_123_test_special_tags_with_http_info(client, opts) + def call_123_test_special_tags(body, opts = {}) + data, _status_code, _headers = call_123_test_special_tags_with_http_info(body, opts) data end # To test special tags # To test special tags and operation ID starting with number - # @param client client model + # @param body [Client] client model # @param [Hash] opts the optional parameters - # @return [Array<(Client, Fixnum, Hash)>] Client data, response status code and response headers - def call_123_test_special_tags_with_http_info(client, opts = {}) + # @return [Array<(Client, Integer, Hash)>] Client data, response status code and response headers + def call_123_test_special_tags_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AnotherFakeApi.call_123_test_special_tags ...' end - # verify the required parameter 'client' is set - if @api_client.config.client_side_validation && client.nil? - fail ArgumentError, "Missing the required parameter 'client' when calling AnotherFakeApi.call_123_test_special_tags" + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AnotherFakeApi.call_123_test_special_tags" end # resource path local_var_path = '/another-fake/dummy' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(client) - auth_names = [] - data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] || 'Client' + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'Client') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AnotherFakeApi#call_123_test_special_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb index b4de2621434..72d18ee7ae0 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb @@ -3,14 +3,14 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end -require 'uri' +require 'cgi' module Petstore class FakeApi @@ -19,10 +19,72 @@ module Petstore def initialize(api_client = ApiClient.default) @api_client = api_client end + # creates an XmlItem + # this route creates an XmlItem + # @param xml_item [XmlItem] XmlItem Body + # @param [Hash] opts the optional parameters + # @return [nil] + def create_xml_item(xml_item, opts = {}) + create_xml_item_with_http_info(xml_item, opts) + nil + end + + # creates an XmlItem + # this route creates an XmlItem + # @param xml_item [XmlItem] XmlItem Body + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def create_xml_item_with_http_info(xml_item, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.create_xml_item ...' + 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 + # resource path + local_var_path = '/fake/create_xml_item' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/xml', 'application/xml; charset=utf-8', 'application/xml; charset=utf-16', 'text/xml', 'text/xml; charset=utf-8', 'text/xml; charset=utf-16']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(xml_item) + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#create_xml_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Test serialization of outer boolean types # @param [Hash] opts the optional parameters - # @option opts [BOOLEAN] :body Input boolean as post body - # @return [BOOLEAN] + # @option opts [Boolean] :body Input boolean as post body + # @return [Boolean] def fake_outer_boolean_serialize(opts = {}) data, _status_code, _headers = fake_outer_boolean_serialize_with_http_info(opts) data @@ -30,8 +92,8 @@ module Petstore # Test serialization of outer boolean types # @param [Hash] opts the optional parameters - # @option opts [BOOLEAN] :body Input boolean as post body - # @return [Array<(BOOLEAN, Fixnum, Hash)>] BOOLEAN data, response status code and response headers + # @option opts [Boolean] :body Input boolean as post body + # @return [Array<(Boolean, Integer, Hash)>] Boolean data, response status code and response headers def fake_outer_boolean_serialize_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeApi.fake_outer_boolean_serialize ...' @@ -40,26 +102,35 @@ module Petstore local_var_path = '/fake/outer/boolean' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(opts[:'body']) - auth_names = [] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body']) + + # return_type + return_type = opts[:return_type] || 'Boolean' + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'BOOLEAN') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FakeApi#fake_outer_boolean_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -68,7 +139,7 @@ module Petstore # Test serialization of object with outer number type # @param [Hash] opts the optional parameters - # @option opts [OuterComposite] :outer_composite Input composite as post body + # @option opts [OuterComposite] :body Input composite as post body # @return [OuterComposite] def fake_outer_composite_serialize(opts = {}) data, _status_code, _headers = fake_outer_composite_serialize_with_http_info(opts) @@ -77,8 +148,8 @@ module Petstore # Test serialization of object with outer number type # @param [Hash] opts the optional parameters - # @option opts [OuterComposite] :outer_composite Input composite as post body - # @return [Array<(OuterComposite, Fixnum, Hash)>] OuterComposite data, response status code and response headers + # @option opts [OuterComposite] :body Input composite as post body + # @return [Array<(OuterComposite, Integer, Hash)>] OuterComposite data, response status code and response headers def fake_outer_composite_serialize_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeApi.fake_outer_composite_serialize ...' @@ -87,26 +158,35 @@ module Petstore local_var_path = '/fake/outer/composite' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(opts[:'outer_composite']) - auth_names = [] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body']) + + # return_type + return_type = opts[:return_type] || 'OuterComposite' + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'OuterComposite') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FakeApi#fake_outer_composite_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -125,7 +205,7 @@ module Petstore # Test serialization of outer number types # @param [Hash] opts the optional parameters # @option opts [Float] :body Input number as post body - # @return [Array<(Float, Fixnum, Hash)>] Float data, response status code and response headers + # @return [Array<(Float, Integer, Hash)>] Float data, response status code and response headers def fake_outer_number_serialize_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeApi.fake_outer_number_serialize ...' @@ -134,26 +214,35 @@ module Petstore local_var_path = '/fake/outer/number' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(opts[:'body']) - auth_names = [] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body']) + + # return_type + return_type = opts[:return_type] || 'Float' + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'Float') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FakeApi#fake_outer_number_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -172,7 +261,7 @@ module Petstore # Test serialization of outer string types # @param [Hash] opts the optional parameters # @option opts [String] :body Input string as post body - # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers + # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers def fake_outer_string_serialize_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeApi.fake_outer_string_serialize ...' @@ -181,26 +270,35 @@ module Petstore local_var_path = '/fake/outer/string' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(opts[:'body']) - auth_names = [] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body']) + + # return_type + return_type = opts[:return_type] || 'String' + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'String') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FakeApi#fake_outer_string_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -208,69 +306,79 @@ module Petstore end # For this test, the body for this request much reference a schema named `File`. - # @param file_schema_test_class + # @param body [FileSchemaTestClass] # @param [Hash] opts the optional parameters # @return [nil] - def test_body_with_file_schema(file_schema_test_class, opts = {}) - test_body_with_file_schema_with_http_info(file_schema_test_class, opts) + def test_body_with_file_schema(body, opts = {}) + test_body_with_file_schema_with_http_info(body, opts) nil end # For this test, the body for this request much reference a schema named `File`. - # @param file_schema_test_class + # @param body [FileSchemaTestClass] # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers - def test_body_with_file_schema_with_http_info(file_schema_test_class, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def test_body_with_file_schema_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeApi.test_body_with_file_schema ...' end - # verify the required parameter 'file_schema_test_class' is set - if @api_client.config.client_side_validation && file_schema_test_class.nil? - fail ArgumentError, "Missing the required parameter 'file_schema_test_class' when calling FakeApi.test_body_with_file_schema" + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling FakeApi.test_body_with_file_schema" end # resource path local_var_path = '/fake/body-with-file-schema' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - 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_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(file_schema_test_class) - auth_names = [] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FakeApi#test_body_with_file_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # @param query - # @param user + # @param query [String] + # @param body [User] # @param [Hash] opts the optional parameters # @return [nil] - def test_body_with_query_params(query, user, opts = {}) - test_body_with_query_params_with_http_info(query, user, opts) + def test_body_with_query_params(query, body, opts = {}) + test_body_with_query_params_with_http_info(query, body, opts) nil end - # @param query - # @param user + # @param query [String] + # @param body [User] # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers - def test_body_with_query_params_with_http_info(query, user, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def test_body_with_query_params_with_http_info(query, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeApi.test_body_with_query_params ...' end @@ -278,34 +386,44 @@ module Petstore if @api_client.config.client_side_validation && query.nil? fail ArgumentError, "Missing the required parameter 'query' when calling FakeApi.test_body_with_query_params" end - # verify the required parameter 'user' is set - if @api_client.config.client_side_validation && user.nil? - fail ArgumentError, "Missing the required parameter 'user' when calling FakeApi.test_body_with_query_params" + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling FakeApi.test_body_with_query_params" end # resource path local_var_path = '/fake/body-with-query-params' # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'query'] = query # header parameters - 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_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(user) - auth_names = [] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FakeApi#test_body_with_query_params\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -314,53 +432,62 @@ module Petstore # To test \"client\" model # To test \"client\" model - # @param client client model + # @param body [Client] client model # @param [Hash] opts the optional parameters # @return [Client] - def test_client_model(client, opts = {}) - data, _status_code, _headers = test_client_model_with_http_info(client, opts) + def test_client_model(body, opts = {}) + data, _status_code, _headers = test_client_model_with_http_info(body, opts) data end # To test \"client\" model # To test \"client\" model - # @param client client model + # @param body [Client] client model # @param [Hash] opts the optional parameters - # @return [Array<(Client, Fixnum, Hash)>] Client data, response status code and response headers - def test_client_model_with_http_info(client, opts = {}) + # @return [Array<(Client, Integer, Hash)>] Client data, response status code and response headers + def test_client_model_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeApi.test_client_model ...' end - # verify the required parameter 'client' is set - if @api_client.config.client_side_validation && client.nil? - fail ArgumentError, "Missing the required parameter 'client' when calling FakeApi.test_client_model" + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling FakeApi.test_client_model" end # resource path local_var_path = '/fake' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(client) - auth_names = [] - data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] || 'Client' + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'Client') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FakeApi#test_client_model\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -369,10 +496,10 @@ module Petstore # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - # @param number None - # @param double None - # @param pattern_without_delimiter None - # @param byte None + # @param number [Float] None + # @param double [Float] None + # @param pattern_without_delimiter [String] None + # @param byte [String] None # @param [Hash] opts the optional parameters # @option opts [Integer] :integer None # @option opts [Integer] :int32 None @@ -392,10 +519,10 @@ module Petstore # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - # @param number None - # @param double None - # @param pattern_without_delimiter None - # @param byte None + # @param number [Float] None + # @param double [Float] None + # @param pattern_without_delimiter [String] None + # @param byte [String] None # @param [Hash] opts the optional parameters # @option opts [Integer] :integer None # @option opts [Integer] :int32 None @@ -407,7 +534,7 @@ module Petstore # @option opts [DateTime] :date_time None # @option opts [String] :password None # @option opts [String] :callback None - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeApi.test_endpoint_parameters ...' @@ -440,8 +567,9 @@ module Petstore if @api_client.config.client_side_validation && pattern_without_delimiter.nil? fail ArgumentError, "Missing the required parameter 'pattern_without_delimiter' when calling FakeApi.test_endpoint_parameters" end - if @api_client.config.client_side_validation && pattern_without_delimiter !~ Regexp.new(/^[A-Z].*/) - fail ArgumentError, "invalid value for 'pattern_without_delimiter' when calling FakeApi.test_endpoint_parameters, must conform to the pattern /^[A-Z].*/." + pattern = Regexp.new(/^[A-Z].*/) + if @api_client.config.client_side_validation && pattern_without_delimiter !~ pattern + fail ArgumentError, "invalid value for 'pattern_without_delimiter' when calling FakeApi.test_endpoint_parameters, must conform to the pattern #{pattern}." end # verify the required parameter 'byte' is set @@ -468,8 +596,9 @@ module Petstore fail ArgumentError, 'invalid value for "opts[:"float"]" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 987.6.' end - if @api_client.config.client_side_validation && !opts[:'string'].nil? && opts[:'string'] !~ Regexp.new(/[a-z]/i) - fail ArgumentError, "invalid value for 'opts[:\"string\"]' when calling FakeApi.test_endpoint_parameters, must conform to the pattern /[a-z]/i." + pattern = Regexp.new(/[a-z]/i) + if @api_client.config.client_side_validation && !opts[:'string'].nil? && opts[:'string'] !~ pattern + fail ArgumentError, "invalid value for 'opts[:\"string\"]' when calling FakeApi.test_endpoint_parameters, must conform to the pattern #{pattern}." end if @api_client.config.client_side_validation && !opts[:'password'].nil? && opts[:'password'].to_s.length > 64 @@ -484,15 +613,15 @@ module Petstore local_var_path = '/fake' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} form_params['number'] = number form_params['double'] = double form_params['pattern_without_delimiter'] = pattern_without_delimiter @@ -509,14 +638,24 @@ module Petstore form_params['callback'] = opts[:'callback'] if !opts[:'callback'].nil? # http body (model) - post_body = nil - auth_names = ['http_basic_test'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || ['http_basic_test'] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FakeApi#test_endpoint_parameters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -551,66 +690,84 @@ module Petstore # @option opts [Float] :enum_query_double Query parameter enum test (double) # @option opts [Array] :enum_form_string_array Form parameter enum test (string array) # @option opts [String] :enum_form_string Form parameter enum test (string) - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def test_enum_parameters_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeApi.test_enum_parameters ...' end - if @api_client.config.client_side_validation && opts[:'enum_header_string_array'] && !opts[:'enum_header_string_array'].all? { |item| ['>', '$'].include?(item) } - fail ArgumentError, 'invalid value for "enum_header_string_array", must include one of >, $' + allowable_values = [">", "$"] + if @api_client.config.client_side_validation && opts[:'enum_header_string_array'] && !opts[:'enum_header_string_array'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"enum_header_string_array\", must include one of #{allowable_values}" end - if @api_client.config.client_side_validation && opts[:'enum_header_string'] && !['_abc', '-efg', '(xyz)'].include?(opts[:'enum_header_string']) - fail ArgumentError, 'invalid value for "enum_header_string", must be one of _abc, -efg, (xyz)' + allowable_values = ["_abc", "-efg", "(xyz)"] + if @api_client.config.client_side_validation && opts[:'enum_header_string'] && !allowable_values.include?(opts[:'enum_header_string']) + fail ArgumentError, "invalid value for \"enum_header_string\", must be one of #{allowable_values}" end - if @api_client.config.client_side_validation && opts[:'enum_query_string_array'] && !opts[:'enum_query_string_array'].all? { |item| ['>', '$'].include?(item) } - fail ArgumentError, 'invalid value for "enum_query_string_array", must include one of >, $' + allowable_values = [">", "$"] + if @api_client.config.client_side_validation && opts[:'enum_query_string_array'] && !opts[:'enum_query_string_array'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"enum_query_string_array\", must include one of #{allowable_values}" end - if @api_client.config.client_side_validation && opts[:'enum_query_string'] && !['_abc', '-efg', '(xyz)'].include?(opts[:'enum_query_string']) - fail ArgumentError, 'invalid value for "enum_query_string", must be one of _abc, -efg, (xyz)' + allowable_values = ["_abc", "-efg", "(xyz)"] + if @api_client.config.client_side_validation && opts[:'enum_query_string'] && !allowable_values.include?(opts[:'enum_query_string']) + fail ArgumentError, "invalid value for \"enum_query_string\", must be one of #{allowable_values}" end - if @api_client.config.client_side_validation && opts[:'enum_query_integer'] && !['1', '-2'].include?(opts[:'enum_query_integer']) - fail ArgumentError, 'invalid value for "enum_query_integer", must be one of 1, -2' + allowable_values = [1, -2] + if @api_client.config.client_side_validation && opts[:'enum_query_integer'] && !allowable_values.include?(opts[:'enum_query_integer']) + fail ArgumentError, "invalid value for \"enum_query_integer\", must be one of #{allowable_values}" end - if @api_client.config.client_side_validation && opts[:'enum_query_double'] && !['1.1', '-1.2'].include?(opts[:'enum_query_double']) - fail ArgumentError, 'invalid value for "enum_query_double", must be one of 1.1, -1.2' + allowable_values = [1.1, -1.2] + if @api_client.config.client_side_validation && opts[:'enum_query_double'] && !allowable_values.include?(opts[:'enum_query_double']) + fail ArgumentError, "invalid value for \"enum_query_double\", must be one of #{allowable_values}" end - if @api_client.config.client_side_validation && opts[:'enum_form_string_array'] && !opts[:'enum_form_string_array'].all? { |item| ['>', '$'].include?(item) } - fail ArgumentError, 'invalid value for "enum_form_string_array", must include one of >, $' + allowable_values = [">", "$"] + if @api_client.config.client_side_validation && opts[:'enum_form_string_array'] && !opts[:'enum_form_string_array'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"enum_form_string_array\", must include one of #{allowable_values}" end - if @api_client.config.client_side_validation && opts[:'enum_form_string'] && !['_abc', '-efg', '(xyz)'].include?(opts[:'enum_form_string']) - fail ArgumentError, 'invalid value for "enum_form_string", must be one of _abc, -efg, (xyz)' + allowable_values = ["_abc", "-efg", "(xyz)"] + if @api_client.config.client_side_validation && opts[:'enum_form_string'] && !allowable_values.include?(opts[:'enum_form_string']) + fail ArgumentError, "invalid value for \"enum_form_string\", must be one of #{allowable_values}" end # resource path local_var_path = '/fake' # query parameters - query_params = {} + 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'] = opts[:'enum_query_string'] if !opts[:'enum_query_string'].nil? query_params[:'enum_query_integer'] = opts[:'enum_query_integer'] if !opts[:'enum_query_integer'].nil? query_params[:'enum_query_double'] = opts[:'enum_query_double'] if !opts[:'enum_query_double'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) header_params[:'enum_header_string_array'] = @api_client.build_collection_param(opts[:'enum_header_string_array'], :csv) if !opts[:'enum_header_string_array'].nil? header_params[:'enum_header_string'] = opts[:'enum_header_string'] if !opts[:'enum_header_string'].nil? # form parameters - form_params = {} + form_params = opts[:form_params] || {} form_params['enum_form_string_array'] = @api_client.build_collection_param(opts[:'enum_form_string_array'], :csv) if !opts[:'enum_form_string_array'].nil? form_params['enum_form_string'] = opts[:'enum_form_string'] if !opts[:'enum_form_string'].nil? # http body (model) - post_body = nil - auth_names = [] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FakeApi#test_enum_parameters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -619,12 +776,12 @@ module Petstore # Fake endpoint to test group parameters (optional) # Fake endpoint to test group parameters (optional) - # @param required_string_group Required String in group parameters - # @param required_boolean_group Required Boolean in group parameters - # @param required_int64_group Required Integer in group parameters + # @param required_string_group [Integer] Required String in group parameters + # @param required_boolean_group [Boolean] Required Boolean in group parameters + # @param required_int64_group [Integer] Required Integer in group parameters # @param [Hash] opts the optional parameters # @option opts [Integer] :string_group String in group parameters - # @option opts [BOOLEAN] :boolean_group Boolean in group parameters + # @option opts [Boolean] :boolean_group Boolean in group parameters # @option opts [Integer] :int64_group Integer in group parameters # @return [nil] def test_group_parameters(required_string_group, required_boolean_group, required_int64_group, opts = {}) @@ -634,14 +791,14 @@ module Petstore # Fake endpoint to test group parameters (optional) # Fake endpoint to test group parameters (optional) - # @param required_string_group Required String in group parameters - # @param required_boolean_group Required Boolean in group parameters - # @param required_int64_group Required Integer in group parameters + # @param required_string_group [Integer] Required String in group parameters + # @param required_boolean_group [Boolean] Required Boolean in group parameters + # @param required_int64_group [Integer] Required Integer in group parameters # @param [Hash] opts the optional parameters # @option opts [Integer] :string_group String in group parameters - # @option opts [BOOLEAN] :boolean_group Boolean in group parameters + # @option opts [Boolean] :boolean_group Boolean in group parameters # @option opts [Integer] :int64_group Integer in group parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeApi.test_group_parameters ...' @@ -662,29 +819,39 @@ module Petstore local_var_path = '/fake' # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'required_string_group'] = required_string_group query_params[:'required_int64_group'] = required_int64_group query_params[:'string_group'] = opts[:'string_group'] if !opts[:'string_group'].nil? query_params[:'int64_group'] = opts[:'int64_group'] if !opts[:'int64_group'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} header_params[:'required_boolean_group'] = required_boolean_group header_params[:'boolean_group'] = opts[:'boolean_group'] if !opts[:'boolean_group'].nil? # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = [] - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FakeApi#test_group_parameters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -692,49 +859,59 @@ module Petstore end # test inline additionalProperties - # @param request_body request body + # @param param [Hash] request body # @param [Hash] opts the optional parameters # @return [nil] - def test_inline_additional_properties(request_body, opts = {}) - test_inline_additional_properties_with_http_info(request_body, opts) + def test_inline_additional_properties(param, opts = {}) + test_inline_additional_properties_with_http_info(param, opts) nil end # test inline additionalProperties - # @param request_body request body + # @param param [Hash] request body # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers - def test_inline_additional_properties_with_http_info(request_body, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def test_inline_additional_properties_with_http_info(param, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeApi.test_inline_additional_properties ...' end - # verify the required parameter 'request_body' is set - if @api_client.config.client_side_validation && request_body.nil? - fail ArgumentError, "Missing the required parameter 'request_body' when calling FakeApi.test_inline_additional_properties" + # verify the required parameter 'param' is set + if @api_client.config.client_side_validation && param.nil? + fail ArgumentError, "Missing the required parameter 'param' when calling FakeApi.test_inline_additional_properties" end # resource path local_var_path = '/fake/inline-additionalProperties' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - 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_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(request_body) - auth_names = [] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:body] || @api_client.object_to_http_body(param) + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FakeApi#test_inline_additional_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -742,8 +919,8 @@ module Petstore end # test json serialization of form data - # @param param field1 - # @param param2 field2 + # @param param [String] field1 + # @param param2 [String] field2 # @param [Hash] opts the optional parameters # @return [nil] def test_json_form_data(param, param2, opts = {}) @@ -752,10 +929,10 @@ module Petstore end # test json serialization of form data - # @param param field1 - # @param param2 field2 + # @param param [String] field1 + # @param param2 [String] field2 # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def test_json_form_data_with_http_info(param, param2, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeApi.test_json_form_data ...' @@ -772,32 +949,41 @@ module Petstore local_var_path = '/fake/jsonFormData' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} form_params['param'] = param form_params['param2'] = param2 # http body (model) - post_body = nil - auth_names = [] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FakeApi#test_json_form_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb index e9aff0ba146..689a1beaebd 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb @@ -3,14 +3,14 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end -require 'uri' +require 'cgi' module Petstore class FakeClassnameTags123Api @@ -21,58 +21,66 @@ module Petstore end # To test class name in snake case # To test class name in snake case - # @param client client model + # @param body [Client] client model # @param [Hash] opts the optional parameters # @return [Client] - def test_classname(client, opts = {}) - data, _status_code, _headers = test_classname_with_http_info(client, opts) + def test_classname(body, opts = {}) + data, _status_code, _headers = test_classname_with_http_info(body, opts) data end # To test class name in snake case # To test class name in snake case - # @param client client model + # @param body [Client] client model # @param [Hash] opts the optional parameters - # @return [Array<(Client, Fixnum, Hash)>] Client data, response status code and response headers - def test_classname_with_http_info(client, opts = {}) + # @return [Array<(Client, Integer, Hash)>] Client data, response status code and response headers + def test_classname_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FakeClassnameTags123Api.test_classname ...' end - # verify the required parameter 'client' is set - if @api_client.config.client_side_validation && client.nil? - fail ArgumentError, "Missing the required parameter 'client' when calling FakeClassnameTags123Api.test_classname" + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling FakeClassnameTags123Api.test_classname" end # resource path local_var_path = '/fake_classname_test' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(client) - auth_names = ['api_key_query'] - data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] || 'Client' + + # auth_names + auth_names = opts[:auth_names] || ['api_key_query'] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'Client') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FakeClassnameTags123Api#test_classname\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb index 0dc4ac1f3c5..65039a8af5d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb @@ -3,14 +3,14 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end -require 'uri' +require 'cgi' module Petstore class PetApi @@ -20,49 +20,59 @@ module Petstore @api_client = api_client end # Add a new pet to the store - # @param pet Pet object that needs to be added to the store + # @param body [Pet] Pet object that needs to be added to the store # @param [Hash] opts the optional parameters # @return [nil] - def add_pet(pet, opts = {}) - add_pet_with_http_info(pet, opts) + def add_pet(body, opts = {}) + add_pet_with_http_info(body, opts) nil end # Add a new pet to the store - # @param pet Pet object that needs to be added to the store + # @param body [Pet] Pet object that needs to be added to the store # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers - def add_pet_with_http_info(pet, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def add_pet_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PetApi.add_pet ...' end - # verify the required parameter 'pet' is set - if @api_client.config.client_side_validation && pet.nil? - fail ArgumentError, "Missing the required parameter 'pet' when calling PetApi.add_pet" + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling PetApi.add_pet" end # resource path local_var_path = '/pet' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(pet) - auth_names = ['petstore_auth'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || ['petstore_auth'] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PetApi#add_pet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -70,7 +80,7 @@ module Petstore end # Deletes a pet - # @param pet_id Pet id to delete + # @param pet_id [Integer] Pet id to delete # @param [Hash] opts the optional parameters # @option opts [String] :api_key # @return [nil] @@ -80,10 +90,10 @@ module Petstore end # Deletes a pet - # @param pet_id Pet id to delete + # @param pet_id [Integer] Pet id to delete # @param [Hash] opts the optional parameters # @option opts [String] :api_key - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_pet_with_http_info(pet_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PetApi.delete_pet ...' @@ -93,27 +103,37 @@ module Petstore fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.delete_pet" end # resource path - local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', pet_id.to_s) + local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} header_params[:'api_key'] = opts[:'api_key'] if !opts[:'api_key'].nil? # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['petstore_auth'] - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || ['petstore_auth'] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PetApi#delete_pet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -122,7 +142,7 @@ module Petstore # Finds Pets by status # Multiple status values can be provided with comma separated strings - # @param status Status values that need to be considered for filter + # @param status [Array] Status values that need to be considered for filter # @param [Hash] opts the optional parameters # @return [Array] def find_pets_by_status(status, opts = {}) @@ -132,9 +152,9 @@ module Petstore # Finds Pets by status # Multiple status values can be provided with comma separated strings - # @param status Status values that need to be considered for filter + # @param status [Array] Status values that need to be considered for filter # @param [Hash] opts the optional parameters - # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def find_pets_by_status_with_http_info(status, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PetApi.find_pets_by_status ...' @@ -147,27 +167,36 @@ module Petstore local_var_path = '/pet/findByStatus' # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'status'] = @api_client.build_collection_param(status, :csv) # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['petstore_auth'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Array' + + # auth_names + auth_names = opts[:auth_names] || ['petstore_auth'] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'Array') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PetApi#find_pets_by_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -176,7 +205,7 @@ module Petstore # Finds Pets by tags # Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - # @param tags Tags to filter by + # @param tags [Array] Tags to filter by # @param [Hash] opts the optional parameters # @return [Array] def find_pets_by_tags(tags, opts = {}) @@ -186,9 +215,9 @@ module Petstore # Finds Pets by tags # Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - # @param tags Tags to filter by + # @param tags [Array] Tags to filter by # @param [Hash] opts the optional parameters - # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def find_pets_by_tags_with_http_info(tags, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PetApi.find_pets_by_tags ...' @@ -201,27 +230,36 @@ module Petstore local_var_path = '/pet/findByTags' # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'tags'] = @api_client.build_collection_param(tags, :csv) # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['petstore_auth'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Array' + + # auth_names + auth_names = opts[:auth_names] || ['petstore_auth'] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'Array') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PetApi#find_pets_by_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -230,7 +268,7 @@ module Petstore # Find pet by ID # Returns a single pet - # @param pet_id ID of pet to return + # @param pet_id [Integer] ID of pet to return # @param [Hash] opts the optional parameters # @return [Pet] def get_pet_by_id(pet_id, opts = {}) @@ -240,9 +278,9 @@ module Petstore # Find pet by ID # Returns a single pet - # @param pet_id ID of pet to return + # @param pet_id [Integer] ID of pet to return # @param [Hash] opts the optional parameters - # @return [Array<(Pet, Fixnum, Hash)>] Pet data, response status code and response headers + # @return [Array<(Pet, Integer, Hash)>] Pet data, response status code and response headers def get_pet_by_id_with_http_info(pet_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PetApi.get_pet_by_id ...' @@ -252,29 +290,38 @@ module Petstore fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.get_pet_by_id" end # resource path - local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', pet_id.to_s) + local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api_key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Pet' + + # auth_names + auth_names = opts[:auth_names] || ['api_key'] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'Pet') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PetApi#get_pet_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -282,49 +329,59 @@ module Petstore end # Update an existing pet - # @param pet Pet object that needs to be added to the store + # @param body [Pet] Pet object that needs to be added to the store # @param [Hash] opts the optional parameters # @return [nil] - def update_pet(pet, opts = {}) - update_pet_with_http_info(pet, opts) + def update_pet(body, opts = {}) + update_pet_with_http_info(body, opts) nil end # Update an existing pet - # @param pet Pet object that needs to be added to the store + # @param body [Pet] Pet object that needs to be added to the store # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers - def update_pet_with_http_info(pet, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_pet_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PetApi.update_pet ...' end - # verify the required parameter 'pet' is set - if @api_client.config.client_side_validation && pet.nil? - fail ArgumentError, "Missing the required parameter 'pet' when calling PetApi.update_pet" + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling PetApi.update_pet" end # resource path local_var_path = '/pet' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(pet) - auth_names = ['petstore_auth'] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || ['petstore_auth'] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PetApi#update_pet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -332,7 +389,7 @@ module Petstore end # Updates a pet in the store with form data - # @param pet_id ID of pet that needs to be updated + # @param pet_id [Integer] ID of pet that needs to be updated # @param [Hash] opts the optional parameters # @option opts [String] :name Updated name of the pet # @option opts [String] :status Updated status of the pet @@ -343,11 +400,11 @@ module Petstore end # Updates a pet in the store with form data - # @param pet_id ID of pet that needs to be updated + # @param pet_id [Integer] ID of pet that needs to be updated # @param [Hash] opts the optional parameters # @option opts [String] :name Updated name of the pet # @option opts [String] :status Updated status of the pet - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def update_pet_with_form_with_http_info(pet_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PetApi.update_pet_with_form ...' @@ -357,30 +414,40 @@ module Petstore fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.update_pet_with_form" end # resource path - local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', pet_id.to_s) + local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} form_params['name'] = opts[:'name'] if !opts[:'name'].nil? form_params['status'] = opts[:'status'] if !opts[:'status'].nil? # http body (model) - post_body = nil - auth_names = ['petstore_auth'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || ['petstore_auth'] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PetApi#update_pet_with_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -388,7 +455,7 @@ module Petstore end # uploads an image - # @param pet_id ID of pet to update + # @param pet_id [Integer] ID of pet to update # @param [Hash] opts the optional parameters # @option opts [String] :additional_metadata Additional data to pass to server # @option opts [File] :file file to upload @@ -399,11 +466,11 @@ module Petstore end # uploads an image - # @param pet_id ID of pet to update + # @param pet_id [Integer] ID of pet to update # @param [Hash] opts the optional parameters # @option opts [String] :additional_metadata Additional data to pass to server # @option opts [File] :file file to upload - # @return [Array<(ApiResponse, Fixnum, Hash)>] ApiResponse data, response status code and response headers + # @return [Array<(ApiResponse, Integer, Hash)>] ApiResponse data, response status code and response headers def upload_file_with_http_info(pet_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PetApi.upload_file ...' @@ -413,33 +480,42 @@ module Petstore fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.upload_file" end # resource path - local_var_path = '/pet/{petId}/uploadImage'.sub('{' + 'petId' + '}', pet_id.to_s) + local_var_path = '/pet/{petId}/uploadImage'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} form_params['additionalMetadata'] = opts[:'additional_metadata'] if !opts[:'additional_metadata'].nil? form_params['file'] = opts[:'file'] if !opts[:'file'].nil? # http body (model) - post_body = nil - auth_names = ['petstore_auth'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'ApiResponse' + + # auth_names + auth_names = opts[:auth_names] || ['petstore_auth'] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'ApiResponse') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PetApi#upload_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -447,8 +523,8 @@ module Petstore end # uploads an image (required) - # @param pet_id ID of pet to update - # @param required_file file to upload + # @param pet_id [Integer] ID of pet to update + # @param required_file [File] file to upload # @param [Hash] opts the optional parameters # @option opts [String] :additional_metadata Additional data to pass to server # @return [ApiResponse] @@ -458,11 +534,11 @@ module Petstore end # uploads an image (required) - # @param pet_id ID of pet to update - # @param required_file file to upload + # @param pet_id [Integer] ID of pet to update + # @param required_file [File] file to upload # @param [Hash] opts the optional parameters # @option opts [String] :additional_metadata Additional data to pass to server - # @return [Array<(ApiResponse, Fixnum, Hash)>] ApiResponse data, response status code and response headers + # @return [Array<(ApiResponse, Integer, Hash)>] ApiResponse data, response status code and response headers def upload_file_with_required_file_with_http_info(pet_id, required_file, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PetApi.upload_file_with_required_file ...' @@ -476,38 +552,46 @@ module Petstore fail ArgumentError, "Missing the required parameter 'required_file' when calling PetApi.upload_file_with_required_file" end # resource path - local_var_path = '/fake/{petId}/uploadImageWithRequiredFile'.sub('{' + 'petId' + '}', pet_id.to_s) + local_var_path = '/fake/{petId}/uploadImageWithRequiredFile'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} form_params['requiredFile'] = required_file form_params['additionalMetadata'] = opts[:'additional_metadata'] if !opts[:'additional_metadata'].nil? # http body (model) - post_body = nil - auth_names = ['petstore_auth'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'ApiResponse' + + # auth_names + auth_names = opts[:auth_names] || ['petstore_auth'] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'ApiResponse') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: PetApi#upload_file_with_required_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb index 0a9c92a0e3a..654e9d9fffd 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb @@ -3,14 +3,14 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end -require 'uri' +require 'cgi' module Petstore class StoreApi @@ -21,7 +21,7 @@ module Petstore end # Delete purchase order by ID # For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - # @param order_id ID of the order that needs to be deleted + # @param order_id [String] ID of the order that needs to be deleted # @param [Hash] opts the optional parameters # @return [nil] def delete_order(order_id, opts = {}) @@ -31,9 +31,9 @@ module Petstore # Delete purchase order by ID # For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - # @param order_id ID of the order that needs to be deleted + # @param order_id [String] ID of the order that needs to be deleted # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_order_with_http_info(order_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StoreApi.delete_order ...' @@ -43,26 +43,36 @@ module Petstore fail ArgumentError, "Missing the required parameter 'order_id' when calling StoreApi.delete_order" end # resource path - local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', order_id.to_s) + local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s).gsub('%2F', '/')) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = [] - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: StoreApi#delete_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -81,7 +91,7 @@ module Petstore # Returns pet inventories by status # Returns a map of status codes to quantities # @param [Hash] opts the optional parameters - # @return [Array<(Hash, Fixnum, Hash)>] Hash data, response status code and response headers + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers def get_inventory_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StoreApi.get_inventory ...' @@ -90,26 +100,35 @@ module Petstore local_var_path = '/store/inventory' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api_key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Hash' + + # auth_names + auth_names = opts[:auth_names] || ['api_key'] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'Hash') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: StoreApi#get_inventory\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -118,7 +137,7 @@ module Petstore # Find purchase order by ID # For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - # @param order_id ID of pet that needs to be fetched + # @param order_id [Integer] ID of pet that needs to be fetched # @param [Hash] opts the optional parameters # @return [Order] def get_order_by_id(order_id, opts = {}) @@ -128,9 +147,9 @@ module Petstore # Find purchase order by ID # For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - # @param order_id ID of pet that needs to be fetched + # @param order_id [Integer] ID of pet that needs to be fetched # @param [Hash] opts the optional parameters - # @return [Array<(Order, Fixnum, Hash)>] Order data, response status code and response headers + # @return [Array<(Order, Integer, Hash)>] Order data, response status code and response headers def get_order_by_id_with_http_info(order_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StoreApi.get_order_by_id ...' @@ -148,29 +167,38 @@ module Petstore end # resource path - local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', order_id.to_s) + local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s).gsub('%2F', '/')) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = [] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Order' + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'Order') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: StoreApi#get_order_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -178,55 +206,63 @@ module Petstore end # Place an order for a pet - # @param order order placed for purchasing the pet + # @param body [Order] order placed for purchasing the pet # @param [Hash] opts the optional parameters # @return [Order] - def place_order(order, opts = {}) - data, _status_code, _headers = place_order_with_http_info(order, opts) + def place_order(body, opts = {}) + data, _status_code, _headers = place_order_with_http_info(body, opts) data end # Place an order for a pet - # @param order order placed for purchasing the pet + # @param body [Order] order placed for purchasing the pet # @param [Hash] opts the optional parameters - # @return [Array<(Order, Fixnum, Hash)>] Order data, response status code and response headers - def place_order_with_http_info(order, opts = {}) + # @return [Array<(Order, Integer, Hash)>] Order data, response status code and response headers + def place_order_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StoreApi.place_order ...' end - # verify the required parameter 'order' is set - if @api_client.config.client_side_validation && order.nil? - fail ArgumentError, "Missing the required parameter 'order' when calling StoreApi.place_order" + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling StoreApi.place_order" end # resource path local_var_path = '/store/order' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(order) - auth_names = [] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] || 'Order' + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'Order') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: StoreApi#place_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb index d2bdc276a0f..e0a28bbcdae 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb @@ -3,14 +3,14 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end -require 'uri' +require 'cgi' module Petstore class UserApi @@ -21,48 +21,58 @@ module Petstore end # Create user # This can only be done by the logged in user. - # @param user Created user object + # @param body [User] Created user object # @param [Hash] opts the optional parameters # @return [nil] - def create_user(user, opts = {}) - create_user_with_http_info(user, opts) + def create_user(body, opts = {}) + create_user_with_http_info(body, opts) nil end # Create user # This can only be done by the logged in user. - # @param user Created user object + # @param body [User] Created user object # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers - def create_user_with_http_info(user, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def create_user_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserApi.create_user ...' end - # verify the required parameter 'user' is set - if @api_client.config.client_side_validation && user.nil? - fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_user" + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling UserApi.create_user" end # resource path local_var_path = '/user' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(user) - auth_names = [] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UserApi#create_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -70,47 +80,57 @@ module Petstore end # Creates list of users with given input array - # @param user List of user object + # @param body [Array] List of user object # @param [Hash] opts the optional parameters # @return [nil] - def create_users_with_array_input(user, opts = {}) - create_users_with_array_input_with_http_info(user, opts) + def create_users_with_array_input(body, opts = {}) + create_users_with_array_input_with_http_info(body, opts) nil end # Creates list of users with given input array - # @param user List of user object + # @param body [Array] List of user object # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers - def create_users_with_array_input_with_http_info(user, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def create_users_with_array_input_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserApi.create_users_with_array_input ...' end - # verify the required parameter 'user' is set - if @api_client.config.client_side_validation && user.nil? - fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_users_with_array_input" + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling UserApi.create_users_with_array_input" end # resource path local_var_path = '/user/createWithArray' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(user) - auth_names = [] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UserApi#create_users_with_array_input\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -118,47 +138,57 @@ module Petstore end # Creates list of users with given input array - # @param user List of user object + # @param body [Array] List of user object # @param [Hash] opts the optional parameters # @return [nil] - def create_users_with_list_input(user, opts = {}) - create_users_with_list_input_with_http_info(user, opts) + def create_users_with_list_input(body, opts = {}) + create_users_with_list_input_with_http_info(body, opts) nil end # Creates list of users with given input array - # @param user List of user object + # @param body [Array] List of user object # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers - def create_users_with_list_input_with_http_info(user, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def create_users_with_list_input_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserApi.create_users_with_list_input ...' end - # verify the required parameter 'user' is set - if @api_client.config.client_side_validation && user.nil? - fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_users_with_list_input" + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling UserApi.create_users_with_list_input" end # resource path local_var_path = '/user/createWithList' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(user) - auth_names = [] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UserApi#create_users_with_list_input\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -167,7 +197,7 @@ module Petstore # Delete user # This can only be done by the logged in user. - # @param username The name that needs to be deleted + # @param username [String] The name that needs to be deleted # @param [Hash] opts the optional parameters # @return [nil] def delete_user(username, opts = {}) @@ -177,9 +207,9 @@ module Petstore # Delete user # This can only be done by the logged in user. - # @param username The name that needs to be deleted + # @param username [String] The name that needs to be deleted # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_user_with_http_info(username, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserApi.delete_user ...' @@ -189,26 +219,36 @@ module Petstore fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.delete_user" end # resource path - local_var_path = '/user/{username}'.sub('{' + 'username' + '}', username.to_s) + local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s).gsub('%2F', '/')) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = [] - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UserApi#delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -216,7 +256,7 @@ module Petstore end # Get user by user name - # @param username The name that needs to be fetched. Use user1 for testing. + # @param username [String] The name that needs to be fetched. Use user1 for testing. # @param [Hash] opts the optional parameters # @return [User] def get_user_by_name(username, opts = {}) @@ -225,9 +265,9 @@ module Petstore end # Get user by user name - # @param username The name that needs to be fetched. Use user1 for testing. + # @param username [String] The name that needs to be fetched. Use user1 for testing. # @param [Hash] opts the optional parameters - # @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers + # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers def get_user_by_name_with_http_info(username, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserApi.get_user_by_name ...' @@ -237,29 +277,38 @@ module Petstore fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.get_user_by_name" end # resource path - local_var_path = '/user/{username}'.sub('{' + 'username' + '}', username.to_s) + local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s).gsub('%2F', '/')) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = [] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'User' + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'User') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UserApi#get_user_by_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -267,8 +316,8 @@ module Petstore end # Logs user into the system - # @param username The user name for login - # @param password The password for login in clear text + # @param username [String] The user name for login + # @param password [String] The password for login in clear text # @param [Hash] opts the optional parameters # @return [String] def login_user(username, password, opts = {}) @@ -277,10 +326,10 @@ module Petstore end # Logs user into the system - # @param username The user name for login - # @param password The password for login in clear text + # @param username [String] The user name for login + # @param password [String] The password for login in clear text # @param [Hash] opts the optional parameters - # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers + # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers def login_user_with_http_info(username, password, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserApi.login_user ...' @@ -297,28 +346,37 @@ module Petstore local_var_path = '/user/login' # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'username'] = username query_params[:'password'] = password # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = [] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'String' + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'String') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UserApi#login_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -335,7 +393,7 @@ module Petstore # Logs out current logged in user session # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def logout_user_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserApi.logout_user ...' @@ -344,23 +402,33 @@ module Petstore local_var_path = '/user/logout' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = [] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UserApi#logout_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -369,22 +437,22 @@ module Petstore # Updated user # This can only be done by the logged in user. - # @param username name that need to be deleted - # @param user Updated user object + # @param username [String] name that need to be deleted + # @param body [User] Updated user object # @param [Hash] opts the optional parameters # @return [nil] - def update_user(username, user, opts = {}) - update_user_with_http_info(username, user, opts) + def update_user(username, body, opts = {}) + update_user_with_http_info(username, body, opts) nil end # Updated user # This can only be done by the logged in user. - # @param username name that need to be deleted - # @param user Updated user object + # @param username [String] name that need to be deleted + # @param body [User] Updated user object # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers - def update_user_with_http_info(username, user, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_user_with_http_info(username, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserApi.update_user ...' end @@ -392,36 +460,45 @@ module Petstore if @api_client.config.client_side_validation && username.nil? fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.update_user" end - # verify the required parameter 'user' is set - if @api_client.config.client_side_validation && user.nil? - fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.update_user" + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling UserApi.update_user" end # resource path - local_var_path = '/user/{username}'.sub('{' + 'username' + '}', username.to_s) + local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s).gsub('%2F', '/')) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(user) - auth_names = [] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UserApi#update_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb index 3709bdb3aef..bbb51dccb81 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb @@ -3,132 +3,155 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end require 'date' +require 'faraday' require 'json' require 'logger' -require 'faraday' +require 'tempfile' module Petstore class ApiClient + # The Configuration object holding settings to be used in the API client. + attr_accessor :config + + # Defines the headers to be used in HTTP requests of all API calls by default. + # + # @return [Hash] + attr_accessor :default_headers + + # Initializes the ApiClient + # @option config [Configuration] Configuration for initializing the object, default to Configuration.default + def initialize(config = Configuration.default) + @config = config + @user_agent = "OpenAPI-Generator/#{VERSION}/ruby" + @default_headers = { + 'Content-Type' => 'application/json', + 'User-Agent' => @user_agent + } + end + def self.default @@default ||= ApiClient.new end - def initialize(config = Configuration.default) - @config = config - end - - attr_reader :config - + # Call an API with given options. + # + # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: + # the data deserialized from response body (could be nil), response status code and response headers. def call_api(http_method, path, opts = {}) - normalized_path = ::File.join(config.base_path, path) - - @last_response = connection.public_send(http_method.to_sym.downcase) do |req| - req.url(normalized_path) - - req.headers = default_headers.merge(opts[:header_params] || {}) - req.body = opts[:body] - - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - req.params = query_params.merge(form_params) + connection = Faraday.new(:url => config.base_url) do |conn| + conn.basic_auth(config.username, config.password) + if opts[:header_params]["Content-Type"] == "multipart/form-data" + conn.request :multipart + conn.request :url_encoded + end + conn.adapter(Faraday.default_adapter) end + begin + response = connection.public_send(http_method.to_sym.downcase) do |req| + build_request(http_method, path, req, opts) + end - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{@last_response.body}\n~END~\n" + if @config.debugging + @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" + end + + unless response.success? + if response.status == 0 + # Errors from libcurl will be made visible here + fail ApiError.new(:code => 0, + :message => response.return_message) + else + fail ApiError.new(:code => response.status, + :response_headers => response.headers, + :response_body => response.body), + response.reason_phrase + end + end + rescue Faraday::TimeoutError + fail ApiError.new('Connection timed out') end if opts[:return_type] - data = deserialize(@last_response, opts[:return_type]) + data = deserialize(response, opts[:return_type]) else data = nil end - - return data, @last_response.status, @last_response.headers + return data, response.status, response.headers end - attr_reader :last_response + # Builds the HTTP request + # + # @param [String] http_method HTTP method/verb (e.g. POST) + # @param [String] path URL path (e.g. /account/new) + # @option opts [Hash] :header_params Header parameters + # @option opts [Hash] :query_params Query parameters + # @option opts [Hash] :form_params Query parameters + # @option opts [Object] :body HTTP body (JSON/XML) + # @return [Typhoeus::Request] A Typhoeus Request + def build_request(http_method, path, request, opts = {}) + url = build_request_url(path) + http_method = http_method.to_sym.downcase - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) + header_params = @default_headers.merge(opts[:header_params] || {}) + query_params = opts[:query_params] || {} + form_params = opts[:form_params] || {} + + update_params_for_auth! header_params, query_params, opts[:auth_names] + + # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) + _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 + + req_opts = { + :method => http_method, + :headers => header_params, + :params => query_params, + :params_encoding => @config.params_encoding, + :timeout => @config.timeout, + :ssl_verifypeer => @config.verify_ssl, + :ssl_verifyhost => _verify_ssl_host, + :sslcert => @config.cert_file, + :sslkey => @config.key_file, + :verbose => @config.debugging + } + + # set custom cert, if provided + req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert + + if [:post, :patch, :put, :delete].include?(http_method) + req_body = build_request_body(header_params, form_params, opts[:body]) + req_opts.update :body => req_body + if @config.debugging + @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" + end end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first + request.headers = header_params + request.body = req_body + request.url path + request.params = query_params + download_file(request) if opts[:return_type] == 'File' + request end + # Check if the given MIME is a JSON MIME. + # JSON MIME examples: + # application/json + # application/json; charset=UTF8 + # APPLICATION/JSON + # */* + # @param [String] mime MIME + # @return [Boolean] True if the MIME is application/json def json_mime?(mime) (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? end - private - - def connection - @connection ||= bulid_connection - end - - def bulid_connection - Faraday.new(:url => config.base_url) do |builder| - builder.adapter(Faraday.default_adapter) - end - end - - def user_agent - @user_agent ||= "OpenAPI-Generator/#{VERSION}/ruby" - end - - def default_headers - { - 'Content-Type' => 'application/json', - 'User-Agent' => user_agent - } - end - # Deserialize the response to the given return type. # # @param [Response] response HTTP response @@ -136,6 +159,10 @@ module Petstore def deserialize(response, return_type) body = response.body + # handle file downloading - return the File instance processed in request callbacks + # note that response body is empty when the file is written in chunks in request on_body callback + return @tempfile if return_type == 'File' + return nil if body.nil? || body.empty? # return response body directly for String return type @@ -172,7 +199,7 @@ module Petstore data.to_i when 'Float' data.to_f - when 'BOOLEAN' + when 'Boolean' data == true when 'DateTime' # parse date time (expecting ISO 8601 format) @@ -195,9 +222,179 @@ module Petstore end else # models, e.g. Pet - Petstore.const_get(return_type).new.tap do |model| - model.build_from_hash data + Petstore.const_get(return_type).build_from_hash(data) + end + end + + # Save response body into a file in (the defined) temporary folder, using the filename + # from the "Content-Disposition" header if provided, otherwise a random filename. + # The response body is written to the file in chunks in order to handle files which + # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby + # process can use. + # + # @see Configuration#temp_folder_path + def download_file(request) + tempfile = nil + encoding = nil + request.on_headers do |response| + content_disposition = response.headers['Content-Disposition'] + if content_disposition && content_disposition =~ /filename=/i + filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] + prefix = sanitize_filename(filename) + else + prefix = 'download-' end + prefix = prefix + '-' unless prefix.end_with?('-') + encoding = response.body.encoding + tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) + @tempfile = tempfile + end + request.on_body do |chunk| + chunk.force_encoding(encoding) + tempfile.write(chunk) + end + request.on_complete do |response| + tempfile.close if tempfile + @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ + "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ + "will be deleted automatically with GC. It's also recommended to delete the temp file "\ + "explicitly with `tempfile.delete`" + end + end + + # Sanitize filename by removing path. + # e.g. ../../sun.gif becomes sun.gif + # + # @param [String] filename the filename to be sanitized + # @return [String] the sanitized filename + def sanitize_filename(filename) + filename.gsub(/.*[\/\\]/, '') + end + + def build_request_url(path) + # Add leading and trailing slashes to path + path = "/#{path}".gsub(/\/+/, '/') + @config.base_url + path + end + + # Builds the HTTP request body + # + # @param [Hash] header_params Header parameters + # @param [Hash] form_params Query parameters + # @param [Object] body HTTP body (JSON/XML) + # @return [String] HTTP body data in the form of string + def build_request_body(header_params, form_params, body) + # http form + if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || + header_params['Content-Type'] == 'multipart/form-data' + data = {} + form_params.each do |key, value| + case value + when ::File, ::Tempfile + data[key] = Faraday::UploadIO.new(value.path, '') + when ::Array, nil + # let Faraday handle Array and nil parameters + data[key] = value + else + data[key] = value.to_s + end + end + elsif body + data = body.is_a?(String) ? body : body.to_json + else + data = nil + end + data + end + + # Update hearder and query params based on authentication settings. + # + # @param [Hash] header_params Header parameters + # @param [Hash] query_params Query parameters + # @param [String] auth_names Authentication scheme name + def update_params_for_auth!(header_params, query_params, auth_names) + Array(auth_names).each do |auth_name| + auth_setting = @config.auth_settings[auth_name] + next unless auth_setting + case auth_setting[:in] + when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] + when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] + else fail ArgumentError, 'Authentication token must be in `query` of `header`' + end + end + end + + # Sets user agent in HTTP header + # + # @param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.0) + def user_agent=(user_agent) + @user_agent = user_agent + @default_headers['User-Agent'] = @user_agent + end + + # Return Accept header based on an array of accepts provided. + # @param [Array] accepts array for Accept + # @return [String] the Accept header (e.g. application/json) + def select_header_accept(accepts) + return nil if accepts.nil? || accepts.empty? + # use JSON when present, otherwise use all of the provided + json_accept = accepts.find { |s| json_mime?(s) } + json_accept || accepts.join(',') + end + + # Return Content-Type header based on an array of content types provided. + # @param [Array] content_types array for Content-Type + # @return [String] the Content-Type header (e.g. application/json) + def select_header_content_type(content_types) + # use application/json by default + return 'application/json' if content_types.nil? || content_types.empty? + # use JSON when present, otherwise use the first one + json_content_type = content_types.find { |s| json_mime?(s) } + json_content_type || content_types.first + end + + # Convert object (array, hash, object, etc) to JSON string. + # @param [Object] model object to be converted into JSON string + # @return [String] JSON string representation of the object + def object_to_http_body(model) + return model if model.nil? || model.is_a?(String) + local_body = nil + if model.is_a?(Array) + local_body = model.map { |m| object_to_hash(m) } + else + local_body = object_to_hash(model) + end + local_body.to_json + end + + # Convert object(non-array) to hash. + # @param [Object] obj object to be converted into JSON string + # @return [String] JSON string representation of the object + def object_to_hash(obj) + if obj.respond_to?(:to_hash) + obj.to_hash + else + obj + end + end + + # Build parameter value according to the given collection format. + # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi + def build_collection_param(param, collection_format) + case collection_format + when :csv + param.join(',') + when :ssv + param.join(' ') + when :tsv + param.join("\t") + when :pipes + param.join('|') + when :multi + # return the array directly as typhoeus will handle it as expected + param + else + fail "unknown collection format: #{collection_format.inspect}" end end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb index 629ad384a77..9eab46a89b7 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -34,5 +34,24 @@ module Petstore super arg end end + + # Override to_s to display a friendly error message + def to_s + message + end + + def message + if @message.nil? + msg = "Error message: the server returns an error" + else + msg = @message + end + + msg += "\nHTTP status code: #{code}" if code + msg += "\nResponse headers: #{response_headers}" if response_headers + msg += "\nResponse body: #{response_body}" if response_body + + msg + end end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb index ee74eea69a4..9fdb8b0e37f 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb @@ -3,15 +3,13 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end -require 'uri' - module Petstore class Configuration # Defines url scheme @@ -128,7 +126,7 @@ module Petstore attr_accessor :force_ending_format def initialize - @scheme = 'https' + @scheme = 'http' @host = 'petstore.swagger.io' @base_path = '/v2' @api_key = {} @@ -174,8 +172,7 @@ module Petstore end def base_url - url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - URI.encode(url) + "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') end # Gets API key (with prefix if set). @@ -245,8 +242,8 @@ module Petstore servers = server_settings # check array index out of bound - if (index < 0 || index > servers.size) - fail ArgumentError "Invalid index #{index} when selecting the server. Must be less than #{servers.size}" + if (index < 0 || index >= servers.size) + fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}" end server = servers[index] diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_any_type.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_any_type.rb new file mode 100644 index 00000000000..d2af1ba5b32 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_any_type.rb @@ -0,0 +1,196 @@ +=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.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 + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::AdditionalPropertiesAnyType` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesAnyType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_array.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_array.rb new file mode 100644 index 00000000000..621e290e157 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_array.rb @@ -0,0 +1,196 @@ +=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.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 + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::AdditionalPropertiesArray` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesArray`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_boolean.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_boolean.rb new file mode 100644 index 00000000000..787951bf683 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_boolean.rb @@ -0,0 +1,196 @@ +=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.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 + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::AdditionalPropertiesBoolean` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesBoolean`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb index 86bd37cba1f..27f9768fb8d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -14,45 +14,136 @@ require 'date' module Petstore class AdditionalPropertiesClass - attr_accessor :map_property + attr_accessor :map_string - attr_accessor :map_of_map_property + attr_accessor :map_number + + attr_accessor :map_integer + + attr_accessor :map_boolean + + attr_accessor :map_array_integer + + attr_accessor :map_array_anytype + + attr_accessor :map_map_string + + attr_accessor :map_map_anytype + + attr_accessor :anytype_1 + + attr_accessor :anytype_2 + + attr_accessor :anytype_3 # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'map_property' => :'map_property', - :'map_of_map_property' => :'map_of_map_property' + :'map_string' => :'map_string', + :'map_number' => :'map_number', + :'map_integer' => :'map_integer', + :'map_boolean' => :'map_boolean', + :'map_array_integer' => :'map_array_integer', + :'map_array_anytype' => :'map_array_anytype', + :'map_map_string' => :'map_map_string', + :'map_map_anytype' => :'map_map_anytype', + :'anytype_1' => :'anytype_1', + :'anytype_2' => :'anytype_2', + :'anytype_3' => :'anytype_3' } end # Attribute type mapping. def self.openapi_types { - :'map_property' => :'Hash', - :'map_of_map_property' => :'Hash>' + :'map_string' => :'Hash', + :'map_number' => :'Hash', + :'map_integer' => :'Hash', + :'map_boolean' => :'Hash', + :'map_array_integer' => :'Hash>', + :'map_array_anytype' => :'Hash>', + :'map_map_string' => :'Hash>', + :'map_map_anytype' => :'Hash>', + :'anytype_1' => :'Object', + :'anytype_2' => :'Object', + :'anytype_3' => :'Object' } end # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::AdditionalPropertiesClass` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesClass`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'map_property') - if (value = attributes[:'map_property']).is_a?(Hash) - self.map_property = value + if attributes.key?(:'map_string') + if (value = attributes[:'map_string']).is_a?(Hash) + self.map_string = value end end - if attributes.has_key?(:'map_of_map_property') - if (value = attributes[:'map_of_map_property']).is_a?(Hash) - self.map_of_map_property = value + if attributes.key?(:'map_number') + if (value = attributes[:'map_number']).is_a?(Hash) + self.map_number = value end end + + if attributes.key?(:'map_integer') + if (value = attributes[:'map_integer']).is_a?(Hash) + self.map_integer = value + end + end + + if attributes.key?(:'map_boolean') + if (value = attributes[:'map_boolean']).is_a?(Hash) + self.map_boolean = value + end + end + + if attributes.key?(:'map_array_integer') + if (value = attributes[:'map_array_integer']).is_a?(Hash) + self.map_array_integer = value + end + end + + if attributes.key?(:'map_array_anytype') + if (value = attributes[:'map_array_anytype']).is_a?(Hash) + self.map_array_anytype = value + end + end + + if attributes.key?(:'map_map_string') + if (value = attributes[:'map_map_string']).is_a?(Hash) + self.map_map_string = value + end + end + + if attributes.key?(:'map_map_anytype') + if (value = attributes[:'map_map_anytype']).is_a?(Hash) + self.map_map_anytype = value + end + end + + if attributes.key?(:'anytype_1') + self.anytype_1 = attributes[:'anytype_1'] + end + + if attributes.key?(:'anytype_2') + self.anytype_2 = attributes[:'anytype_2'] + end + + if attributes.key?(:'anytype_3') + self.anytype_3 = attributes[:'anytype_3'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -73,8 +164,17 @@ module Petstore def ==(o) return true if self.equal?(o) self.class == o.class && - map_property == o.map_property && - map_of_map_property == o.map_of_map_property + map_string == o.map_string && + map_number == o.map_number && + map_integer == o.map_integer && + map_boolean == o.map_boolean && + map_array_integer == o.map_array_integer && + map_array_anytype == o.map_array_anytype && + map_map_string == o.map_map_string && + map_map_anytype == o.map_map_anytype && + anytype_1 == o.anytype_1 && + anytype_2 == o.anytype_2 && + anytype_3 == o.anytype_3 end # @see the `==` method @@ -84,9 +184,16 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash - [map_property, map_of_map_property].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 + 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 @@ -96,7 +203,7 @@ module Petstore 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 the attribute + # 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) }) @@ -125,7 +232,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -146,8 +253,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_integer.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_integer.rb new file mode 100644 index 00000000000..5ed4bd9381e --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_integer.rb @@ -0,0 +1,196 @@ +=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.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 + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::AdditionalPropertiesInteger` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesInteger`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_number.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_number.rb new file mode 100644 index 00000000000..3499c090be6 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_number.rb @@ -0,0 +1,196 @@ +=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.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 + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::AdditionalPropertiesNumber` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesNumber`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_object.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_object.rb new file mode 100644 index 00000000000..fd957eb08f7 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_object.rb @@ -0,0 +1,196 @@ +=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.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 + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::AdditionalPropertiesObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_string.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_string.rb new file mode 100644 index 00000000000..ca5e5385952 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_string.rb @@ -0,0 +1,196 @@ +=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.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 + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::AdditionalPropertiesString` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesString`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb index 7fe8f2a2efc..396199ca411 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -34,19 +34,31 @@ module Petstore } end + # discriminator's property name in OpenAPI v3 + def self.openapi_discriminator_name + :'class_name' + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) - - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - - if attributes.has_key?(:'className') - self.class_name = attributes[:'className'] + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Animal` initialize method" end - if attributes.has_key?(:'color') + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Animal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'class_name') + self.class_name = attributes[:'class_name'] + end + + if attributes.key?(:'color') self.color = attributes[:'color'] else self.color = 'red' @@ -87,11 +99,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [class_name, color].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -99,7 +118,7 @@ module Petstore 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 the attribute + # 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) }) @@ -128,7 +147,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -149,8 +168,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb index 03eb6f3cb81..998250d20ae 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -41,20 +41,27 @@ module Petstore # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ApiResponse` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ApiResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'code') + if attributes.key?(:'code') self.code = attributes[:'code'] end - if attributes.has_key?(:'type') + if attributes.key?(:'type') self.type = attributes[:'type'] end - if attributes.has_key?(:'message') + if attributes.key?(:'message') self.message = attributes[:'message'] end end @@ -89,11 +96,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [code, type, message].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -101,7 +115,7 @@ module Petstore 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 the attribute + # 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) }) @@ -130,7 +144,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -151,8 +165,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb index b13489a7903..99aa9482fa3 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -33,13 +33,20 @@ module Petstore # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ArrayOfArrayOfNumberOnly` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ArrayOfArrayOfNumberOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'ArrayArrayNumber') - if (value = attributes[:'ArrayArrayNumber']).is_a?(Array) + if attributes.key?(:'array_array_number') + if (value = attributes[:'array_array_number']).is_a?(Array) self.array_array_number = value end end @@ -73,11 +80,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [array_array_number].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -85,7 +99,7 @@ module Petstore 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 the attribute + # 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) }) @@ -114,7 +128,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -135,8 +149,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb index cb0670d2830..e7da1699d45 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -33,13 +33,20 @@ module Petstore # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ArrayOfNumberOnly` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ArrayOfNumberOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'ArrayNumber') - if (value = attributes[:'ArrayNumber']).is_a?(Array) + if attributes.key?(:'array_number') + if (value = attributes[:'array_number']).is_a?(Array) self.array_number = value end end @@ -73,11 +80,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [array_number].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -85,7 +99,7 @@ module Petstore 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 the attribute + # 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) }) @@ -114,7 +128,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -135,8 +149,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb index 858b6b177c1..121bff2f022 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -41,24 +41,31 @@ module Petstore # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ArrayTest` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ArrayTest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'array_of_string') + if attributes.key?(:'array_of_string') if (value = attributes[:'array_of_string']).is_a?(Array) self.array_of_string = value end end - if attributes.has_key?(:'array_array_of_integer') + if attributes.key?(:'array_array_of_integer') if (value = attributes[:'array_array_of_integer']).is_a?(Array) self.array_array_of_integer = value end end - if attributes.has_key?(:'array_array_of_model') + if attributes.key?(:'array_array_of_model') if (value = attributes[:'array_array_of_model']).is_a?(Array) self.array_array_of_model = value end @@ -95,11 +102,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [array_of_string, array_array_of_integer, array_array_of_model].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -107,7 +121,7 @@ module Petstore 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 the attribute + # 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) }) @@ -136,7 +150,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -157,8 +171,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb index 5991e98aabb..02567bdfd45 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -54,33 +54,40 @@ module Petstore # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) - - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - - if attributes.has_key?(:'smallCamel') - self.small_camel = attributes[:'smallCamel'] + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Capitalization` initialize method" end - if attributes.has_key?(:'CapitalCamel') - self.capital_camel = attributes[:'CapitalCamel'] + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Capitalization`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'small_camel') + self.small_camel = attributes[:'small_camel'] end - if attributes.has_key?(:'small_Snake') - self.small_snake = attributes[:'small_Snake'] + if attributes.key?(:'capital_camel') + self.capital_camel = attributes[:'capital_camel'] end - if attributes.has_key?(:'Capital_Snake') - self.capital_snake = attributes[:'Capital_Snake'] + if attributes.key?(:'small_snake') + self.small_snake = attributes[:'small_snake'] end - if attributes.has_key?(:'SCA_ETH_Flow_Points') - self.sca_eth_flow_points = attributes[:'SCA_ETH_Flow_Points'] + if attributes.key?(:'capital_snake') + self.capital_snake = attributes[:'capital_snake'] end - if attributes.has_key?(:'ATT_NAME') - self.att_name = attributes[:'ATT_NAME'] + if attributes.key?(:'sca_eth_flow_points') + self.sca_eth_flow_points = attributes[:'sca_eth_flow_points'] + end + + if attributes.key?(:'att_name') + self.att_name = attributes[:'att_name'] end end @@ -117,11 +124,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [small_camel, capital_camel, small_snake, capital_snake, sca_eth_flow_points, att_name].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -129,7 +143,7 @@ module Petstore 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 the attribute + # 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) }) @@ -158,7 +172,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -179,8 +193,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb index ab83695cbc4..51ab33355e3 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb @@ -3,28 +3,22 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end require 'date' module Petstore - class Cat - attr_accessor :class_name - - attr_accessor :color - + class Cat < Animal attr_accessor :declawed # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'class_name' => :'className', - :'color' => :'color', :'declawed' => :'declawed' } end @@ -32,31 +26,37 @@ module Petstore # Attribute type mapping. def self.openapi_types { - :'class_name' => :'String', - :'color' => :'String', - :'declawed' => :'BOOLEAN' + :'declawed' => :'Boolean' } end + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Animal', + :'CatAllOf' + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) - - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - - if attributes.has_key?(:'className') - self.class_name = attributes[:'className'] + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Cat` initialize method" end - if attributes.has_key?(:'color') - self.color = attributes[:'color'] - else - self.color = 'red' - end + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Cat`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'declawed') + # call parent's initialize + super(attributes) + + if attributes.key?(:'declawed') self.declawed = attributes[:'declawed'] end end @@ -64,19 +64,14 @@ module Petstore # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties - invalid_properties = Array.new - if @class_name.nil? - invalid_properties.push('invalid value for "class_name", class_name cannot be nil.') - end - + invalid_properties = 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? - return false if @class_name.nil? - true + true && super end # Checks equality by comparing each attribute. @@ -84,9 +79,7 @@ module Petstore def ==(o) return true if self.equal?(o) self.class == o.class && - class_name == o.class_name && - color == o.color && - declawed == o.declawed + declawed == o.declawed && super(o) end # @see the `==` method @@ -96,9 +89,16 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash - [class_name, color, declawed].hash + [declawed].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) end # Builds the object from hash @@ -106,9 +106,10 @@ module Petstore # @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 the attribute + # 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) }) @@ -137,7 +138,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -158,8 +159,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end @@ -178,7 +178,7 @@ module Petstore # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash - hash = {} + hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb new file mode 100644 index 00000000000..a971e6f5566 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb @@ -0,0 +1,196 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class CatAllOf + attr_accessor :declawed + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'declawed' => :'declawed' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'declawed' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::CatAllOf` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::CatAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'declawed') + self.declawed = attributes[:'declawed'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + declawed == o.declawed + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [declawed].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb index 4517cc7ea3f..344ca690654 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -37,16 +37,23 @@ module Petstore # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Category` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Category`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] else self.name = 'default-name' @@ -87,11 +94,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [id, name].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -99,7 +113,7 @@ module Petstore 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 the attribute + # 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) }) @@ -128,7 +142,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -149,8 +163,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb index 8287046f2e0..01b2b965d60 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -34,12 +34,19 @@ module Petstore # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ClassModel` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ClassModel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'_class') + if attributes.key?(:'_class') self._class = attributes[:'_class'] end end @@ -72,11 +79,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [_class].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -84,7 +98,7 @@ module Petstore 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 the attribute + # 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) }) @@ -113,7 +127,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -134,8 +148,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb index a4b6090829e..830ab1d0f00 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -33,12 +33,19 @@ module Petstore # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Client` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Client`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'client') + if attributes.key?(:'client') self.client = attributes[:'client'] end end @@ -71,11 +78,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [client].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -83,7 +97,7 @@ module Petstore 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 the attribute + # 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) }) @@ -112,7 +126,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -133,8 +147,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb index 72213047998..07c31216bc3 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb @@ -3,28 +3,22 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end require 'date' module Petstore - class Dog - attr_accessor :class_name - - attr_accessor :color - + class Dog < Animal attr_accessor :breed # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'class_name' => :'className', - :'color' => :'color', :'breed' => :'breed' } end @@ -32,31 +26,37 @@ module Petstore # Attribute type mapping. def self.openapi_types { - :'class_name' => :'String', - :'color' => :'String', :'breed' => :'String' } end + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Animal', + :'DogAllOf' + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) - - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - - if attributes.has_key?(:'className') - self.class_name = attributes[:'className'] + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Dog` initialize method" end - if attributes.has_key?(:'color') - self.color = attributes[:'color'] - else - self.color = 'red' - end + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Dog`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'breed') + # call parent's initialize + super(attributes) + + if attributes.key?(:'breed') self.breed = attributes[:'breed'] end end @@ -64,19 +64,14 @@ module Petstore # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties - invalid_properties = Array.new - if @class_name.nil? - invalid_properties.push('invalid value for "class_name", class_name cannot be nil.') - end - + invalid_properties = 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? - return false if @class_name.nil? - true + true && super end # Checks equality by comparing each attribute. @@ -84,9 +79,7 @@ module Petstore def ==(o) return true if self.equal?(o) self.class == o.class && - class_name == o.class_name && - color == o.color && - breed == o.breed + breed == o.breed && super(o) end # @see the `==` method @@ -96,9 +89,16 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash - [class_name, color, breed].hash + [breed].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) end # Builds the object from hash @@ -106,9 +106,10 @@ module Petstore # @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 the attribute + # 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) }) @@ -137,7 +138,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -158,8 +159,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end @@ -178,7 +178,7 @@ module Petstore # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash - hash = {} + hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb new file mode 100644 index 00000000000..18cf6197720 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb @@ -0,0 +1,196 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class DogAllOf + attr_accessor :breed + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'breed' => :'breed' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'breed' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::DogAllOf` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::DogAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'breed') + self.breed = attributes[:'breed'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + breed == o.breed + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [breed].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb index b74014bee3b..1f12cb43b9c 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -59,16 +59,23 @@ module Petstore # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::EnumArrays` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::EnumArrays`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'just_symbol') + if attributes.key?(:'just_symbol') self.just_symbol = attributes[:'just_symbol'] end - if attributes.has_key?(:'array_enum') + if attributes.key?(:'array_enum') if (value = attributes[:'array_enum']).is_a?(Array) self.array_enum = value end @@ -85,7 +92,7 @@ module Petstore # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - just_symbol_validator = EnumAttributeValidator.new('String', ['>=', '$']) + just_symbol_validator = EnumAttributeValidator.new('String', [">=", "$"]) return false unless just_symbol_validator.valid?(@just_symbol) true end @@ -93,9 +100,9 @@ module Petstore # Custom attribute writer method checking allowed values (enum). # @param [Object] just_symbol Object to be assigned def just_symbol=(just_symbol) - validator = EnumAttributeValidator.new('String', ['>=', '$']) + validator = EnumAttributeValidator.new('String', [">=", "$"]) unless validator.valid?(just_symbol) - fail ArgumentError, 'invalid value for "just_symbol", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"just_symbol\", must be one of #{validator.allowable_values}." end @just_symbol = just_symbol end @@ -116,11 +123,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [just_symbol, array_enum].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -128,7 +142,7 @@ module Petstore 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 the attribute + # 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) }) @@ -157,7 +171,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -178,8 +192,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb index c8a20442268..406b0dccc95 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -14,10 +14,16 @@ require 'date' module Petstore class EnumClass - - ABC = '_abc'.freeze - EFG = '-efg'.freeze - XYZ = '(xyz)'.freeze + ABC = "_abc".freeze + EFG = "-efg".freeze + XYZ = "(xyz)".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end # Builds the enum from string # @param [String] The enum value in the form of the string diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb index 4fdd1016bb9..0a2b987f345 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -71,29 +71,36 @@ module Petstore # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::EnumTest` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::EnumTest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'enum_string') + if attributes.key?(:'enum_string') self.enum_string = attributes[:'enum_string'] end - if attributes.has_key?(:'enum_string_required') + if attributes.key?(:'enum_string_required') self.enum_string_required = attributes[:'enum_string_required'] end - if attributes.has_key?(:'enum_integer') + if attributes.key?(:'enum_integer') self.enum_integer = attributes[:'enum_integer'] end - if attributes.has_key?(:'enum_number') + if attributes.key?(:'enum_number') self.enum_number = attributes[:'enum_number'] end - if attributes.has_key?(:'outerEnum') - self.outer_enum = attributes[:'outerEnum'] + if attributes.key?(:'outer_enum') + self.outer_enum = attributes[:'outer_enum'] end end @@ -111,14 +118,14 @@ module Petstore # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - enum_string_validator = EnumAttributeValidator.new('String', ['UPPER', 'lower', '']) + enum_string_validator = EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) return false unless enum_string_validator.valid?(@enum_string) return false if @enum_string_required.nil? - enum_string_required_validator = EnumAttributeValidator.new('String', ['UPPER', 'lower', '']) + enum_string_required_validator = EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) return false unless enum_string_required_validator.valid?(@enum_string_required) - enum_integer_validator = EnumAttributeValidator.new('Integer', ['1', '-1']) + enum_integer_validator = EnumAttributeValidator.new('Integer', [1, -1]) return false unless enum_integer_validator.valid?(@enum_integer) - enum_number_validator = EnumAttributeValidator.new('Float', ['1.1', '-1.2']) + enum_number_validator = EnumAttributeValidator.new('Float', [1.1, -1.2]) return false unless enum_number_validator.valid?(@enum_number) true end @@ -126,9 +133,9 @@ module Petstore # Custom attribute writer method checking allowed values (enum). # @param [Object] enum_string Object to be assigned def enum_string=(enum_string) - validator = EnumAttributeValidator.new('String', ['UPPER', 'lower', '']) + validator = EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) unless validator.valid?(enum_string) - fail ArgumentError, 'invalid value for "enum_string", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"enum_string\", must be one of #{validator.allowable_values}." end @enum_string = enum_string end @@ -136,9 +143,9 @@ module Petstore # Custom attribute writer method checking allowed values (enum). # @param [Object] enum_string_required Object to be assigned def enum_string_required=(enum_string_required) - validator = EnumAttributeValidator.new('String', ['UPPER', 'lower', '']) + validator = EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) unless validator.valid?(enum_string_required) - fail ArgumentError, 'invalid value for "enum_string_required", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"enum_string_required\", must be one of #{validator.allowable_values}." end @enum_string_required = enum_string_required end @@ -146,9 +153,9 @@ module Petstore # Custom attribute writer method checking allowed values (enum). # @param [Object] enum_integer Object to be assigned def enum_integer=(enum_integer) - validator = EnumAttributeValidator.new('Integer', ['1', '-1']) + validator = EnumAttributeValidator.new('Integer', [1, -1]) unless validator.valid?(enum_integer) - fail ArgumentError, 'invalid value for "enum_integer", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"enum_integer\", must be one of #{validator.allowable_values}." end @enum_integer = enum_integer end @@ -156,9 +163,9 @@ module Petstore # Custom attribute writer method checking allowed values (enum). # @param [Object] enum_number Object to be assigned def enum_number=(enum_number) - validator = EnumAttributeValidator.new('Float', ['1.1', '-1.2']) + validator = EnumAttributeValidator.new('Float', [1.1, -1.2]) unless validator.valid?(enum_number) - fail ArgumentError, 'invalid value for "enum_number", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"enum_number\", must be one of #{validator.allowable_values}." end @enum_number = enum_number end @@ -182,11 +189,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [enum_string, enum_string_required, enum_integer, enum_number, outer_enum].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -194,7 +208,7 @@ module Petstore 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 the attribute + # 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) }) @@ -223,7 +237,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -244,8 +258,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb index 6045b5e7842..459e4deba8f 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -35,13 +35,20 @@ module Petstore # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::File` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::File`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'sourceURI') - self.source_uri = attributes[:'sourceURI'] + if attributes.key?(:'source_uri') + self.source_uri = attributes[:'source_uri'] end end @@ -73,11 +80,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [source_uri].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -85,7 +99,7 @@ module Petstore 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 the attribute + # 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) }) @@ -114,7 +128,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -135,8 +149,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb index b207e13cf8f..c01bb104a3e 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -37,16 +37,23 @@ module Petstore # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::FileSchemaTestClass` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::FileSchemaTestClass`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'file') + if attributes.key?(:'file') self.file = attributes[:'file'] end - if attributes.has_key?(:'files') + if attributes.key?(:'files') if (value = attributes[:'files']).is_a?(Array) self.files = value end @@ -82,11 +89,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [file, files].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -94,7 +108,7 @@ module Petstore 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 the attribute + # 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) }) @@ -123,7 +137,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -144,8 +158,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb index 3ea21fa953a..4638d9f36e1 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -81,60 +81,67 @@ module Petstore # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::FormatTest` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::FormatTest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'integer') + if attributes.key?(:'integer') self.integer = attributes[:'integer'] end - if attributes.has_key?(:'int32') + if attributes.key?(:'int32') self.int32 = attributes[:'int32'] end - if attributes.has_key?(:'int64') + if attributes.key?(:'int64') self.int64 = attributes[:'int64'] end - if attributes.has_key?(:'number') + if attributes.key?(:'number') self.number = attributes[:'number'] end - if attributes.has_key?(:'float') + if attributes.key?(:'float') self.float = attributes[:'float'] end - if attributes.has_key?(:'double') + if attributes.key?(:'double') self.double = attributes[:'double'] end - if attributes.has_key?(:'string') + if attributes.key?(:'string') self.string = attributes[:'string'] end - if attributes.has_key?(:'byte') + if attributes.key?(:'byte') self.byte = attributes[:'byte'] end - if attributes.has_key?(:'binary') + if attributes.key?(:'binary') self.binary = attributes[:'binary'] end - if attributes.has_key?(:'date') + if attributes.key?(:'date') self.date = attributes[:'date'] end - if attributes.has_key?(:'dateTime') - self.date_time = attributes[:'dateTime'] + if attributes.key?(:'date_time') + self.date_time = attributes[:'date_time'] end - if attributes.has_key?(:'uuid') + if attributes.key?(:'uuid') self.uuid = attributes[:'uuid'] end - if attributes.has_key?(:'password') + if attributes.key?(:'password') self.password = attributes[:'password'] end end @@ -187,16 +194,18 @@ module Petstore invalid_properties.push('invalid value for "double", must be greater than or equal to 67.8.') end - if !@string.nil? && @string !~ Regexp.new(/[a-z]/i) - invalid_properties.push('invalid value for "string", must conform to the pattern /[a-z]/i.') + pattern = Regexp.new(/[a-z]/i) + if !@string.nil? && @string !~ pattern + invalid_properties.push("invalid value for \"string\", must conform to the pattern #{pattern}.") end if @byte.nil? invalid_properties.push('invalid value for "byte", byte cannot be nil.') end - if @byte !~ Regexp.new(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$) - invalid_properties.push('invalid value for "byte", must conform to the pattern /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$.') + 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? @@ -234,7 +243,7 @@ module Petstore return false if !@double.nil? && @double < 67.8 return false if !@string.nil? && @string !~ Regexp.new(/[a-z]/i) return false if @byte.nil? - return false if @byte !~ Regexp.new(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$) + return false if @byte !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/) return false if @date.nil? return false if @password.nil? return false if @password.to_s.length > 64 @@ -319,8 +328,9 @@ module Petstore # Custom attribute writer method with validation # @param [Object] string Value to be assigned def string=(string) - if !string.nil? && string !~ Regexp.new(/[a-z]/i) - fail ArgumentError, 'invalid value for "string", must conform to the pattern /[a-z]/i.' + pattern = Regexp.new(/[a-z]/i) + if !string.nil? && string !~ pattern + fail ArgumentError, "invalid value for \"string\", must conform to the pattern #{pattern}." end @string = string @@ -333,8 +343,9 @@ module Petstore fail ArgumentError, 'byte cannot be nil' end - if byte !~ Regexp.new(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$) - fail ArgumentError, 'invalid value for "byte", must conform to the pattern /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$.' + 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 @@ -385,11 +396,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [integer, int32, int64, number, float, double, string, byte, binary, date, date_time, uuid, password].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 @@ -397,7 +415,7 @@ module Petstore 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 the attribute + # 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) }) @@ -426,7 +444,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -447,8 +465,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb index 1071f8736ad..6d24ac174c5 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -37,16 +37,23 @@ module Petstore # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::HasOnlyReadOnly` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::HasOnlyReadOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'bar') + if attributes.key?(:'bar') self.bar = attributes[:'bar'] end - if attributes.has_key?(:'foo') + if attributes.key?(:'foo') self.foo = attributes[:'foo'] end end @@ -80,11 +87,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [bar, foo].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -92,7 +106,7 @@ module Petstore 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 the attribute + # 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) }) @@ -121,7 +135,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -142,8 +156,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb index 366669b4c69..ab8318101b5 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -33,13 +33,20 @@ module Petstore # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::List` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::List`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'123-list') - self._123_list = attributes[:'123-list'] + if attributes.key?(:'_123_list') + self._123_list = attributes[:'_123_list'] end end @@ -71,11 +78,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [_123_list].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -83,7 +97,7 @@ module Petstore 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 the attribute + # 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) }) @@ -112,7 +126,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -133,8 +147,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb index cfc30bc635d..68509874a7d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -59,38 +59,45 @@ module Petstore { :'map_map_of_string' => :'Hash>', :'map_of_enum_string' => :'Hash', - :'direct_map' => :'Hash', - :'indirect_map' => :'Hash' + :'direct_map' => :'Hash', + :'indirect_map' => :'Hash' } end # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::MapTest` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::MapTest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'map_map_of_string') + if attributes.key?(:'map_map_of_string') if (value = attributes[:'map_map_of_string']).is_a?(Hash) self.map_map_of_string = value end end - if attributes.has_key?(:'map_of_enum_string') + if attributes.key?(:'map_of_enum_string') if (value = attributes[:'map_of_enum_string']).is_a?(Hash) self.map_of_enum_string = value end end - if attributes.has_key?(:'direct_map') + if attributes.key?(:'direct_map') if (value = attributes[:'direct_map']).is_a?(Hash) self.direct_map = value end end - if attributes.has_key?(:'indirect_map') + if attributes.key?(:'indirect_map') if (value = attributes[:'indirect_map']).is_a?(Hash) self.indirect_map = value end @@ -128,11 +135,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [map_map_of_string, map_of_enum_string, direct_map, indirect_map].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -140,7 +154,7 @@ module Petstore 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 the attribute + # 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) }) @@ -169,7 +183,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -190,8 +204,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index 729418423c9..f82bdde7721 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -41,20 +41,27 @@ module Petstore # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::MixedPropertiesAndAdditionalPropertiesClass` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::MixedPropertiesAndAdditionalPropertiesClass`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'uuid') + if attributes.key?(:'uuid') self.uuid = attributes[:'uuid'] end - if attributes.has_key?(:'dateTime') - self.date_time = attributes[:'dateTime'] + if attributes.key?(:'date_time') + self.date_time = attributes[:'date_time'] end - if attributes.has_key?(:'map') + if attributes.key?(:'map') if (value = attributes[:'map']).is_a?(Hash) self.map = value end @@ -91,11 +98,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [uuid, date_time, map].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -103,7 +117,7 @@ module Petstore 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 the attribute + # 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) }) @@ -132,7 +146,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -153,8 +167,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb index b896ec31497..d87939a4b8a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -38,17 +38,24 @@ module Petstore # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Model200Response` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Model200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'class') - self._class = attributes[:'class'] + if attributes.key?(:'_class') + self._class = attributes[:'_class'] end end @@ -81,11 +88,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [name, _class].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -93,7 +107,7 @@ module Petstore 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 the attribute + # 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) }) @@ -122,7 +136,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -143,8 +157,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb index dd13ff9effe..32b75d1f088 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -34,13 +34,20 @@ module Petstore # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ModelReturn` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ModelReturn`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'return') - self._return = attributes[:'return'] + if attributes.key?(:'_return') + self._return = attributes[:'_return'] end end @@ -72,11 +79,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [_return].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -84,7 +98,7 @@ module Petstore 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 the attribute + # 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) }) @@ -113,7 +127,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -134,8 +148,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb index 5ef4c859926..665fc352764 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -46,25 +46,32 @@ module Petstore # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Name` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Name`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'snake_case') + if attributes.key?(:'snake_case') self.snake_case = attributes[:'snake_case'] end - if attributes.has_key?(:'property') + if attributes.key?(:'property') self.property = attributes[:'property'] end - if attributes.has_key?(:'123Number') - self._123_number = attributes[:'123Number'] + if attributes.key?(:'_123_number') + self._123_number = attributes[:'_123_number'] end end @@ -104,11 +111,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [name, snake_case, property, _123_number].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -116,7 +130,7 @@ module Petstore 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 the attribute + # 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) }) @@ -145,7 +159,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -166,8 +180,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb index f900b2556a5..8b6da24af4b 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -33,13 +33,20 @@ module Petstore # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::NumberOnly` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::NumberOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'JustNumber') - self.just_number = attributes[:'JustNumber'] + if attributes.key?(:'just_number') + self.just_number = attributes[:'just_number'] end end @@ -71,11 +78,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [just_number].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -83,7 +97,7 @@ module Petstore 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 the attribute + # 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) }) @@ -112,7 +126,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -133,8 +147,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb index 3f42f9ac82c..bcfc925dbf3 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -69,39 +69,46 @@ module Petstore :'quantity' => :'Integer', :'ship_date' => :'DateTime', :'status' => :'String', - :'complete' => :'BOOLEAN' + :'complete' => :'Boolean' } end # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Order` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Order`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end - if attributes.has_key?(:'petId') - self.pet_id = attributes[:'petId'] + if attributes.key?(:'pet_id') + self.pet_id = attributes[:'pet_id'] end - if attributes.has_key?(:'quantity') + if attributes.key?(:'quantity') self.quantity = attributes[:'quantity'] end - if attributes.has_key?(:'shipDate') - self.ship_date = attributes[:'shipDate'] + if attributes.key?(:'ship_date') + self.ship_date = attributes[:'ship_date'] end - if attributes.has_key?(:'status') + if attributes.key?(:'status') self.status = attributes[:'status'] end - if attributes.has_key?(:'complete') + if attributes.key?(:'complete') self.complete = attributes[:'complete'] else self.complete = false @@ -118,7 +125,7 @@ module Petstore # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - status_validator = EnumAttributeValidator.new('String', ['placed', 'approved', 'delivered']) + status_validator = EnumAttributeValidator.new('String', ["placed", "approved", "delivered"]) return false unless status_validator.valid?(@status) true end @@ -126,9 +133,9 @@ module Petstore # Custom attribute writer method checking allowed values (enum). # @param [Object] status Object to be assigned def status=(status) - validator = EnumAttributeValidator.new('String', ['placed', 'approved', 'delivered']) + validator = EnumAttributeValidator.new('String', ["placed", "approved", "delivered"]) unless validator.valid?(status) - fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." end @status = status end @@ -153,11 +160,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [id, pet_id, quantity, ship_date, status, complete].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -165,7 +179,7 @@ module Petstore 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 the attribute + # 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) }) @@ -194,7 +208,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -215,8 +229,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb index f6becc74ec3..1cfbf6659a7 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -34,27 +34,34 @@ module Petstore { :'my_number' => :'Float', :'my_string' => :'String', - :'my_boolean' => :'BOOLEAN' + :'my_boolean' => :'Boolean' } end # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::OuterComposite` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::OuterComposite`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'my_number') + if attributes.key?(:'my_number') self.my_number = attributes[:'my_number'] end - if attributes.has_key?(:'my_string') + if attributes.key?(:'my_string') self.my_string = attributes[:'my_string'] end - if attributes.has_key?(:'my_boolean') + if attributes.key?(:'my_boolean') self.my_boolean = attributes[:'my_boolean'] end end @@ -89,11 +96,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [my_number, my_string, my_boolean].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -101,7 +115,7 @@ module Petstore 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 the attribute + # 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) }) @@ -130,7 +144,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -151,8 +165,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb index b63876234a2..c7d622d9703 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -14,10 +14,16 @@ require 'date' module Petstore class OuterEnum - - PLACED = 'placed'.freeze - APPROVED = 'approved'.freeze - DELIVERED = 'delivered'.freeze + PLACED = "placed".freeze + APPROVED = "approved".freeze + DELIVERED = "delivered".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end # Builds the enum from string # @param [String] The enum value in the form of the string diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb index e53f01becc5..20a476bbe9f 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -76,36 +76,43 @@ module Petstore # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Pet` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Pet`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end - if attributes.has_key?(:'category') + if attributes.key?(:'category') self.category = attributes[:'category'] end - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'photoUrls') - if (value = attributes[:'photoUrls']).is_a?(Array) + if attributes.key?(:'photo_urls') + if (value = attributes[:'photo_urls']).is_a?(Array) self.photo_urls = value end end - if attributes.has_key?(:'tags') + if attributes.key?(:'tags') if (value = attributes[:'tags']).is_a?(Array) self.tags = value end end - if attributes.has_key?(:'status') + if attributes.key?(:'status') self.status = attributes[:'status'] end end @@ -130,7 +137,7 @@ module Petstore def valid? return false if @name.nil? return false if @photo_urls.nil? - status_validator = EnumAttributeValidator.new('String', ['available', 'pending', 'sold']) + status_validator = EnumAttributeValidator.new('String', ["available", "pending", "sold"]) return false unless status_validator.valid?(@status) true end @@ -138,9 +145,9 @@ module Petstore # Custom attribute writer method checking allowed values (enum). # @param [Object] status Object to be assigned def status=(status) - validator = EnumAttributeValidator.new('String', ['available', 'pending', 'sold']) + validator = EnumAttributeValidator.new('String', ["available", "pending", "sold"]) unless validator.valid?(status) - fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." end @status = status end @@ -165,11 +172,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [id, category, name, photo_urls, tags, status].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -177,7 +191,7 @@ module Petstore 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 the attribute + # 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) }) @@ -206,7 +220,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -227,8 +241,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb index d1a7db8f63f..012f382be79 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -37,16 +37,23 @@ module Petstore # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ReadOnlyFirst` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ReadOnlyFirst`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'bar') + if attributes.key?(:'bar') self.bar = attributes[:'bar'] end - if attributes.has_key?(:'baz') + if attributes.key?(:'baz') self.baz = attributes[:'baz'] end end @@ -80,11 +87,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [bar, baz].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -92,7 +106,7 @@ module Petstore 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 the attribute + # 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) }) @@ -121,7 +135,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -142,8 +156,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb index 51143fe4d21..b2bc0dc84a6 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -33,13 +33,20 @@ module Petstore # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::SpecialModelName` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::SpecialModelName`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'$special[property.name]') - self.special_property_name = attributes[:'$special[property.name]'] + if attributes.key?(:'special_property_name') + self.special_property_name = attributes[:'special_property_name'] end end @@ -71,11 +78,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [special_property_name].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -83,7 +97,7 @@ module Petstore 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 the attribute + # 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) }) @@ -112,7 +126,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -133,8 +147,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb index d83971dc4e2..6d79193b09a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -37,16 +37,23 @@ module Petstore # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Tag` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Tag`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end end @@ -80,11 +87,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [id, name].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -92,7 +106,7 @@ module Petstore 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 the attribute + # 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) }) @@ -121,7 +135,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -142,8 +156,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_default.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_default.rb new file mode 100644 index 00000000000..362ceff7a85 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_default.rb @@ -0,0 +1,263 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class TypeHolderDefault + attr_accessor :string_item + + attr_accessor :number_item + + attr_accessor :integer_item + + attr_accessor :bool_item + + attr_accessor :array_item + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'string_item' => :'string_item', + :'number_item' => :'number_item', + :'integer_item' => :'integer_item', + :'bool_item' => :'bool_item', + :'array_item' => :'array_item' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'string_item' => :'String', + :'number_item' => :'Float', + :'integer_item' => :'Integer', + :'bool_item' => :'Boolean', + :'array_item' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::TypeHolderDefault` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::TypeHolderDefault`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'string_item') + self.string_item = attributes[:'string_item'] + else + self.string_item = 'what' + end + + if attributes.key?(:'number_item') + self.number_item = attributes[:'number_item'] + end + + if attributes.key?(:'integer_item') + self.integer_item = attributes[:'integer_item'] + end + + if attributes.key?(:'bool_item') + self.bool_item = attributes[:'bool_item'] + else + self.bool_item = true + end + + if attributes.key?(:'array_item') + if (value = attributes[:'array_item']).is_a?(Array) + self.array_item = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @string_item.nil? + invalid_properties.push('invalid value for "string_item", string_item cannot be nil.') + end + + if @number_item.nil? + invalid_properties.push('invalid value for "number_item", number_item cannot be nil.') + end + + if @integer_item.nil? + invalid_properties.push('invalid value for "integer_item", integer_item cannot be nil.') + end + + if @bool_item.nil? + invalid_properties.push('invalid value for "bool_item", bool_item cannot be nil.') + end + + if @array_item.nil? + invalid_properties.push('invalid value for "array_item", array_item cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @string_item.nil? + return false if @number_item.nil? + return false if @integer_item.nil? + return false if @bool_item.nil? + return false if @array_item.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + string_item == o.string_item && + number_item == o.number_item && + integer_item == o.integer_item && + bool_item == o.bool_item && + array_item == o.array_item + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [string_item, number_item, integer_item, bool_item, array_item].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_example.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_example.rb new file mode 100644 index 00000000000..63390983f38 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/type_holder_example.rb @@ -0,0 +1,259 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class TypeHolderExample + attr_accessor :string_item + + attr_accessor :number_item + + attr_accessor :integer_item + + attr_accessor :bool_item + + attr_accessor :array_item + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'string_item' => :'string_item', + :'number_item' => :'number_item', + :'integer_item' => :'integer_item', + :'bool_item' => :'bool_item', + :'array_item' => :'array_item' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'string_item' => :'String', + :'number_item' => :'Float', + :'integer_item' => :'Integer', + :'bool_item' => :'Boolean', + :'array_item' => :'Array' + } + end + + # 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?(:'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 @integer_item.nil? + invalid_properties.push('invalid value for "integer_item", integer_item cannot be nil.') + end + + if @bool_item.nil? + invalid_properties.push('invalid value for "bool_item", bool_item cannot be nil.') + end + + if @array_item.nil? + invalid_properties.push('invalid value for "array_item", array_item cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @string_item.nil? + return false if @number_item.nil? + return false if @integer_item.nil? + return false if @bool_item.nil? + return false if @array_item.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + string_item == o.string_item && + number_item == o.number_item && + integer_item == o.integer_item && + bool_item == o.bool_item && + array_item == o.array_item + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [string_item, number_item, integer_item, bool_item, array_item].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb index db6c7964f2e..5b97445cc16 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end @@ -62,41 +62,48 @@ module Petstore # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::User` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::User`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end - if attributes.has_key?(:'username') + if attributes.key?(:'username') self.username = attributes[:'username'] end - if attributes.has_key?(:'firstName') - self.first_name = attributes[:'firstName'] + if attributes.key?(:'first_name') + self.first_name = attributes[:'first_name'] end - if attributes.has_key?(:'lastName') - self.last_name = attributes[:'lastName'] + if attributes.key?(:'last_name') + self.last_name = attributes[:'last_name'] end - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'password') + if attributes.key?(:'password') self.password = attributes[:'password'] end - if attributes.has_key?(:'phone') + if attributes.key?(:'phone') self.phone = attributes[:'phone'] end - if attributes.has_key?(:'userStatus') - self.user_status = attributes[:'userStatus'] + if attributes.key?(:'user_status') + self.user_status = attributes[:'user_status'] end end @@ -135,11 +142,18 @@ module Petstore end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [id, username, first_name, last_name, email, password, phone, user_status].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself @@ -147,7 +161,7 @@ module Petstore 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 the attribute + # 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) }) @@ -176,7 +190,7 @@ module Petstore value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -197,8 +211,7 @@ module Petstore end end else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) + Petstore.const_get(type).build_from_hash(value) end end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/xml_item.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/xml_item.rb new file mode 100644 index 00000000000..9c26309da19 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/xml_item.rb @@ -0,0 +1,466 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class XmlItem + attr_accessor :attribute_string + + attr_accessor :attribute_number + + attr_accessor :attribute_integer + + attr_accessor :attribute_boolean + + attr_accessor :wrapped_array + + attr_accessor :name_string + + attr_accessor :name_number + + attr_accessor :name_integer + + attr_accessor :name_boolean + + attr_accessor :name_array + + attr_accessor :name_wrapped_array + + attr_accessor :prefix_string + + attr_accessor :prefix_number + + attr_accessor :prefix_integer + + attr_accessor :prefix_boolean + + attr_accessor :prefix_array + + attr_accessor :prefix_wrapped_array + + attr_accessor :namespace_string + + attr_accessor :namespace_number + + attr_accessor :namespace_integer + + attr_accessor :namespace_boolean + + attr_accessor :namespace_array + + attr_accessor :namespace_wrapped_array + + attr_accessor :prefix_ns_string + + attr_accessor :prefix_ns_number + + attr_accessor :prefix_ns_integer + + attr_accessor :prefix_ns_boolean + + attr_accessor :prefix_ns_array + + attr_accessor :prefix_ns_wrapped_array + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'attribute_string' => :'attribute_string', + :'attribute_number' => :'attribute_number', + :'attribute_integer' => :'attribute_integer', + :'attribute_boolean' => :'attribute_boolean', + :'wrapped_array' => :'wrapped_array', + :'name_string' => :'name_string', + :'name_number' => :'name_number', + :'name_integer' => :'name_integer', + :'name_boolean' => :'name_boolean', + :'name_array' => :'name_array', + :'name_wrapped_array' => :'name_wrapped_array', + :'prefix_string' => :'prefix_string', + :'prefix_number' => :'prefix_number', + :'prefix_integer' => :'prefix_integer', + :'prefix_boolean' => :'prefix_boolean', + :'prefix_array' => :'prefix_array', + :'prefix_wrapped_array' => :'prefix_wrapped_array', + :'namespace_string' => :'namespace_string', + :'namespace_number' => :'namespace_number', + :'namespace_integer' => :'namespace_integer', + :'namespace_boolean' => :'namespace_boolean', + :'namespace_array' => :'namespace_array', + :'namespace_wrapped_array' => :'namespace_wrapped_array', + :'prefix_ns_string' => :'prefix_ns_string', + :'prefix_ns_number' => :'prefix_ns_number', + :'prefix_ns_integer' => :'prefix_ns_integer', + :'prefix_ns_boolean' => :'prefix_ns_boolean', + :'prefix_ns_array' => :'prefix_ns_array', + :'prefix_ns_wrapped_array' => :'prefix_ns_wrapped_array' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'attribute_string' => :'String', + :'attribute_number' => :'Float', + :'attribute_integer' => :'Integer', + :'attribute_boolean' => :'Boolean', + :'wrapped_array' => :'Array', + :'name_string' => :'String', + :'name_number' => :'Float', + :'name_integer' => :'Integer', + :'name_boolean' => :'Boolean', + :'name_array' => :'Array', + :'name_wrapped_array' => :'Array', + :'prefix_string' => :'String', + :'prefix_number' => :'Float', + :'prefix_integer' => :'Integer', + :'prefix_boolean' => :'Boolean', + :'prefix_array' => :'Array', + :'prefix_wrapped_array' => :'Array', + :'namespace_string' => :'String', + :'namespace_number' => :'Float', + :'namespace_integer' => :'Integer', + :'namespace_boolean' => :'Boolean', + :'namespace_array' => :'Array', + :'namespace_wrapped_array' => :'Array', + :'prefix_ns_string' => :'String', + :'prefix_ns_number' => :'Float', + :'prefix_ns_integer' => :'Integer', + :'prefix_ns_boolean' => :'Boolean', + :'prefix_ns_array' => :'Array', + :'prefix_ns_wrapped_array' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::XmlItem` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::XmlItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'attribute_string') + self.attribute_string = attributes[:'attribute_string'] + end + + if attributes.key?(:'attribute_number') + self.attribute_number = attributes[:'attribute_number'] + end + + if attributes.key?(:'attribute_integer') + self.attribute_integer = attributes[:'attribute_integer'] + end + + if attributes.key?(:'attribute_boolean') + self.attribute_boolean = attributes[:'attribute_boolean'] + end + + if attributes.key?(:'wrapped_array') + if (value = attributes[:'wrapped_array']).is_a?(Array) + self.wrapped_array = value + end + end + + if attributes.key?(:'name_string') + self.name_string = attributes[:'name_string'] + end + + if attributes.key?(:'name_number') + self.name_number = attributes[:'name_number'] + end + + if attributes.key?(:'name_integer') + self.name_integer = attributes[:'name_integer'] + end + + if attributes.key?(:'name_boolean') + self.name_boolean = attributes[:'name_boolean'] + end + + if attributes.key?(:'name_array') + if (value = attributes[:'name_array']).is_a?(Array) + self.name_array = value + end + end + + if attributes.key?(:'name_wrapped_array') + if (value = attributes[:'name_wrapped_array']).is_a?(Array) + self.name_wrapped_array = value + end + end + + if attributes.key?(:'prefix_string') + self.prefix_string = attributes[:'prefix_string'] + end + + if attributes.key?(:'prefix_number') + self.prefix_number = attributes[:'prefix_number'] + end + + if attributes.key?(:'prefix_integer') + self.prefix_integer = attributes[:'prefix_integer'] + end + + if attributes.key?(:'prefix_boolean') + self.prefix_boolean = attributes[:'prefix_boolean'] + end + + if attributes.key?(:'prefix_array') + if (value = attributes[:'prefix_array']).is_a?(Array) + self.prefix_array = value + end + end + + if attributes.key?(:'prefix_wrapped_array') + if (value = attributes[:'prefix_wrapped_array']).is_a?(Array) + self.prefix_wrapped_array = value + end + end + + if attributes.key?(:'namespace_string') + self.namespace_string = attributes[:'namespace_string'] + end + + if attributes.key?(:'namespace_number') + self.namespace_number = attributes[:'namespace_number'] + end + + if attributes.key?(:'namespace_integer') + self.namespace_integer = attributes[:'namespace_integer'] + end + + if attributes.key?(:'namespace_boolean') + self.namespace_boolean = attributes[:'namespace_boolean'] + end + + if attributes.key?(:'namespace_array') + if (value = attributes[:'namespace_array']).is_a?(Array) + self.namespace_array = value + end + end + + if attributes.key?(:'namespace_wrapped_array') + if (value = attributes[:'namespace_wrapped_array']).is_a?(Array) + self.namespace_wrapped_array = value + end + end + + if attributes.key?(:'prefix_ns_string') + self.prefix_ns_string = attributes[:'prefix_ns_string'] + end + + if attributes.key?(:'prefix_ns_number') + self.prefix_ns_number = attributes[:'prefix_ns_number'] + end + + if attributes.key?(:'prefix_ns_integer') + self.prefix_ns_integer = attributes[:'prefix_ns_integer'] + end + + if attributes.key?(:'prefix_ns_boolean') + self.prefix_ns_boolean = attributes[:'prefix_ns_boolean'] + end + + if attributes.key?(:'prefix_ns_array') + if (value = attributes[:'prefix_ns_array']).is_a?(Array) + self.prefix_ns_array = value + end + end + + if attributes.key?(:'prefix_ns_wrapped_array') + if (value = attributes[:'prefix_ns_wrapped_array']).is_a?(Array) + self.prefix_ns_wrapped_array = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attribute_string == o.attribute_string && + attribute_number == o.attribute_number && + attribute_integer == o.attribute_integer && + attribute_boolean == o.attribute_boolean && + wrapped_array == o.wrapped_array && + name_string == o.name_string && + name_number == o.name_number && + name_integer == o.name_integer && + name_boolean == o.name_boolean && + name_array == o.name_array && + name_wrapped_array == o.name_wrapped_array && + prefix_string == o.prefix_string && + prefix_number == o.prefix_number && + prefix_integer == o.prefix_integer && + prefix_boolean == o.prefix_boolean && + prefix_array == o.prefix_array && + prefix_wrapped_array == o.prefix_wrapped_array && + namespace_string == o.namespace_string && + namespace_number == o.namespace_number && + namespace_integer == o.namespace_integer && + namespace_boolean == o.namespace_boolean && + namespace_array == o.namespace_array && + namespace_wrapped_array == o.namespace_wrapped_array && + prefix_ns_string == o.prefix_ns_string && + prefix_ns_number == o.prefix_ns_number && + prefix_ns_integer == o.prefix_ns_integer && + prefix_ns_boolean == o.prefix_ns_boolean && + prefix_ns_array == o.prefix_ns_array && + prefix_ns_wrapped_array == o.prefix_ns_wrapped_array + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [attribute_string, attribute_number, attribute_integer, attribute_boolean, wrapped_array, name_string, name_number, name_integer, name_boolean, name_array, name_wrapped_array, prefix_string, prefix_number, prefix_integer, prefix_boolean, prefix_array, prefix_wrapped_array, namespace_string, namespace_number, namespace_integer, namespace_boolean, namespace_array, namespace_wrapped_array, prefix_ns_string, prefix_ns_number, prefix_ns_integer, prefix_ns_boolean, prefix_ns_array, prefix_ns_wrapped_array].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/version.rb b/samples/client/petstore/ruby-faraday/lib/petstore/version.rb index 7f71ec18157..29645445838 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/version.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/version.rb @@ -3,10 +3,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/petstore.gemspec b/samples/client/petstore/ruby-faraday/petstore.gemspec index 6d22555fd42..6cbf88ba127 100644 --- a/samples/client/petstore/ruby-faraday/petstore.gemspec +++ b/samples/client/petstore/ruby-faraday/petstore.gemspec @@ -5,10 +5,10 @@ #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ -OpenAPI spec version: 1.0.0 +The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.3-SNAPSHOT +OpenAPI Generator version: 4.1.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_any_type_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_any_type_spec.rb new file mode 100644 index 00000000000..846f3dec887 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_any_type_spec.rb @@ -0,0 +1,41 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::AdditionalPropertiesAnyType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'AdditionalPropertiesAnyType' do + before do + # run before each test + @instance = Petstore::AdditionalPropertiesAnyType.new + end + + after do + # run after each test + end + + describe 'test an instance of AdditionalPropertiesAnyType' do + it 'should create an instance of AdditionalPropertiesAnyType' do + expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesAnyType) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_array_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_array_spec.rb new file mode 100644 index 00000000000..ef280e7316e --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_array_spec.rb @@ -0,0 +1,41 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::AdditionalPropertiesArray +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'AdditionalPropertiesArray' do + before do + # run before each test + @instance = Petstore::AdditionalPropertiesArray.new + end + + after do + # run after each test + end + + describe 'test an instance of AdditionalPropertiesArray' do + it 'should create an instance of AdditionalPropertiesArray' do + expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesArray) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_boolean_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_boolean_spec.rb new file mode 100644 index 00000000000..c56d64e4188 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_boolean_spec.rb @@ -0,0 +1,41 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::AdditionalPropertiesBoolean +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'AdditionalPropertiesBoolean' do + before do + # run before each test + @instance = Petstore::AdditionalPropertiesBoolean.new + end + + after do + # run after each test + end + + describe 'test an instance of AdditionalPropertiesBoolean' do + it 'should create an instance of AdditionalPropertiesBoolean' do + expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesBoolean) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_integer_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_integer_spec.rb new file mode 100644 index 00000000000..78868109a69 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_integer_spec.rb @@ -0,0 +1,41 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::AdditionalPropertiesInteger +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'AdditionalPropertiesInteger' do + before do + # run before each test + @instance = Petstore::AdditionalPropertiesInteger.new + end + + after do + # run after each test + end + + describe 'test an instance of AdditionalPropertiesInteger' do + it 'should create an instance of AdditionalPropertiesInteger' do + expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesInteger) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_number_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_number_spec.rb new file mode 100644 index 00000000000..9a33ded47a6 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_number_spec.rb @@ -0,0 +1,41 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::AdditionalPropertiesNumber +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'AdditionalPropertiesNumber' do + before do + # run before each test + @instance = Petstore::AdditionalPropertiesNumber.new + end + + after do + # run after each test + end + + describe 'test an instance of AdditionalPropertiesNumber' do + it 'should create an instance of AdditionalPropertiesNumber' do + expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesNumber) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_object_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_object_spec.rb new file mode 100644 index 00000000000..c9182ce6646 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_object_spec.rb @@ -0,0 +1,41 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::AdditionalPropertiesObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'AdditionalPropertiesObject' do + before do + # run before each test + @instance = Petstore::AdditionalPropertiesObject.new + end + + after do + # run after each test + end + + describe 'test an instance of AdditionalPropertiesObject' do + it 'should create an instance of AdditionalPropertiesObject' do + expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesObject) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/additional_properties_string_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_string_spec.rb new file mode 100644 index 00000000000..b2c5288ec48 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/additional_properties_string_spec.rb @@ -0,0 +1,41 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::AdditionalPropertiesString +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'AdditionalPropertiesString' do + before do + # run before each test + @instance = Petstore::AdditionalPropertiesString.new + end + + after do + # run after each test + end + + describe 'test an instance of AdditionalPropertiesString' do + it 'should create an instance of AdditionalPropertiesString' do + expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesString) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb new file mode 100644 index 00000000000..49859a0524f --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb @@ -0,0 +1,41 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::CatAllOf +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'CatAllOf' do + before do + # run before each test + @instance = Petstore::CatAllOf.new + end + + after do + # run after each test + end + + describe 'test an instance of CatAllOf' do + it 'should create an instance of CatAllOf' do + expect(@instance).to be_instance_of(Petstore::CatAllOf) + end + end + describe 'test attribute "declawed"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb new file mode 100644 index 00000000000..6cba24ecd94 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb @@ -0,0 +1,41 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::DogAllOf +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'DogAllOf' do + before do + # run before each test + @instance = Petstore::DogAllOf.new + end + + after do + # run after each test + end + + describe 'test an instance of DogAllOf' do + it 'should create an instance of DogAllOf' do + expect(@instance).to be_instance_of(Petstore::DogAllOf) + end + end + describe 'test attribute "breed"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/type_holder_default_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/type_holder_default_spec.rb new file mode 100644 index 00000000000..3cee11d7ba0 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/type_holder_default_spec.rb @@ -0,0 +1,65 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::TypeHolderDefault +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TypeHolderDefault' do + before do + # run before each test + @instance = Petstore::TypeHolderDefault.new + end + + after do + # run after each test + end + + describe 'test an instance of TypeHolderDefault' do + it 'should create an instance of TypeHolderDefault' do + expect(@instance).to be_instance_of(Petstore::TypeHolderDefault) + end + end + describe 'test attribute "string_item"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_item"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "integer_item"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "bool_item"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "array_item"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/type_holder_example_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/type_holder_example_spec.rb new file mode 100644 index 00000000000..0edc334dd65 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/type_holder_example_spec.rb @@ -0,0 +1,65 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::TypeHolderExample +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TypeHolderExample' do + before do + # run before each test + @instance = Petstore::TypeHolderExample.new + end + + after do + # run after each test + end + + describe 'test an instance of TypeHolderExample' do + it 'should create an instance of TypeHolderExample' do + expect(@instance).to be_instance_of(Petstore::TypeHolderExample) + end + end + describe 'test attribute "string_item"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_item"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "integer_item"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "bool_item"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "array_item"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/client/petstore/ruby-faraday/spec/models/xml_item_spec.rb b/samples/client/petstore/ruby-faraday/spec/models/xml_item_spec.rb new file mode 100644 index 00000000000..c7d06a3580e --- /dev/null +++ b/samples/client/petstore/ruby-faraday/spec/models/xml_item_spec.rb @@ -0,0 +1,209 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::XmlItem +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'XmlItem' do + before do + # run before each test + @instance = Petstore::XmlItem.new + end + + after do + # run after each test + end + + describe 'test an instance of XmlItem' do + it 'should create an instance of XmlItem' do + expect(@instance).to be_instance_of(Petstore::XmlItem) + end + end + describe 'test attribute "attribute_string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "attribute_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "attribute_integer"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "attribute_boolean"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "wrapped_array"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name_string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name_integer"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name_boolean"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name_array"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name_wrapped_array"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "prefix_string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "prefix_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "prefix_integer"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "prefix_boolean"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "prefix_array"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "prefix_wrapped_array"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "namespace_string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "namespace_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "namespace_integer"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "namespace_boolean"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "namespace_array"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "namespace_wrapped_array"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "prefix_ns_string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "prefix_ns_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "prefix_ns_integer"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "prefix_ns_boolean"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "prefix_ns_array"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "prefix_ns_wrapped_array"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/.gitignore b/samples/openapi3/client/petstore/ruby-faraday/.gitignore new file mode 100644 index 00000000000..05a17cb8f0a --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/.gitignore @@ -0,0 +1,39 @@ +# Generated by: https://openapi-generator.tech +# + +*.gem +*.rbc +/.config +/coverage/ +/InstalledFiles +/pkg/ +/spec/reports/ +/spec/examples.txt +/test/tmp/ +/test/version_tmp/ +/tmp/ + +## Specific to RubyMotion: +.dat* +.repl_history +build/ + +## Documentation cache and generated files: +/.yardoc/ +/_yardoc/ +/doc/ +/rdoc/ + +## Environment normalization: +/.bundle/ +/vendor/bundle +/lib/bundler/man/ + +# for a library or gem, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# Gemfile.lock +# .ruby-version +# .ruby-gemset + +# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: +.rvmrc diff --git a/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator-ignore b/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/VERSION b/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/VERSION new file mode 100644 index 00000000000..83a328a9227 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ruby-faraday/.rspec b/samples/openapi3/client/petstore/ruby-faraday/.rspec new file mode 100644 index 00000000000..83e16f80447 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/.rspec @@ -0,0 +1,2 @@ +--color +--require spec_helper diff --git a/samples/openapi3/client/petstore/ruby-faraday/.rubocop.yml b/samples/openapi3/client/petstore/ruby-faraday/.rubocop.yml new file mode 100644 index 00000000000..0ef33ce5e32 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/.rubocop.yml @@ -0,0 +1,154 @@ +# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) +# Automatically generated by OpenAPI Generator (https://openapi-generator.tech) +AllCops: + TargetRubyVersion: 2.4 + # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop + # to ignore them, so only the ones explicitly set in this file are enabled. + DisabledByDefault: true + Exclude: + - '**/templates/**/*' + - '**/vendor/**/*' + - 'actionpack/lib/action_dispatch/journey/parser.rb' + +# Prefer &&/|| over and/or. +Style/AndOr: + Enabled: true + +# Do not use braces for hash literals when they are the last argument of a +# method call. +Style/BracesAroundHashParameters: + Enabled: true + EnforcedStyle: context_dependent + +# Align `when` with `case`. +Layout/CaseIndentation: + Enabled: true + +# Align comments with method definitions. +Layout/CommentIndentation: + Enabled: true + +Layout/ElseAlignment: + Enabled: true + +Layout/EmptyLineAfterMagicComment: + Enabled: true + +# In a regular class definition, no empty lines around the body. +Layout/EmptyLinesAroundClassBody: + Enabled: true + +# In a regular method definition, no empty lines around the body. +Layout/EmptyLinesAroundMethodBody: + Enabled: true + +# In a regular module definition, no empty lines around the body. +Layout/EmptyLinesAroundModuleBody: + Enabled: true + +Layout/IndentFirstArgument: + Enabled: true + +# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. +Style/HashSyntax: + Enabled: false + +# Method definitions after `private` or `protected` isolated calls need one +# extra level of indentation. +Layout/IndentationConsistency: + Enabled: true + EnforcedStyle: rails + +# Two spaces, no tabs (for indentation). +Layout/IndentationWidth: + Enabled: true + +Layout/LeadingCommentSpace: + Enabled: true + +Layout/SpaceAfterColon: + Enabled: true + +Layout/SpaceAfterComma: + Enabled: true + +Layout/SpaceAroundEqualsInParameterDefault: + Enabled: true + +Layout/SpaceAroundKeyword: + Enabled: true + +Layout/SpaceAroundOperators: + Enabled: true + +Layout/SpaceBeforeComma: + Enabled: true + +Layout/SpaceBeforeFirstArg: + Enabled: true + +Style/DefWithParentheses: + Enabled: true + +# Defining a method with parameters needs parentheses. +Style/MethodDefParentheses: + Enabled: true + +Style/FrozenStringLiteralComment: + Enabled: false + EnforcedStyle: always + +# Use `foo {}` not `foo{}`. +Layout/SpaceBeforeBlockBraces: + Enabled: true + +# Use `foo { bar }` not `foo {bar}`. +Layout/SpaceInsideBlockBraces: + Enabled: true + +# Use `{ a: 1 }` not `{a:1}`. +Layout/SpaceInsideHashLiteralBraces: + Enabled: true + +Layout/SpaceInsideParens: + Enabled: true + +# Check quotes usage according to lint rule below. +#Style/StringLiterals: +# Enabled: true +# EnforcedStyle: single_quotes + +# Detect hard tabs, no hard tabs. +Layout/Tab: + Enabled: true + +# Blank lines should not have any spaces. +Layout/TrailingBlankLines: + Enabled: true + +# No trailing whitespace. +Layout/TrailingWhitespace: + Enabled: false + +# Use quotes for string literals when they are enough. +Style/UnneededPercentQ: + Enabled: true + +# Align `end` with the matching keyword or starting expression except for +# assignments, where it should be aligned with the LHS. +Layout/EndAlignment: + Enabled: true + EnforcedStyleAlignWith: variable + AutoCorrect: true + +# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. +Lint/RequireParentheses: + Enabled: true + +Style/RedundantReturn: + Enabled: true + AllowMultipleReturnValues: true + +Style/Semicolon: + Enabled: true + AllowAsExpressionSeparator: true diff --git a/samples/openapi3/client/petstore/ruby-faraday/.travis.yml b/samples/openapi3/client/petstore/ruby-faraday/.travis.yml new file mode 100644 index 00000000000..d2d526df594 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/.travis.yml @@ -0,0 +1,11 @@ +language: ruby +cache: bundler +rvm: + - 2.3 + - 2.4 + - 2.5 +script: + - bundle install --path vendor/bundle + - bundle exec rspec + - gem build petstore.gemspec + - gem install ./petstore-1.0.0.gem diff --git a/samples/openapi3/client/petstore/ruby-faraday/Gemfile b/samples/openapi3/client/petstore/ruby-faraday/Gemfile new file mode 100644 index 00000000000..69255e559f7 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/Gemfile @@ -0,0 +1,9 @@ +source 'https://rubygems.org' + +gemspec + +group :development, :test do + gem 'rake', '~> 12.0.0' + gem 'pry-byebug' + gem 'rubocop', '~> 0.66.0' +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/README.md b/samples/openapi3/client/petstore/ruby-faraday/README.md new file mode 100644 index 00000000000..6be30fc3115 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/README.md @@ -0,0 +1,204 @@ +# petstore + +Petstore - the Ruby gem for the OpenAPI Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.RubyClientCodegen + +## Installation + +### Build a gem + +To build the Ruby code into a gem: + +```shell +gem build petstore.gemspec +``` + +Then either install the gem locally: + +```shell +gem install ./petstore-1.0.0.gem +``` + +(for development, run `gem install --dev ./petstore-1.0.0.gem` to install the development dependencies) + +or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). + +Finally add this to the Gemfile: + + gem 'petstore', '~> 1.0.0' + +### Install from Git + +If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: + + gem 'petstore', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' + +### Include the Ruby code directly + +Include the Ruby code directly using `-I` as follows: + +```shell +ruby -Ilib script.rb +``` + +## Getting Started + +Please follow the [installation](#installation) procedure and then run the following code: + +```ruby +# Load the gem +require 'petstore' + +api_instance = Petstore::AnotherFakeApi.new +client = Petstore::Client.new # Client | client model + +begin + #To test special tags + result = api_instance.call_123_test_special_tags(client) + p result +rescue Petstore::ApiError => e + puts "Exception when calling AnotherFakeApi->call_123_test_special_tags: #{e}" +end + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*Petstore::AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags +*Petstore::DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo | +*Petstore::FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint +*Petstore::FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | +*Petstore::FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | +*Petstore::FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | +*Petstore::FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | +*Petstore::FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | +*Petstore::FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | +*Petstore::FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model +*Petstore::FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*Petstore::FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +*Petstore::FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +*Petstore::FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*Petstore::FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*Petstore::FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case +*Petstore::PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +*Petstore::PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +*Petstore::PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +*Petstore::PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +*Petstore::PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +*Petstore::PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet +*Petstore::PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data +*Petstore::PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image +*Petstore::PetApi* | [**upload_file_with_required_file**](docs/PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*Petstore::StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*Petstore::StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status +*Petstore::StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID +*Petstore::StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet +*Petstore::UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user +*Petstore::UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array +*Petstore::UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array +*Petstore::UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +*Petstore::UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +*Petstore::UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system +*Petstore::UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +*Petstore::UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user + + +## Documentation for Models + + - [Petstore::AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [Petstore::Animal](docs/Animal.md) + - [Petstore::ApiResponse](docs/ApiResponse.md) + - [Petstore::ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [Petstore::ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [Petstore::ArrayTest](docs/ArrayTest.md) + - [Petstore::Capitalization](docs/Capitalization.md) + - [Petstore::Cat](docs/Cat.md) + - [Petstore::CatAllOf](docs/CatAllOf.md) + - [Petstore::Category](docs/Category.md) + - [Petstore::ClassModel](docs/ClassModel.md) + - [Petstore::Client](docs/Client.md) + - [Petstore::Dog](docs/Dog.md) + - [Petstore::DogAllOf](docs/DogAllOf.md) + - [Petstore::EnumArrays](docs/EnumArrays.md) + - [Petstore::EnumClass](docs/EnumClass.md) + - [Petstore::EnumTest](docs/EnumTest.md) + - [Petstore::File](docs/File.md) + - [Petstore::FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [Petstore::Foo](docs/Foo.md) + - [Petstore::FormatTest](docs/FormatTest.md) + - [Petstore::HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [Petstore::HealthCheckResult](docs/HealthCheckResult.md) + - [Petstore::InlineObject](docs/InlineObject.md) + - [Petstore::InlineObject1](docs/InlineObject1.md) + - [Petstore::InlineObject2](docs/InlineObject2.md) + - [Petstore::InlineObject3](docs/InlineObject3.md) + - [Petstore::InlineObject4](docs/InlineObject4.md) + - [Petstore::InlineObject5](docs/InlineObject5.md) + - [Petstore::InlineResponseDefault](docs/InlineResponseDefault.md) + - [Petstore::List](docs/List.md) + - [Petstore::MapTest](docs/MapTest.md) + - [Petstore::MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Petstore::Model200Response](docs/Model200Response.md) + - [Petstore::ModelReturn](docs/ModelReturn.md) + - [Petstore::Name](docs/Name.md) + - [Petstore::NullableClass](docs/NullableClass.md) + - [Petstore::NumberOnly](docs/NumberOnly.md) + - [Petstore::Order](docs/Order.md) + - [Petstore::OuterComposite](docs/OuterComposite.md) + - [Petstore::OuterEnum](docs/OuterEnum.md) + - [Petstore::OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [Petstore::OuterEnumInteger](docs/OuterEnumInteger.md) + - [Petstore::OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) + - [Petstore::Pet](docs/Pet.md) + - [Petstore::ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [Petstore::SpecialModelName](docs/SpecialModelName.md) + - [Petstore::Tag](docs/Tag.md) + - [Petstore::User](docs/User.md) + + +## Documentation for Authorization + + +### api_key + + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + +### api_key_query + + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + +### bearer_test + +- **Type**: Bearer authentication (JWT) + +### http_basic_test + +- **Type**: HTTP basic authentication + +### petstore_auth + + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + diff --git a/samples/openapi3/client/petstore/ruby-faraday/Rakefile b/samples/openapi3/client/petstore/ruby-faraday/Rakefile new file mode 100644 index 00000000000..c72ca30d454 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/Rakefile @@ -0,0 +1,10 @@ +require "bundler/gem_tasks" + +begin + require 'rspec/core/rake_task' + + RSpec::Core::RakeTask.new(:spec) + task default: :spec +rescue LoadError + # no rspec available +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/ruby-faraday/docs/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..e0d6811081c --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/AdditionalPropertiesClass.md @@ -0,0 +1,19 @@ +# Petstore::AdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**map_property** | **Hash<String, String>** | | [optional] +**map_of_map_property** | **Hash<String, Hash<String, String>>** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::AdditionalPropertiesClass.new(map_property: null, + map_of_map_property: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/Animal.md b/samples/openapi3/client/petstore/ruby-faraday/docs/Animal.md new file mode 100644 index 00000000000..80e132d13e4 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/Animal.md @@ -0,0 +1,19 @@ +# Petstore::Animal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **String** | | +**color** | **String** | | [optional] [default to 'red'] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::Animal.new(class_name: null, + color: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/ruby-faraday/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..d7b52283ea5 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/AnotherFakeApi.md @@ -0,0 +1,56 @@ +# Petstore::AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**call_123_test_special_tags**](AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags + + + +## call_123_test_special_tags + +> Client call_123_test_special_tags(client) + +To test special tags + +To test special tags and operation ID starting with number + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::AnotherFakeApi.new +client = Petstore::Client.new # Client | client model + +begin + #To test special tags + result = api_instance.call_123_test_special_tags(client) + p result +rescue Petstore::ApiError => e + puts "Exception when calling AnotherFakeApi->call_123_test_special_tags: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/ApiResponse.md b/samples/openapi3/client/petstore/ruby-faraday/docs/ApiResponse.md new file mode 100644 index 00000000000..c0ac7c4b4c1 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/ApiResponse.md @@ -0,0 +1,21 @@ +# Petstore::ApiResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **Integer** | | [optional] +**type** | **String** | | [optional] +**message** | **String** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::ApiResponse.new(code: null, + type: null, + message: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/ruby-faraday/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..5bb9ff33be2 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,17 @@ +# Petstore::ArrayOfArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_array_number** | **Array<Array<Float>>** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::ArrayOfArrayOfNumberOnly.new(array_array_number: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/ruby-faraday/docs/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..8adb00978ac --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/ArrayOfNumberOnly.md @@ -0,0 +1,17 @@ +# Petstore::ArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_number** | **Array<Float>** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::ArrayOfNumberOnly.new(array_number: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/ArrayTest.md b/samples/openapi3/client/petstore/ruby-faraday/docs/ArrayTest.md new file mode 100644 index 00000000000..76e3866ba9c --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/ArrayTest.md @@ -0,0 +1,21 @@ +# Petstore::ArrayTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_of_string** | **Array<String>** | | [optional] +**array_array_of_integer** | **Array<Array<Integer>>** | | [optional] +**array_array_of_model** | **Array<Array<ReadOnlyFirst>>** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::ArrayTest.new(array_of_string: null, + array_array_of_integer: null, + array_array_of_model: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/Capitalization.md b/samples/openapi3/client/petstore/ruby-faraday/docs/Capitalization.md new file mode 100644 index 00000000000..d1ac69ceb18 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/Capitalization.md @@ -0,0 +1,27 @@ +# Petstore::Capitalization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**small_camel** | **String** | | [optional] +**capital_camel** | **String** | | [optional] +**small_snake** | **String** | | [optional] +**capital_snake** | **String** | | [optional] +**sca_eth_flow_points** | **String** | | [optional] +**att_name** | **String** | Name of the pet | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::Capitalization.new(small_camel: null, + capital_camel: null, + small_snake: null, + capital_snake: null, + sca_eth_flow_points: null, + att_name: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/Cat.md b/samples/openapi3/client/petstore/ruby-faraday/docs/Cat.md new file mode 100644 index 00000000000..054fbfadafd --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/Cat.md @@ -0,0 +1,17 @@ +# Petstore::Cat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **Boolean** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::Cat.new(declawed: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/CatAllOf.md b/samples/openapi3/client/petstore/ruby-faraday/docs/CatAllOf.md new file mode 100644 index 00000000000..a83a6f75662 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/CatAllOf.md @@ -0,0 +1,17 @@ +# Petstore::CatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **Boolean** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::CatAllOf.new(declawed: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/Category.md b/samples/openapi3/client/petstore/ruby-faraday/docs/Category.md new file mode 100644 index 00000000000..942f88759ea --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/Category.md @@ -0,0 +1,19 @@ +# Petstore::Category + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | | [optional] +**name** | **String** | | [default to 'default-name'] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::Category.new(id: null, + name: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/ClassModel.md b/samples/openapi3/client/petstore/ruby-faraday/docs/ClassModel.md new file mode 100644 index 00000000000..faf38fde16d --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/ClassModel.md @@ -0,0 +1,17 @@ +# Petstore::ClassModel + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_class** | **String** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::ClassModel.new(_class: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/Client.md b/samples/openapi3/client/petstore/ruby-faraday/docs/Client.md new file mode 100644 index 00000000000..da87ce113cb --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/Client.md @@ -0,0 +1,17 @@ +# Petstore::Client + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **String** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::Client.new(client: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/DefaultApi.md b/samples/openapi3/client/petstore/ruby-faraday/docs/DefaultApi.md new file mode 100644 index 00000000000..9e2e7712f92 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/DefaultApi.md @@ -0,0 +1,49 @@ +# Petstore::DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**foo_get**](DefaultApi.md#foo_get) | **GET** /foo | + + + +## foo_get + +> InlineResponseDefault foo_get + + + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::DefaultApi.new + +begin + result = api_instance.foo_get + p result +rescue Petstore::ApiError => e + puts "Exception when calling DefaultApi->foo_get: #{e}" +end +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**InlineResponseDefault**](InlineResponseDefault.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/Dog.md b/samples/openapi3/client/petstore/ruby-faraday/docs/Dog.md new file mode 100644 index 00000000000..68c2e5d7e0e --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/Dog.md @@ -0,0 +1,17 @@ +# Petstore::Dog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **String** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::Dog.new(breed: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/DogAllOf.md b/samples/openapi3/client/petstore/ruby-faraday/docs/DogAllOf.md new file mode 100644 index 00000000000..6107fd0c10f --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/DogAllOf.md @@ -0,0 +1,17 @@ +# Petstore::DogAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **String** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::DogAllOf.new(breed: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/EnumArrays.md b/samples/openapi3/client/petstore/ruby-faraday/docs/EnumArrays.md new file mode 100644 index 00000000000..18efa20299d --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/EnumArrays.md @@ -0,0 +1,19 @@ +# Petstore::EnumArrays + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**just_symbol** | **String** | | [optional] +**array_enum** | **Array<String>** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::EnumArrays.new(just_symbol: null, + array_enum: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/EnumClass.md b/samples/openapi3/client/petstore/ruby-faraday/docs/EnumClass.md new file mode 100644 index 00000000000..0fca9b27f5c --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/EnumClass.md @@ -0,0 +1,16 @@ +# Petstore::EnumClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::EnumClass.new() +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/EnumTest.md b/samples/openapi3/client/petstore/ruby-faraday/docs/EnumTest.md new file mode 100644 index 00000000000..e43f0720536 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/EnumTest.md @@ -0,0 +1,31 @@ +# Petstore::EnumTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enum_string** | **String** | | [optional] +**enum_string_required** | **String** | | +**enum_integer** | **Integer** | | [optional] +**enum_number** | **Float** | | [optional] +**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outer_enum_integer** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**outer_enum_default_value** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**outer_enum_integer_default_value** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::EnumTest.new(enum_string: null, + enum_string_required: null, + enum_integer: null, + enum_number: null, + outer_enum: null, + outer_enum_integer: null, + outer_enum_default_value: null, + outer_enum_integer_default_value: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/FakeApi.md b/samples/openapi3/client/petstore/ruby-faraday/docs/FakeApi.md new file mode 100644 index 00000000000..ab79170143b --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/FakeApi.md @@ -0,0 +1,686 @@ +# Petstore::FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint +[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | +[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | +[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | +[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | +[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | +[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | +[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model +[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +[**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data + + + +## fake_health_get + +> HealthCheckResult fake_health_get + +Health check endpoint + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new + +begin + #Health check endpoint + result = api_instance.fake_health_get + p result +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->fake_health_get: #{e}" +end +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## fake_outer_boolean_serialize + +> Boolean fake_outer_boolean_serialize(opts) + + + +Test serialization of outer boolean types + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +opts = { + body: true # Boolean | Input boolean as post body +} + +begin + result = api_instance.fake_outer_boolean_serialize(opts) + p result +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->fake_outer_boolean_serialize: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **Boolean**| Input boolean as post body | [optional] + +### Return type + +**Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +## fake_outer_composite_serialize + +> OuterComposite fake_outer_composite_serialize(opts) + + + +Test serialization of object with outer number type + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +opts = { + outer_composite: Petstore::OuterComposite.new # OuterComposite | Input composite as post body +} + +begin + result = api_instance.fake_outer_composite_serialize(opts) + p result +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->fake_outer_composite_serialize: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outer_composite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +## fake_outer_number_serialize + +> Float fake_outer_number_serialize(opts) + + + +Test serialization of outer number types + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +opts = { + body: 3.4 # Float | Input number as post body +} + +begin + result = api_instance.fake_outer_number_serialize(opts) + p result +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->fake_outer_number_serialize: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **Float**| Input number as post body | [optional] + +### Return type + +**Float** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +## fake_outer_string_serialize + +> String fake_outer_string_serialize(opts) + + + +Test serialization of outer string types + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +opts = { + body: 'body_example' # String | Input string as post body +} + +begin + result = api_instance.fake_outer_string_serialize(opts) + p result +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->fake_outer_string_serialize: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **String**| Input string as post body | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +## test_body_with_file_schema + +> test_body_with_file_schema(file_schema_test_class) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +file_schema_test_class = Petstore::FileSchemaTestClass.new # FileSchemaTestClass | + +begin + api_instance.test_body_with_file_schema(file_schema_test_class) +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->test_body_with_file_schema: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file_schema_test_class** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +## test_body_with_query_params + +> test_body_with_query_params(query, user) + + + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +query = 'query_example' # String | +user = Petstore::User.new # User | + +begin + api_instance.test_body_with_query_params(query, user) +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->test_body_with_query_params: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **user** | [**User**](User.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +## test_client_model + +> Client test_client_model(client) + +To test \"client\" model + +To test \"client\" model + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +client = Petstore::Client.new # Client | client model + +begin + #To test \"client\" model + result = api_instance.test_client_model(client) + p result +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->test_client_model: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## test_endpoint_parameters + +> test_endpoint_parameters(number, double, pattern_without_delimiter, byte, opts) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example + +```ruby +# load the gem +require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure HTTP basic authorization: http_basic_test + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = Petstore::FakeApi.new +number = 3.4 # Float | None +double = 3.4 # Float | None +pattern_without_delimiter = 'pattern_without_delimiter_example' # String | None +byte = 'byte_example' # String | None +opts = { + integer: 56, # Integer | None + int32: 56, # Integer | None + int64: 56, # Integer | None + float: 3.4, # Float | None + string: 'string_example', # String | None + binary: File.new('/path/to/file'), # File | None + date: Date.parse('2013-10-20'), # Date | None + date_time: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | None + password: 'password_example', # String | None + callback: 'callback_example' # String | None +} + +begin + #Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, opts) +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->test_endpoint_parameters: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **Float**| None | + **double** | **Float**| None | + **pattern_without_delimiter** | **String**| None | + **byte** | **String**| None | + **integer** | **Integer**| None | [optional] + **int32** | **Integer**| None | [optional] + **int64** | **Integer**| None | [optional] + **float** | **Float**| None | [optional] + **string** | **String**| None | [optional] + **binary** | **File**| None | [optional] + **date** | **Date**| None | [optional] + **date_time** | **DateTime**| None | [optional] + **password** | **String**| None | [optional] + **callback** | **String**| None | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +## test_enum_parameters + +> test_enum_parameters(opts) + +To test enum parameters + +To test enum parameters + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +opts = { + enum_header_string_array: ['enum_header_string_array_example'], # Array | Header parameter enum test (string array) + enum_header_string: '-efg', # String | Header parameter enum test (string) + enum_query_string_array: ['enum_query_string_array_example'], # Array | Query parameter enum test (string array) + enum_query_string: '-efg', # String | Query parameter enum test (string) + enum_query_integer: 56, # Integer | Query parameter enum test (double) + enum_query_double: 3.4, # Float | Query parameter enum test (double) + enum_form_string_array: '$', # Array | Form parameter enum test (string array) + enum_form_string: '-efg' # String | Form parameter enum test (string) +} + +begin + #To test enum parameters + api_instance.test_enum_parameters(opts) +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->test_enum_parameters: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enum_header_string_array** | [**Array<String>**](String.md)| Header parameter enum test (string array) | [optional] + **enum_header_string** | **String**| Header parameter enum test (string) | [optional] [default to '-efg'] + **enum_query_string_array** | [**Array<String>**](String.md)| Query parameter enum test (string array) | [optional] + **enum_query_string** | **String**| Query parameter enum test (string) | [optional] [default to '-efg'] + **enum_query_integer** | **Integer**| Query parameter enum test (double) | [optional] + **enum_query_double** | **Float**| Query parameter enum test (double) | [optional] + **enum_form_string_array** | [**Array<String>**](String.md)| Form parameter enum test (string array) | [optional] [default to '$'] + **enum_form_string** | **String**| Form parameter enum test (string) | [optional] [default to '-efg'] + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +## test_group_parameters + +> test_group_parameters(required_string_group, required_boolean_group, required_int64_group, opts) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example + +```ruby +# load the gem +require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure Bearer authorization (JWT): bearer_test + config.access_token = 'YOUR_BEARER_TOKEN' +end + +api_instance = Petstore::FakeApi.new +required_string_group = 56 # Integer | Required String in group parameters +required_boolean_group = true # Boolean | Required Boolean in group parameters +required_int64_group = 56 # Integer | Required Integer in group parameters +opts = { + string_group: 56, # Integer | String in group parameters + boolean_group: true, # Boolean | Boolean in group parameters + int64_group: 56 # Integer | Integer in group parameters +} + +begin + #Fake endpoint to test group parameters (optional) + api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, opts) +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->test_group_parameters: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **required_string_group** | **Integer**| Required String in group parameters | + **required_boolean_group** | **Boolean**| Required Boolean in group parameters | + **required_int64_group** | **Integer**| Required Integer in group parameters | + **string_group** | **Integer**| String in group parameters | [optional] + **boolean_group** | **Boolean**| Boolean in group parameters | [optional] + **int64_group** | **Integer**| Integer in group parameters | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[bearer_test](../README.md#bearer_test) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## test_inline_additional_properties + +> test_inline_additional_properties(request_body) + +test inline additionalProperties + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +request_body = {'key' => 'request_body_example'} # Hash | request body + +begin + #test inline additionalProperties + api_instance.test_inline_additional_properties(request_body) +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->test_inline_additional_properties: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **request_body** | [**Hash<String, String>**](String.md)| request body | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +## test_json_form_data + +> test_json_form_data(param, param2) + +test json serialization of form data + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +param = 'param_example' # String | field1 +param2 = 'param2_example' # String | field2 + +begin + #test json serialization of form data + api_instance.test_json_form_data(param, param2) +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->test_json_form_data: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **String**| field1 | + **param2** | **String**| field2 | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..4ccb9083cba --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/FakeClassnameTags123Api.md @@ -0,0 +1,63 @@ +# Petstore::FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**test_classname**](FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case + + + +## test_classname + +> Client test_classname(client) + +To test class name in snake case + +To test class name in snake case + +### Example + +```ruby +# load the gem +require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure API key authorization: api_key_query + config.api_key['api_key_query'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api_key_query'] = 'Bearer' +end + +api_instance = Petstore::FakeClassnameTags123Api.new +client = Petstore::Client.new # Client | client model + +begin + #To test class name in snake case + result = api_instance.test_classname(client) + p result +rescue Petstore::ApiError => e + puts "Exception when calling FakeClassnameTags123Api->test_classname: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/File.md b/samples/openapi3/client/petstore/ruby-faraday/docs/File.md new file mode 100644 index 00000000000..ca8a6e9c313 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/File.md @@ -0,0 +1,17 @@ +# Petstore::File + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source_uri** | **String** | Test capitalization | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::File.new(source_uri: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/ruby-faraday/docs/FileSchemaTestClass.md new file mode 100644 index 00000000000..03ee5f7e803 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/FileSchemaTestClass.md @@ -0,0 +1,19 @@ +# Petstore::FileSchemaTestClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | **File** | | [optional] +**files** | **Array<File>** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::FileSchemaTestClass.new(file: null, + files: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/Foo.md b/samples/openapi3/client/petstore/ruby-faraday/docs/Foo.md new file mode 100644 index 00000000000..9c55a348168 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/Foo.md @@ -0,0 +1,17 @@ +# Petstore::Foo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] [default to 'bar'] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::Foo.new(bar: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/FormatTest.md b/samples/openapi3/client/petstore/ruby-faraday/docs/FormatTest.md new file mode 100644 index 00000000000..ca468a3d650 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/FormatTest.md @@ -0,0 +1,45 @@ +# Petstore::FormatTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **Integer** | | [optional] +**int32** | **Integer** | | [optional] +**int64** | **Integer** | | [optional] +**number** | **Float** | | +**float** | **Float** | | [optional] +**double** | **Float** | | [optional] +**string** | **String** | | [optional] +**byte** | **String** | | +**binary** | **File** | | [optional] +**date** | **Date** | | +**date_time** | **DateTime** | | [optional] +**uuid** | **String** | | [optional] +**password** | **String** | | +**pattern_with_digits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**pattern_with_digits_and_delimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::FormatTest.new(integer: null, + int32: null, + int64: null, + number: null, + float: null, + double: null, + string: null, + byte: null, + binary: null, + date: null, + date_time: null, + uuid: 72f98069-206d-4f12-9f12-3d1e525a8e84, + password: null, + pattern_with_digits: null, + pattern_with_digits_and_delimiter: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/ruby-faraday/docs/HasOnlyReadOnly.md new file mode 100644 index 00000000000..eb82d6b113f --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/HasOnlyReadOnly.md @@ -0,0 +1,19 @@ +# Petstore::HasOnlyReadOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] +**foo** | **String** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::HasOnlyReadOnly.new(bar: null, + foo: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/ruby-faraday/docs/HealthCheckResult.md new file mode 100644 index 00000000000..0382fa78403 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/HealthCheckResult.md @@ -0,0 +1,17 @@ +# Petstore::HealthCheckResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nullable_message** | **String** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::HealthCheckResult.new(nullable_message: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject.md b/samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject.md new file mode 100644 index 00000000000..f5211d44464 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject.md @@ -0,0 +1,19 @@ +# Petstore::InlineObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Updated name of the pet | [optional] +**status** | **String** | Updated status of the pet | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::InlineObject.new(name: null, + status: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject1.md b/samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject1.md new file mode 100644 index 00000000000..bac17e753cd --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject1.md @@ -0,0 +1,19 @@ +# Petstore::InlineObject1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additional_metadata** | **String** | Additional data to pass to server | [optional] +**file** | **File** | file to upload | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::InlineObject1.new(additional_metadata: null, + file: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject2.md b/samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject2.md new file mode 100644 index 00000000000..31118c5b262 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject2.md @@ -0,0 +1,19 @@ +# Petstore::InlineObject2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enum_form_string_array** | **Array<String>** | Form parameter enum test (string array) | [optional] +**enum_form_string** | **String** | Form parameter enum test (string) | [optional] [default to '-efg'] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::InlineObject2.new(enum_form_string_array: null, + enum_form_string: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject3.md b/samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject3.md new file mode 100644 index 00000000000..b6cb7ccb29b --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject3.md @@ -0,0 +1,43 @@ +# Petstore::InlineObject3 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **Integer** | None | [optional] +**int32** | **Integer** | None | [optional] +**int64** | **Integer** | None | [optional] +**number** | **Float** | None | +**float** | **Float** | None | [optional] +**double** | **Float** | None | +**string** | **String** | None | [optional] +**pattern_without_delimiter** | **String** | None | +**byte** | **String** | None | +**binary** | **File** | None | [optional] +**date** | **Date** | None | [optional] +**date_time** | **DateTime** | None | [optional] +**password** | **String** | None | [optional] +**callback** | **String** | None | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::InlineObject3.new(integer: null, + int32: null, + int64: null, + number: null, + float: null, + double: null, + string: null, + pattern_without_delimiter: null, + byte: null, + binary: null, + date: null, + date_time: null, + password: null, + callback: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject4.md b/samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject4.md new file mode 100644 index 00000000000..97179c3e377 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject4.md @@ -0,0 +1,19 @@ +# Petstore::InlineObject4 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**param** | **String** | field1 | +**param2** | **String** | field2 | + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::InlineObject4.new(param: null, + param2: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject5.md b/samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject5.md new file mode 100644 index 00000000000..23c1df99ffe --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/InlineObject5.md @@ -0,0 +1,19 @@ +# Petstore::InlineObject5 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additional_metadata** | **String** | Additional data to pass to server | [optional] +**required_file** | **File** | file to upload | + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::InlineObject5.new(additional_metadata: null, + required_file: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/ruby-faraday/docs/InlineResponseDefault.md new file mode 100644 index 00000000000..b89dc59aa33 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/InlineResponseDefault.md @@ -0,0 +1,17 @@ +# Petstore::InlineResponseDefault + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string** | [**Foo**](Foo.md) | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::InlineResponseDefault.new(string: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/List.md b/samples/openapi3/client/petstore/ruby-faraday/docs/List.md new file mode 100644 index 00000000000..4add9c3fd23 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/List.md @@ -0,0 +1,17 @@ +# Petstore::List + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123_list** | **String** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::List.new(_123_list: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/MapTest.md b/samples/openapi3/client/petstore/ruby-faraday/docs/MapTest.md new file mode 100644 index 00000000000..9bf1793ec08 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/MapTest.md @@ -0,0 +1,23 @@ +# Petstore::MapTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**map_map_of_string** | **Hash<String, Hash<String, String>>** | | [optional] +**map_of_enum_string** | **Hash<String, String>** | | [optional] +**direct_map** | **Hash<String, Boolean>** | | [optional] +**indirect_map** | **Hash<String, Boolean>** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::MapTest.new(map_map_of_string: null, + map_of_enum_string: null, + direct_map: null, + indirect_map: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/ruby-faraday/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..a0d78f1d0b8 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,21 @@ +# Petstore::MixedPropertiesAndAdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **String** | | [optional] +**date_time** | **DateTime** | | [optional] +**map** | [**Hash<String, Animal>**](Animal.md) | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::MixedPropertiesAndAdditionalPropertiesClass.new(uuid: null, + date_time: null, + map: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/Model200Response.md b/samples/openapi3/client/petstore/ruby-faraday/docs/Model200Response.md new file mode 100644 index 00000000000..07a53b60334 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/Model200Response.md @@ -0,0 +1,19 @@ +# Petstore::Model200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **Integer** | | [optional] +**_class** | **String** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::Model200Response.new(name: null, + _class: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/ModelReturn.md b/samples/openapi3/client/petstore/ruby-faraday/docs/ModelReturn.md new file mode 100644 index 00000000000..2e155936c89 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/ModelReturn.md @@ -0,0 +1,17 @@ +# Petstore::ModelReturn + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_return** | **Integer** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::ModelReturn.new(_return: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/Name.md b/samples/openapi3/client/petstore/ruby-faraday/docs/Name.md new file mode 100644 index 00000000000..bf4f381fe8a --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/Name.md @@ -0,0 +1,23 @@ +# Petstore::Name + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **Integer** | | +**snake_case** | **Integer** | | [optional] +**property** | **String** | | [optional] +**_123_number** | **Integer** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::Name.new(name: null, + snake_case: null, + property: null, + _123_number: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/NullableClass.md b/samples/openapi3/client/petstore/ruby-faraday/docs/NullableClass.md new file mode 100644 index 00000000000..3256c4a0b8b --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/NullableClass.md @@ -0,0 +1,39 @@ +# Petstore::NullableClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer_prop** | **Integer** | | [optional] +**number_prop** | **Float** | | [optional] +**boolean_prop** | **Boolean** | | [optional] +**string_prop** | **String** | | [optional] +**date_prop** | **Date** | | [optional] +**datetime_prop** | **DateTime** | | [optional] +**array_nullable_prop** | **Array<Object>** | | [optional] +**array_and_items_nullable_prop** | **Array<Object>** | | [optional] +**array_items_nullable** | **Array<Object>** | | [optional] +**object_nullable_prop** | **Hash<String, Object>** | | [optional] +**object_and_items_nullable_prop** | **Hash<String, Object>** | | [optional] +**object_items_nullable** | **Hash<String, Object>** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::NullableClass.new(integer_prop: null, + number_prop: null, + boolean_prop: null, + string_prop: null, + date_prop: null, + datetime_prop: null, + array_nullable_prop: null, + array_and_items_nullable_prop: null, + array_items_nullable: null, + object_nullable_prop: null, + object_and_items_nullable_prop: null, + object_items_nullable: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/NumberOnly.md b/samples/openapi3/client/petstore/ruby-faraday/docs/NumberOnly.md new file mode 100644 index 00000000000..73c5d0a3ab2 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/NumberOnly.md @@ -0,0 +1,17 @@ +# Petstore::NumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**just_number** | **Float** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::NumberOnly.new(just_number: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/Order.md b/samples/openapi3/client/petstore/ruby-faraday/docs/Order.md new file mode 100644 index 00000000000..e8f38005ae1 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/Order.md @@ -0,0 +1,27 @@ +# Petstore::Order + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | | [optional] +**pet_id** | **Integer** | | [optional] +**quantity** | **Integer** | | [optional] +**ship_date** | **DateTime** | | [optional] +**status** | **String** | Order Status | [optional] +**complete** | **Boolean** | | [optional] [default to false] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::Order.new(id: null, + pet_id: null, + quantity: null, + ship_date: null, + status: null, + complete: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/OuterComposite.md b/samples/openapi3/client/petstore/ruby-faraday/docs/OuterComposite.md new file mode 100644 index 00000000000..2716cd29808 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/OuterComposite.md @@ -0,0 +1,21 @@ +# Petstore::OuterComposite + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**my_number** | **Float** | | [optional] +**my_string** | **String** | | [optional] +**my_boolean** | **Boolean** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::OuterComposite.new(my_number: null, + my_string: null, + my_boolean: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/OuterEnum.md b/samples/openapi3/client/petstore/ruby-faraday/docs/OuterEnum.md new file mode 100644 index 00000000000..e919b6bc78b --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/OuterEnum.md @@ -0,0 +1,16 @@ +# Petstore::OuterEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::OuterEnum.new() +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/ruby-faraday/docs/OuterEnumDefaultValue.md new file mode 100644 index 00000000000..01dc64511ec --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/OuterEnumDefaultValue.md @@ -0,0 +1,16 @@ +# Petstore::OuterEnumDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::OuterEnumDefaultValue.new() +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/ruby-faraday/docs/OuterEnumInteger.md new file mode 100644 index 00000000000..4463ff29c95 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/OuterEnumInteger.md @@ -0,0 +1,16 @@ +# Petstore::OuterEnumInteger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::OuterEnumInteger.new() +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/ruby-faraday/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 00000000000..1623eeaef87 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,16 @@ +# Petstore::OuterEnumIntegerDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::OuterEnumIntegerDefaultValue.new() +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/Pet.md b/samples/openapi3/client/petstore/ruby-faraday/docs/Pet.md new file mode 100644 index 00000000000..efee63091e4 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/Pet.md @@ -0,0 +1,27 @@ +# Petstore::Pet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **String** | | +**photo_urls** | **Array<String>** | | +**tags** | [**Array<Tag>**](Tag.md) | | [optional] +**status** | **String** | pet status in the store | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::Pet.new(id: null, + category: null, + name: doggie, + photo_urls: null, + tags: null, + status: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/PetApi.md b/samples/openapi3/client/petstore/ruby-faraday/docs/PetApi.md new file mode 100644 index 00000000000..6e650f534b1 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/PetApi.md @@ -0,0 +1,493 @@ +# Petstore::PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet +[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image +[**upload_file_with_required_file**](PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) + + + +## add_pet + +> add_pet(pet) + +Add a new pet to the store + +### Example + +```ruby +# load the gem +require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure OAuth2 access token for authorization: petstore_auth + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = Petstore::PetApi.new +pet = Petstore::Pet.new # Pet | Pet object that needs to be added to the store + +begin + #Add a new pet to the store + api_instance.add_pet(pet) +rescue Petstore::ApiError => e + puts "Exception when calling PetApi->add_pet: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +nil (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +## delete_pet + +> delete_pet(pet_id, opts) + +Deletes a pet + +### Example + +```ruby +# load the gem +require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure OAuth2 access token for authorization: petstore_auth + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = Petstore::PetApi.new +pet_id = 56 # Integer | Pet id to delete +opts = { + api_key: 'api_key_example' # String | +} + +begin + #Deletes a pet + api_instance.delete_pet(pet_id, opts) +rescue Petstore::ApiError => e + puts "Exception when calling PetApi->delete_pet: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **Integer**| Pet id to delete | + **api_key** | **String**| | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## find_pets_by_status + +> Array<Pet> find_pets_by_status(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +```ruby +# load the gem +require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure OAuth2 access token for authorization: petstore_auth + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = Petstore::PetApi.new +status = ['status_example'] # Array | Status values that need to be considered for filter + +begin + #Finds Pets by status + result = api_instance.find_pets_by_status(status) + p result +rescue Petstore::ApiError => e + puts "Exception when calling PetApi->find_pets_by_status: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**Array<String>**](String.md)| Status values that need to be considered for filter | + +### Return type + +[**Array<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## find_pets_by_tags + +> Array<Pet> find_pets_by_tags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +```ruby +# load the gem +require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure OAuth2 access token for authorization: petstore_auth + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = Petstore::PetApi.new +tags = ['tags_example'] # Array | Tags to filter by + +begin + #Finds Pets by tags + result = api_instance.find_pets_by_tags(tags) + p result +rescue Petstore::ApiError => e + puts "Exception when calling PetApi->find_pets_by_tags: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**Array<String>**](String.md)| Tags to filter by | + +### Return type + +[**Array<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## get_pet_by_id + +> Pet get_pet_by_id(pet_id) + +Find pet by ID + +Returns a single pet + +### Example + +```ruby +# load the gem +require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure API key authorization: api_key + config.api_key['api_key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api_key'] = 'Bearer' +end + +api_instance = Petstore::PetApi.new +pet_id = 56 # Integer | ID of pet to return + +begin + #Find pet by ID + result = api_instance.get_pet_by_id(pet_id) + p result +rescue Petstore::ApiError => e + puts "Exception when calling PetApi->get_pet_by_id: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **Integer**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## update_pet + +> update_pet(pet) + +Update an existing pet + +### Example + +```ruby +# load the gem +require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure OAuth2 access token for authorization: petstore_auth + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = Petstore::PetApi.new +pet = Petstore::Pet.new # Pet | Pet object that needs to be added to the store + +begin + #Update an existing pet + api_instance.update_pet(pet) +rescue Petstore::ApiError => e + puts "Exception when calling PetApi->update_pet: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +nil (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +## update_pet_with_form + +> update_pet_with_form(pet_id, opts) + +Updates a pet in the store with form data + +### Example + +```ruby +# load the gem +require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure OAuth2 access token for authorization: petstore_auth + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = Petstore::PetApi.new +pet_id = 56 # Integer | ID of pet that needs to be updated +opts = { + name: 'name_example', # String | Updated name of the pet + status: 'status_example' # String | Updated status of the pet +} + +begin + #Updates a pet in the store with form data + api_instance.update_pet_with_form(pet_id, opts) +rescue Petstore::ApiError => e + puts "Exception when calling PetApi->update_pet_with_form: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **Integer**| ID of pet that needs to be updated | + **name** | **String**| Updated name of the pet | [optional] + **status** | **String**| Updated status of the pet | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +## upload_file + +> ApiResponse upload_file(pet_id, opts) + +uploads an image + +### Example + +```ruby +# load the gem +require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure OAuth2 access token for authorization: petstore_auth + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = Petstore::PetApi.new +pet_id = 56 # Integer | ID of pet to update +opts = { + additional_metadata: 'additional_metadata_example', # String | Additional data to pass to server + file: File.new('/path/to/file') # File | file to upload +} + +begin + #uploads an image + result = api_instance.upload_file(pet_id, opts) + p result +rescue Petstore::ApiError => e + puts "Exception when calling PetApi->upload_file: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **Integer**| ID of pet to update | + **additional_metadata** | **String**| Additional data to pass to server | [optional] + **file** | **File**| file to upload | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + + +## upload_file_with_required_file + +> ApiResponse upload_file_with_required_file(pet_id, required_file, opts) + +uploads an image (required) + +### Example + +```ruby +# load the gem +require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure OAuth2 access token for authorization: petstore_auth + config.access_token = 'YOUR ACCESS TOKEN' +end + +api_instance = Petstore::PetApi.new +pet_id = 56 # Integer | ID of pet to update +required_file = File.new('/path/to/file') # File | file to upload +opts = { + additional_metadata: 'additional_metadata_example' # String | Additional data to pass to server +} + +begin + #uploads an image (required) + result = api_instance.upload_file_with_required_file(pet_id, required_file, opts) + p result +rescue Petstore::ApiError => e + puts "Exception when calling PetApi->upload_file_with_required_file: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **Integer**| ID of pet to update | + **required_file** | **File**| file to upload | + **additional_metadata** | **String**| Additional data to pass to server | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/ruby-faraday/docs/ReadOnlyFirst.md new file mode 100644 index 00000000000..af6644b78aa --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/ReadOnlyFirst.md @@ -0,0 +1,19 @@ +# Petstore::ReadOnlyFirst + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] +**baz** | **String** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::ReadOnlyFirst.new(bar: null, + baz: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/SpecialModelName.md b/samples/openapi3/client/petstore/ruby-faraday/docs/SpecialModelName.md new file mode 100644 index 00000000000..498ab811683 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/SpecialModelName.md @@ -0,0 +1,17 @@ +# Petstore::SpecialModelName + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**special_property_name** | **Integer** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::SpecialModelName.new(special_property_name: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/StoreApi.md b/samples/openapi3/client/petstore/ruby-faraday/docs/StoreApi.md new file mode 100644 index 00000000000..ffbc1d04b1e --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/StoreApi.md @@ -0,0 +1,200 @@ +# Petstore::StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status +[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID +[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet + + + +## delete_order + +> delete_order(order_id) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::StoreApi.new +order_id = 'order_id_example' # String | ID of the order that needs to be deleted + +begin + #Delete purchase order by ID + api_instance.delete_order(order_id) +rescue Petstore::ApiError => e + puts "Exception when calling StoreApi->delete_order: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **String**| ID of the order that needs to be deleted | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## get_inventory + +> Hash<String, Integer> get_inventory + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +```ruby +# load the gem +require 'petstore' +# setup authorization +Petstore.configure do |config| + # Configure API key authorization: api_key + config.api_key['api_key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['api_key'] = 'Bearer' +end + +api_instance = Petstore::StoreApi.new + +begin + #Returns pet inventories by status + result = api_instance.get_inventory + p result +rescue Petstore::ApiError => e + puts "Exception when calling StoreApi->get_inventory: #{e}" +end +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**Hash<String, Integer>** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_order_by_id + +> Order get_order_by_id(order_id) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::StoreApi.new +order_id = 56 # Integer | ID of pet that needs to be fetched + +begin + #Find purchase order by ID + result = api_instance.get_order_by_id(order_id) + p result +rescue Petstore::ApiError => e + puts "Exception when calling StoreApi->get_order_by_id: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **Integer**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## place_order + +> Order place_order(order) + +Place an order for a pet + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::StoreApi.new +order = Petstore::Order.new # Order | order placed for purchasing the pet + +begin + #Place an order for a pet + result = api_instance.place_order(order) + p result +rescue Petstore::ApiError => e + puts "Exception when calling StoreApi->place_order: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/xml, application/json + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/Tag.md b/samples/openapi3/client/petstore/ruby-faraday/docs/Tag.md new file mode 100644 index 00000000000..54a66a3f294 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/Tag.md @@ -0,0 +1,19 @@ +# Petstore::Tag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | | [optional] +**name** | **String** | | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::Tag.new(id: null, + name: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/User.md b/samples/openapi3/client/petstore/ruby-faraday/docs/User.md new file mode 100644 index 00000000000..263e9604662 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/User.md @@ -0,0 +1,31 @@ +# Petstore::User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Integer** | | [optional] +**username** | **String** | | [optional] +**first_name** | **String** | | [optional] +**last_name** | **String** | | [optional] +**email** | **String** | | [optional] +**password** | **String** | | [optional] +**phone** | **String** | | [optional] +**user_status** | **Integer** | User Status | [optional] + +## Code Sample + +```ruby +require 'Petstore' + +instance = Petstore::User.new(id: null, + username: null, + first_name: null, + last_name: null, + email: null, + password: null, + phone: null, + user_status: null) +``` + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/UserApi.md b/samples/openapi3/client/petstore/ruby-faraday/docs/UserApi.md new file mode 100644 index 00000000000..631a65ef1f1 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/UserApi.md @@ -0,0 +1,376 @@ +# Petstore::UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_user**](UserApi.md#create_user) | **POST** /user | Create user +[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array +[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array +[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system +[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user + + + +## create_user + +> create_user(user) + +Create user + +This can only be done by the logged in user. + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::UserApi.new +user = Petstore::User.new # User | Created user object + +begin + #Create user + api_instance.create_user(user) +rescue Petstore::ApiError => e + puts "Exception when calling UserApi->create_user: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md)| Created user object | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +## create_users_with_array_input + +> create_users_with_array_input(user) + +Creates list of users with given input array + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::UserApi.new +user = [Petstore::User.new] # Array | List of user object + +begin + #Creates list of users with given input array + api_instance.create_users_with_array_input(user) +rescue Petstore::ApiError => e + puts "Exception when calling UserApi->create_users_with_array_input: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**Array<User>**](User.md)| List of user object | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +## create_users_with_list_input + +> create_users_with_list_input(user) + +Creates list of users with given input array + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::UserApi.new +user = [Petstore::User.new] # Array | List of user object + +begin + #Creates list of users with given input array + api_instance.create_users_with_list_input(user) +rescue Petstore::ApiError => e + puts "Exception when calling UserApi->create_users_with_list_input: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**Array<User>**](User.md)| List of user object | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +## delete_user + +> delete_user(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::UserApi.new +username = 'username_example' # String | The name that needs to be deleted + +begin + #Delete user + api_instance.delete_user(username) +rescue Petstore::ApiError => e + puts "Exception when calling UserApi->delete_user: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be deleted | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## get_user_by_name + +> User get_user_by_name(username) + +Get user by user name + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::UserApi.new +username = 'username_example' # String | The name that needs to be fetched. Use user1 for testing. + +begin + #Get user by user name + result = api_instance.get_user_by_name(username) + p result +rescue Petstore::ApiError => e + puts "Exception when calling UserApi->get_user_by_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## login_user + +> String login_user(username, password) + +Logs user into the system + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::UserApi.new +username = 'username_example' # String | The user name for login +password = 'password_example' # String | The password for login in clear text + +begin + #Logs user into the system + result = api_instance.login_user(username, password) + p result +rescue Petstore::ApiError => e + puts "Exception when calling UserApi->login_user: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The user name for login | + **password** | **String**| The password for login in clear text | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## logout_user + +> logout_user + +Logs out current logged in user session + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::UserApi.new + +begin + #Logs out current logged in user session + api_instance.logout_user +rescue Petstore::ApiError => e + puts "Exception when calling UserApi->logout_user: #{e}" +end +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## update_user + +> update_user(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::UserApi.new +username = 'username_example' # String | name that need to be deleted +user = Petstore::User.new # User | Updated user object + +begin + #Updated user + api_instance.update_user(username, user) +rescue Petstore::ApiError => e + puts "Exception when calling UserApi->update_user: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| name that need to be deleted | + **user** | [**User**](User.md)| Updated user object | + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + diff --git a/samples/openapi3/client/petstore/ruby-faraday/git_push.sh b/samples/openapi3/client/petstore/ruby-faraday/git_push.sh new file mode 100644 index 00000000000..b9fd6af8e05 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/git_push.sh @@ -0,0 +1,55 @@ +#!/bin/sh +# +# Generated by: https://openapi-generator.tech +# +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/openapi3/client/petstore/ruby-faraday/hello.txt b/samples/openapi3/client/petstore/ruby-faraday/hello.txt new file mode 100644 index 00000000000..6769dd60bdf --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/hello.txt @@ -0,0 +1 @@ +Hello world! \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore.rb new file mode 100644 index 00000000000..12ff44084b3 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore.rb @@ -0,0 +1,95 @@ +=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.0-SNAPSHOT + +=end + +# Common files +require 'petstore/api_client' +require 'petstore/api_error' +require 'petstore/version' +require 'petstore/configuration' + +# Models +require 'petstore/models/additional_properties_class' +require 'petstore/models/animal' +require 'petstore/models/api_response' +require 'petstore/models/array_of_array_of_number_only' +require 'petstore/models/array_of_number_only' +require 'petstore/models/array_test' +require 'petstore/models/capitalization' +require 'petstore/models/cat' +require 'petstore/models/cat_all_of' +require 'petstore/models/category' +require 'petstore/models/class_model' +require 'petstore/models/client' +require 'petstore/models/dog' +require 'petstore/models/dog_all_of' +require 'petstore/models/enum_arrays' +require 'petstore/models/enum_class' +require 'petstore/models/enum_test' +require 'petstore/models/file' +require 'petstore/models/file_schema_test_class' +require 'petstore/models/foo' +require 'petstore/models/format_test' +require 'petstore/models/has_only_read_only' +require 'petstore/models/health_check_result' +require 'petstore/models/inline_object' +require 'petstore/models/inline_object1' +require 'petstore/models/inline_object2' +require 'petstore/models/inline_object3' +require 'petstore/models/inline_object4' +require 'petstore/models/inline_object5' +require 'petstore/models/inline_response_default' +require 'petstore/models/list' +require 'petstore/models/map_test' +require 'petstore/models/mixed_properties_and_additional_properties_class' +require 'petstore/models/model200_response' +require 'petstore/models/model_return' +require 'petstore/models/name' +require 'petstore/models/nullable_class' +require 'petstore/models/number_only' +require 'petstore/models/order' +require 'petstore/models/outer_composite' +require 'petstore/models/outer_enum' +require 'petstore/models/outer_enum_default_value' +require 'petstore/models/outer_enum_integer' +require 'petstore/models/outer_enum_integer_default_value' +require 'petstore/models/pet' +require 'petstore/models/read_only_first' +require 'petstore/models/special_model_name' +require 'petstore/models/tag' +require 'petstore/models/user' + +# APIs +require 'petstore/api/another_fake_api' +require 'petstore/api/default_api' +require 'petstore/api/fake_api' +require 'petstore/api/fake_classname_tags123_api' +require 'petstore/api/pet_api' +require 'petstore/api/store_api' +require 'petstore/api/user_api' + +module Petstore + class << self + # Customize default settings for the SDK using block. + # Petstore.configure do |config| + # config.username = "xxx" + # config.password = "xxx" + # end + # If no block given, return the default Configuration object. + def configure + if block_given? + yield(Configuration.default) + else + Configuration.default + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb new file mode 100644 index 00000000000..1765337e463 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb @@ -0,0 +1,86 @@ +=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.0-SNAPSHOT + +=end + +require 'cgi' + +module Petstore + class AnotherFakeApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # To test special tags + # To test special tags and operation ID starting with number + # @param client [Client] client model + # @param [Hash] opts the optional parameters + # @return [Client] + def call_123_test_special_tags(client, opts = {}) + data, _status_code, _headers = call_123_test_special_tags_with_http_info(client, opts) + data + end + + # To test special tags + # To test special tags and operation ID starting with number + # @param client [Client] client model + # @param [Hash] opts the optional parameters + # @return [Array<(Client, Integer, Hash)>] Client data, response status code and response headers + def call_123_test_special_tags_with_http_info(client, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AnotherFakeApi.call_123_test_special_tags ...' + end + # verify the required parameter 'client' is set + if @api_client.config.client_side_validation && client.nil? + fail ArgumentError, "Missing the required parameter 'client' when calling AnotherFakeApi.call_123_test_special_tags" + end + # resource path + local_var_path = '/another-fake/dummy' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(client) + + # return_type + return_type = opts[:return_type] || 'Client' + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AnotherFakeApi#call_123_test_special_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb new file mode 100644 index 00000000000..5c872a2cf8b --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb @@ -0,0 +1,74 @@ +=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.0-SNAPSHOT + +=end + +require 'cgi' + +module Petstore + class DefaultApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # @param [Hash] opts the optional parameters + # @return [InlineResponseDefault] + def foo_get(opts = {}) + data, _status_code, _headers = foo_get_with_http_info(opts) + data + end + + # @param [Hash] opts the optional parameters + # @return [Array<(InlineResponseDefault, Integer, Hash)>] InlineResponseDefault data, response status code and response headers + def foo_get_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.foo_get ...' + end + # resource path + local_var_path = '/foo' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'InlineResponseDefault' + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DefaultApi#foo_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb new file mode 100644 index 00000000000..5e10e0a0fa2 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb @@ -0,0 +1,989 @@ +=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.0-SNAPSHOT + +=end + +require 'cgi' + +module Petstore + class FakeApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Health check endpoint + # @param [Hash] opts the optional parameters + # @return [HealthCheckResult] + def fake_health_get(opts = {}) + data, _status_code, _headers = fake_health_get_with_http_info(opts) + data + end + + # Health check endpoint + # @param [Hash] opts the optional parameters + # @return [Array<(HealthCheckResult, Integer, Hash)>] HealthCheckResult data, response status code and response headers + def fake_health_get_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.fake_health_get ...' + end + # resource path + local_var_path = '/fake/health' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'HealthCheckResult' + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#fake_health_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Test serialization of outer boolean types + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :body Input boolean as post body + # @return [Boolean] + def fake_outer_boolean_serialize(opts = {}) + data, _status_code, _headers = fake_outer_boolean_serialize_with_http_info(opts) + data + end + + # Test serialization of outer boolean types + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :body Input boolean as post body + # @return [Array<(Boolean, Integer, Hash)>] Boolean data, response status code and response headers + def fake_outer_boolean_serialize_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.fake_outer_boolean_serialize ...' + end + # resource path + local_var_path = '/fake/outer/boolean' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body']) + + # return_type + return_type = opts[:return_type] || 'Boolean' + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#fake_outer_boolean_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Test serialization of object with outer number type + # @param [Hash] opts the optional parameters + # @option opts [OuterComposite] :outer_composite Input composite as post body + # @return [OuterComposite] + def fake_outer_composite_serialize(opts = {}) + data, _status_code, _headers = fake_outer_composite_serialize_with_http_info(opts) + data + end + + # Test serialization of object with outer number type + # @param [Hash] opts the optional parameters + # @option opts [OuterComposite] :outer_composite Input composite as post body + # @return [Array<(OuterComposite, Integer, Hash)>] OuterComposite data, response status code and response headers + def fake_outer_composite_serialize_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.fake_outer_composite_serialize ...' + end + # resource path + local_var_path = '/fake/outer/composite' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(opts[:'outer_composite']) + + # return_type + return_type = opts[:return_type] || 'OuterComposite' + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#fake_outer_composite_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Test serialization of outer number types + # @param [Hash] opts the optional parameters + # @option opts [Float] :body Input number as post body + # @return [Float] + def fake_outer_number_serialize(opts = {}) + data, _status_code, _headers = fake_outer_number_serialize_with_http_info(opts) + data + end + + # Test serialization of outer number types + # @param [Hash] opts the optional parameters + # @option opts [Float] :body Input number as post body + # @return [Array<(Float, Integer, Hash)>] Float data, response status code and response headers + def fake_outer_number_serialize_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.fake_outer_number_serialize ...' + end + # resource path + local_var_path = '/fake/outer/number' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body']) + + # return_type + return_type = opts[:return_type] || 'Float' + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#fake_outer_number_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Test serialization of outer string types + # @param [Hash] opts the optional parameters + # @option opts [String] :body Input string as post body + # @return [String] + def fake_outer_string_serialize(opts = {}) + data, _status_code, _headers = fake_outer_string_serialize_with_http_info(opts) + data + end + + # Test serialization of outer string types + # @param [Hash] opts the optional parameters + # @option opts [String] :body Input string as post body + # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers + def fake_outer_string_serialize_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.fake_outer_string_serialize ...' + end + # resource path + local_var_path = '/fake/outer/string' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body']) + + # return_type + return_type = opts[:return_type] || 'String' + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#fake_outer_string_serialize\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # For this test, the body for this request much reference a schema named `File`. + # @param file_schema_test_class [FileSchemaTestClass] + # @param [Hash] opts the optional parameters + # @return [nil] + def test_body_with_file_schema(file_schema_test_class, opts = {}) + test_body_with_file_schema_with_http_info(file_schema_test_class, opts) + nil + end + + # For this test, the body for this request much reference a schema named `File`. + # @param file_schema_test_class [FileSchemaTestClass] + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def test_body_with_file_schema_with_http_info(file_schema_test_class, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_body_with_file_schema ...' + end + # verify the required parameter 'file_schema_test_class' is set + if @api_client.config.client_side_validation && file_schema_test_class.nil? + fail ArgumentError, "Missing the required parameter 'file_schema_test_class' when calling FakeApi.test_body_with_file_schema" + end + # resource path + local_var_path = '/fake/body-with-file-schema' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(file_schema_test_class) + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_body_with_file_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # @param query [String] + # @param user [User] + # @param [Hash] opts the optional parameters + # @return [nil] + def test_body_with_query_params(query, user, opts = {}) + test_body_with_query_params_with_http_info(query, user, opts) + nil + end + + # @param query [String] + # @param user [User] + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def test_body_with_query_params_with_http_info(query, user, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_body_with_query_params ...' + end + # verify the required parameter 'query' is set + if @api_client.config.client_side_validation && query.nil? + fail ArgumentError, "Missing the required parameter 'query' when calling FakeApi.test_body_with_query_params" + end + # verify the required parameter 'user' is set + if @api_client.config.client_side_validation && user.nil? + fail ArgumentError, "Missing the required parameter 'user' when calling FakeApi.test_body_with_query_params" + end + # resource path + local_var_path = '/fake/body-with-query-params' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'query'] = query + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(user) + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_body_with_query_params\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # To test \"client\" model + # To test \"client\" model + # @param client [Client] client model + # @param [Hash] opts the optional parameters + # @return [Client] + def test_client_model(client, opts = {}) + data, _status_code, _headers = test_client_model_with_http_info(client, opts) + data + end + + # To test \"client\" model + # To test \"client\" model + # @param client [Client] client model + # @param [Hash] opts the optional parameters + # @return [Array<(Client, Integer, Hash)>] Client data, response status code and response headers + def test_client_model_with_http_info(client, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_client_model ...' + end + # verify the required parameter 'client' is set + if @api_client.config.client_side_validation && client.nil? + fail ArgumentError, "Missing the required parameter 'client' when calling FakeApi.test_client_model" + end + # resource path + local_var_path = '/fake' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(client) + + # return_type + return_type = opts[:return_type] || 'Client' + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_client_model\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # @param number [Float] None + # @param double [Float] None + # @param pattern_without_delimiter [String] None + # @param byte [String] None + # @param [Hash] opts the optional parameters + # @option opts [Integer] :integer None + # @option opts [Integer] :int32 None + # @option opts [Integer] :int64 None + # @option opts [Float] :float None + # @option opts [String] :string None + # @option opts [File] :binary None + # @option opts [Date] :date None + # @option opts [DateTime] :date_time None + # @option opts [String] :password None + # @option opts [String] :callback None + # @return [nil] + def test_endpoint_parameters(number, double, pattern_without_delimiter, byte, opts = {}) + test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, opts) + nil + end + + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # @param number [Float] None + # @param double [Float] None + # @param pattern_without_delimiter [String] None + # @param byte [String] None + # @param [Hash] opts the optional parameters + # @option opts [Integer] :integer None + # @option opts [Integer] :int32 None + # @option opts [Integer] :int64 None + # @option opts [Float] :float None + # @option opts [String] :string None + # @option opts [File] :binary None + # @option opts [Date] :date None + # @option opts [DateTime] :date_time None + # @option opts [String] :password None + # @option opts [String] :callback None + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_endpoint_parameters ...' + end + # verify the required parameter 'number' is set + if @api_client.config.client_side_validation && number.nil? + fail ArgumentError, "Missing the required parameter 'number' when calling FakeApi.test_endpoint_parameters" + end + if @api_client.config.client_side_validation && number > 543.2 + fail ArgumentError, 'invalid value for "number" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 543.2.' + end + + if @api_client.config.client_side_validation && number < 32.1 + fail ArgumentError, 'invalid value for "number" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 32.1.' + end + + # verify the required parameter 'double' is set + if @api_client.config.client_side_validation && double.nil? + fail ArgumentError, "Missing the required parameter 'double' when calling FakeApi.test_endpoint_parameters" + end + if @api_client.config.client_side_validation && double > 123.4 + fail ArgumentError, 'invalid value for "double" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 123.4.' + end + + if @api_client.config.client_side_validation && double < 67.8 + fail ArgumentError, 'invalid value for "double" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 67.8.' + end + + # verify the required parameter 'pattern_without_delimiter' is set + if @api_client.config.client_side_validation && pattern_without_delimiter.nil? + fail ArgumentError, "Missing the required parameter 'pattern_without_delimiter' when calling FakeApi.test_endpoint_parameters" + end + pattern = Regexp.new(/^[A-Z].*/) + if @api_client.config.client_side_validation && pattern_without_delimiter !~ pattern + fail ArgumentError, "invalid value for 'pattern_without_delimiter' when calling FakeApi.test_endpoint_parameters, must conform to the pattern #{pattern}." + end + + # verify the required parameter 'byte' is set + if @api_client.config.client_side_validation && byte.nil? + fail ArgumentError, "Missing the required parameter 'byte' when calling FakeApi.test_endpoint_parameters" + end + if @api_client.config.client_side_validation && !opts[:'integer'].nil? && opts[:'integer'] > 100 + fail ArgumentError, 'invalid value for "opts[:"integer"]" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 100.' + end + + if @api_client.config.client_side_validation && !opts[:'integer'].nil? && opts[:'integer'] < 10 + fail ArgumentError, 'invalid value for "opts[:"integer"]" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 10.' + end + + if @api_client.config.client_side_validation && !opts[:'int32'].nil? && opts[:'int32'] > 200 + fail ArgumentError, 'invalid value for "opts[:"int32"]" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 200.' + end + + if @api_client.config.client_side_validation && !opts[:'int32'].nil? && opts[:'int32'] < 20 + fail ArgumentError, 'invalid value for "opts[:"int32"]" when calling FakeApi.test_endpoint_parameters, must be greater than or equal to 20.' + end + + if @api_client.config.client_side_validation && !opts[:'float'].nil? && opts[:'float'] > 987.6 + fail ArgumentError, 'invalid value for "opts[:"float"]" when calling FakeApi.test_endpoint_parameters, must be smaller than or equal to 987.6.' + end + + pattern = Regexp.new(/[a-z]/i) + if @api_client.config.client_side_validation && !opts[:'string'].nil? && opts[:'string'] !~ pattern + fail ArgumentError, "invalid value for 'opts[:\"string\"]' when calling FakeApi.test_endpoint_parameters, must conform to the pattern #{pattern}." + end + + if @api_client.config.client_side_validation && !opts[:'password'].nil? && opts[:'password'].to_s.length > 64 + fail ArgumentError, 'invalid value for "opts[:"password"]" when calling FakeApi.test_endpoint_parameters, the character length must be smaller than or equal to 64.' + end + + if @api_client.config.client_side_validation && !opts[:'password'].nil? && opts[:'password'].to_s.length < 10 + fail ArgumentError, 'invalid value for "opts[:"password"]" when calling FakeApi.test_endpoint_parameters, the character length must be great than or equal to 10.' + end + + # resource path + local_var_path = '/fake' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) + + # form parameters + form_params = opts[:form_params] || {} + form_params['number'] = number + form_params['double'] = double + form_params['pattern_without_delimiter'] = pattern_without_delimiter + form_params['byte'] = byte + form_params['integer'] = opts[:'integer'] if !opts[:'integer'].nil? + form_params['int32'] = opts[:'int32'] if !opts[:'int32'].nil? + form_params['int64'] = opts[:'int64'] if !opts[:'int64'].nil? + form_params['float'] = opts[:'float'] if !opts[:'float'].nil? + form_params['string'] = opts[:'string'] if !opts[:'string'].nil? + form_params['binary'] = opts[:'binary'] if !opts[:'binary'].nil? + form_params['date'] = opts[:'date'] if !opts[:'date'].nil? + form_params['dateTime'] = opts[:'date_time'] if !opts[:'date_time'].nil? + form_params['password'] = opts[:'password'] if !opts[:'password'].nil? + form_params['callback'] = opts[:'callback'] if !opts[:'callback'].nil? + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || ['http_basic_test'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_endpoint_parameters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # To test enum parameters + # To test enum parameters + # @param [Hash] opts the optional parameters + # @option opts [Array] :enum_header_string_array Header parameter enum test (string array) + # @option opts [String] :enum_header_string Header parameter enum test (string) (default to '-efg') + # @option opts [Array] :enum_query_string_array Query parameter enum test (string array) + # @option opts [String] :enum_query_string Query parameter enum test (string) (default to '-efg') + # @option opts [Integer] :enum_query_integer Query parameter enum test (double) + # @option opts [Float] :enum_query_double Query parameter enum test (double) + # @option opts [Array] :enum_form_string_array Form parameter enum test (string array) (default to '$') + # @option opts [String] :enum_form_string Form parameter enum test (string) (default to '-efg') + # @return [nil] + def test_enum_parameters(opts = {}) + test_enum_parameters_with_http_info(opts) + nil + end + + # To test enum parameters + # To test enum parameters + # @param [Hash] opts the optional parameters + # @option opts [Array] :enum_header_string_array Header parameter enum test (string array) + # @option opts [String] :enum_header_string Header parameter enum test (string) + # @option opts [Array] :enum_query_string_array Query parameter enum test (string array) + # @option opts [String] :enum_query_string Query parameter enum test (string) + # @option opts [Integer] :enum_query_integer Query parameter enum test (double) + # @option opts [Float] :enum_query_double Query parameter enum test (double) + # @option opts [Array] :enum_form_string_array Form parameter enum test (string array) + # @option opts [String] :enum_form_string Form parameter enum test (string) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def test_enum_parameters_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_enum_parameters ...' + end + allowable_values = [">", "$"] + if @api_client.config.client_side_validation && opts[:'enum_header_string_array'] && !opts[:'enum_header_string_array'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"enum_header_string_array\", must include one of #{allowable_values}" + end + allowable_values = ["_abc", "-efg", "(xyz)"] + if @api_client.config.client_side_validation && opts[:'enum_header_string'] && !allowable_values.include?(opts[:'enum_header_string']) + fail ArgumentError, "invalid value for \"enum_header_string\", must be one of #{allowable_values}" + end + allowable_values = [">", "$"] + if @api_client.config.client_side_validation && opts[:'enum_query_string_array'] && !opts[:'enum_query_string_array'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"enum_query_string_array\", must include one of #{allowable_values}" + end + allowable_values = ["_abc", "-efg", "(xyz)"] + if @api_client.config.client_side_validation && opts[:'enum_query_string'] && !allowable_values.include?(opts[:'enum_query_string']) + fail ArgumentError, "invalid value for \"enum_query_string\", must be one of #{allowable_values}" + end + allowable_values = [1, -2] + if @api_client.config.client_side_validation && opts[:'enum_query_integer'] && !allowable_values.include?(opts[:'enum_query_integer']) + fail ArgumentError, "invalid value for \"enum_query_integer\", must be one of #{allowable_values}" + end + allowable_values = [1.1, -1.2] + if @api_client.config.client_side_validation && opts[:'enum_query_double'] && !allowable_values.include?(opts[:'enum_query_double']) + fail ArgumentError, "invalid value for \"enum_query_double\", must be one of #{allowable_values}" + end + allowable_values = [">", "$"] + if @api_client.config.client_side_validation && opts[:'enum_form_string_array'] && !opts[:'enum_form_string_array'].all? { |item| allowable_values.include?(item) } + fail ArgumentError, "invalid value for \"enum_form_string_array\", must include one of #{allowable_values}" + end + allowable_values = ["_abc", "-efg", "(xyz)"] + if @api_client.config.client_side_validation && opts[:'enum_form_string'] && !allowable_values.include?(opts[:'enum_form_string']) + fail ArgumentError, "invalid value for \"enum_form_string\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/fake' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'enum_query_string_array'] = @api_client.build_collection_param(opts[:'enum_query_string_array'], :multi) if !opts[:'enum_query_string_array'].nil? + query_params[:'enum_query_string'] = opts[:'enum_query_string'] if !opts[:'enum_query_string'].nil? + query_params[:'enum_query_integer'] = opts[:'enum_query_integer'] if !opts[:'enum_query_integer'].nil? + query_params[:'enum_query_double'] = opts[:'enum_query_double'] if !opts[:'enum_query_double'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) + header_params[:'enum_header_string_array'] = @api_client.build_collection_param(opts[:'enum_header_string_array'], :csv) if !opts[:'enum_header_string_array'].nil? + header_params[:'enum_header_string'] = opts[:'enum_header_string'] if !opts[:'enum_header_string'].nil? + + # form parameters + form_params = opts[:form_params] || {} + form_params['enum_form_string_array'] = @api_client.build_collection_param(opts[:'enum_form_string_array'], :csv) if !opts[:'enum_form_string_array'].nil? + form_params['enum_form_string'] = opts[:'enum_form_string'] if !opts[:'enum_form_string'].nil? + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_enum_parameters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Fake endpoint to test group parameters (optional) + # Fake endpoint to test group parameters (optional) + # @param required_string_group [Integer] Required String in group parameters + # @param required_boolean_group [Boolean] Required Boolean in group parameters + # @param required_int64_group [Integer] Required Integer in group parameters + # @param [Hash] opts the optional parameters + # @option opts [Integer] :string_group String in group parameters + # @option opts [Boolean] :boolean_group Boolean in group parameters + # @option opts [Integer] :int64_group Integer in group parameters + # @return [nil] + def test_group_parameters(required_string_group, required_boolean_group, required_int64_group, opts = {}) + test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, opts) + nil + end + + # Fake endpoint to test group parameters (optional) + # Fake endpoint to test group parameters (optional) + # @param required_string_group [Integer] Required String in group parameters + # @param required_boolean_group [Boolean] Required Boolean in group parameters + # @param required_int64_group [Integer] Required Integer in group parameters + # @param [Hash] opts the optional parameters + # @option opts [Integer] :string_group String in group parameters + # @option opts [Boolean] :boolean_group Boolean in group parameters + # @option opts [Integer] :int64_group Integer in group parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_group_parameters ...' + end + # verify the required parameter 'required_string_group' is set + if @api_client.config.client_side_validation && required_string_group.nil? + fail ArgumentError, "Missing the required parameter 'required_string_group' when calling FakeApi.test_group_parameters" + end + # verify the required parameter 'required_boolean_group' is set + if @api_client.config.client_side_validation && required_boolean_group.nil? + fail ArgumentError, "Missing the required parameter 'required_boolean_group' when calling FakeApi.test_group_parameters" + end + # verify the required parameter 'required_int64_group' is set + if @api_client.config.client_side_validation && required_int64_group.nil? + fail ArgumentError, "Missing the required parameter 'required_int64_group' when calling FakeApi.test_group_parameters" + end + # resource path + local_var_path = '/fake' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'required_string_group'] = required_string_group + query_params[:'required_int64_group'] = required_int64_group + query_params[:'string_group'] = opts[:'string_group'] if !opts[:'string_group'].nil? + query_params[:'int64_group'] = opts[:'int64_group'] if !opts[:'int64_group'].nil? + + # header parameters + header_params = opts[:header_params] || {} + header_params[:'required_boolean_group'] = required_boolean_group + header_params[:'boolean_group'] = opts[:'boolean_group'] if !opts[:'boolean_group'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || ['bearer_test'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_group_parameters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # test inline additionalProperties + # @param request_body [Hash] request body + # @param [Hash] opts the optional parameters + # @return [nil] + def test_inline_additional_properties(request_body, opts = {}) + test_inline_additional_properties_with_http_info(request_body, opts) + nil + end + + # test inline additionalProperties + # @param request_body [Hash] request body + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def test_inline_additional_properties_with_http_info(request_body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_inline_additional_properties ...' + end + # verify the required parameter 'request_body' is set + if @api_client.config.client_side_validation && request_body.nil? + fail ArgumentError, "Missing the required parameter 'request_body' when calling FakeApi.test_inline_additional_properties" + end + # resource path + local_var_path = '/fake/inline-additionalProperties' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(request_body) + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_inline_additional_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # test json serialization of form data + # @param param [String] field1 + # @param param2 [String] field2 + # @param [Hash] opts the optional parameters + # @return [nil] + def test_json_form_data(param, param2, opts = {}) + test_json_form_data_with_http_info(param, param2, opts) + nil + end + + # test json serialization of form data + # @param param [String] field1 + # @param param2 [String] field2 + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def test_json_form_data_with_http_info(param, param2, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.test_json_form_data ...' + end + # verify the required parameter 'param' is set + if @api_client.config.client_side_validation && param.nil? + fail ArgumentError, "Missing the required parameter 'param' when calling FakeApi.test_json_form_data" + end + # verify the required parameter 'param2' is set + if @api_client.config.client_side_validation && param2.nil? + fail ArgumentError, "Missing the required parameter 'param2' when calling FakeApi.test_json_form_data" + end + # resource path + local_var_path = '/fake/jsonFormData' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) + + # form parameters + form_params = opts[:form_params] || {} + form_params['param'] = param + form_params['param2'] = param2 + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#test_json_form_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb new file mode 100644 index 00000000000..9c4a1178e55 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb @@ -0,0 +1,86 @@ +=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.0-SNAPSHOT + +=end + +require 'cgi' + +module Petstore + class FakeClassnameTags123Api + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # To test class name in snake case + # To test class name in snake case + # @param client [Client] client model + # @param [Hash] opts the optional parameters + # @return [Client] + def test_classname(client, opts = {}) + data, _status_code, _headers = test_classname_with_http_info(client, opts) + data + end + + # To test class name in snake case + # To test class name in snake case + # @param client [Client] client model + # @param [Hash] opts the optional parameters + # @return [Array<(Client, Integer, Hash)>] Client data, response status code and response headers + def test_classname_with_http_info(client, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeClassnameTags123Api.test_classname ...' + end + # verify the required parameter 'client' is set + if @api_client.config.client_side_validation && client.nil? + fail ArgumentError, "Missing the required parameter 'client' when calling FakeClassnameTags123Api.test_classname" + end + # resource path + local_var_path = '/fake_classname_test' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(client) + + # return_type + return_type = opts[:return_type] || 'Client' + + # auth_names + auth_names = opts[:auth_names] || ['api_key_query'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeClassnameTags123Api#test_classname\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb new file mode 100644 index 00000000000..f235041dfd7 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb @@ -0,0 +1,597 @@ +=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.0-SNAPSHOT + +=end + +require 'cgi' + +module Petstore + class PetApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Add a new pet to the store + # @param pet [Pet] Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @return [nil] + def add_pet(pet, opts = {}) + add_pet_with_http_info(pet, opts) + nil + end + + # Add a new pet to the store + # @param pet [Pet] Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def add_pet_with_http_info(pet, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PetApi.add_pet ...' + end + # verify the required parameter 'pet' is set + if @api_client.config.client_side_validation && pet.nil? + fail ArgumentError, "Missing the required parameter 'pet' when calling PetApi.add_pet" + end + # resource path + local_var_path = '/pet' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(pet) + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || ['petstore_auth'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PetApi#add_pet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Deletes a pet + # @param pet_id [Integer] Pet id to delete + # @param [Hash] opts the optional parameters + # @option opts [String] :api_key + # @return [nil] + def delete_pet(pet_id, opts = {}) + delete_pet_with_http_info(pet_id, opts) + nil + end + + # Deletes a pet + # @param pet_id [Integer] Pet id to delete + # @param [Hash] opts the optional parameters + # @option opts [String] :api_key + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_pet_with_http_info(pet_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PetApi.delete_pet ...' + end + # verify the required parameter 'pet_id' is set + if @api_client.config.client_side_validation && pet_id.nil? + fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.delete_pet" + end + # resource path + local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + header_params[:'api_key'] = opts[:'api_key'] if !opts[:'api_key'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || ['petstore_auth'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PetApi#delete_pet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Finds Pets by status + # Multiple status values can be provided with comma separated strings + # @param status [Array] Status values that need to be considered for filter + # @param [Hash] opts the optional parameters + # @return [Array] + def find_pets_by_status(status, opts = {}) + data, _status_code, _headers = find_pets_by_status_with_http_info(status, opts) + data + end + + # Finds Pets by status + # Multiple status values can be provided with comma separated strings + # @param status [Array] Status values that need to be considered for filter + # @param [Hash] opts the optional parameters + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers + def find_pets_by_status_with_http_info(status, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PetApi.find_pets_by_status ...' + end + # verify the required parameter 'status' is set + if @api_client.config.client_side_validation && status.nil? + fail ArgumentError, "Missing the required parameter 'status' when calling PetApi.find_pets_by_status" + end + # resource path + local_var_path = '/pet/findByStatus' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'status'] = @api_client.build_collection_param(status, :csv) + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Array' + + # auth_names + auth_names = opts[:auth_names] || ['petstore_auth'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PetApi#find_pets_by_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Finds Pets by tags + # Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + # @param tags [Array] Tags to filter by + # @param [Hash] opts the optional parameters + # @return [Array] + def find_pets_by_tags(tags, opts = {}) + data, _status_code, _headers = find_pets_by_tags_with_http_info(tags, opts) + data + end + + # Finds Pets by tags + # Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + # @param tags [Array] Tags to filter by + # @param [Hash] opts the optional parameters + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers + def find_pets_by_tags_with_http_info(tags, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PetApi.find_pets_by_tags ...' + end + # verify the required parameter 'tags' is set + if @api_client.config.client_side_validation && tags.nil? + fail ArgumentError, "Missing the required parameter 'tags' when calling PetApi.find_pets_by_tags" + end + # resource path + local_var_path = '/pet/findByTags' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'tags'] = @api_client.build_collection_param(tags, :csv) + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Array' + + # auth_names + auth_names = opts[:auth_names] || ['petstore_auth'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PetApi#find_pets_by_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Find pet by ID + # Returns a single pet + # @param pet_id [Integer] ID of pet to return + # @param [Hash] opts the optional parameters + # @return [Pet] + def get_pet_by_id(pet_id, opts = {}) + data, _status_code, _headers = get_pet_by_id_with_http_info(pet_id, opts) + data + end + + # Find pet by ID + # Returns a single pet + # @param pet_id [Integer] ID of pet to return + # @param [Hash] opts the optional parameters + # @return [Array<(Pet, Integer, Hash)>] Pet data, response status code and response headers + def get_pet_by_id_with_http_info(pet_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PetApi.get_pet_by_id ...' + end + # verify the required parameter 'pet_id' is set + if @api_client.config.client_side_validation && pet_id.nil? + fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.get_pet_by_id" + end + # resource path + local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Pet' + + # auth_names + auth_names = opts[:auth_names] || ['api_key'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PetApi#get_pet_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update an existing pet + # @param pet [Pet] Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @return [nil] + def update_pet(pet, opts = {}) + update_pet_with_http_info(pet, opts) + nil + end + + # Update an existing pet + # @param pet [Pet] Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_pet_with_http_info(pet, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PetApi.update_pet ...' + end + # verify the required parameter 'pet' is set + if @api_client.config.client_side_validation && pet.nil? + fail ArgumentError, "Missing the required parameter 'pet' when calling PetApi.update_pet" + end + # resource path + local_var_path = '/pet' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(pet) + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || ['petstore_auth'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PetApi#update_pet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Updates a pet in the store with form data + # @param pet_id [Integer] ID of pet that needs to be updated + # @param [Hash] opts the optional parameters + # @option opts [String] :name Updated name of the pet + # @option opts [String] :status Updated status of the pet + # @return [nil] + def update_pet_with_form(pet_id, opts = {}) + update_pet_with_form_with_http_info(pet_id, opts) + nil + end + + # Updates a pet in the store with form data + # @param pet_id [Integer] ID of pet that needs to be updated + # @param [Hash] opts the optional parameters + # @option opts [String] :name Updated name of the pet + # @option opts [String] :status Updated status of the pet + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_pet_with_form_with_http_info(pet_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PetApi.update_pet_with_form ...' + end + # verify the required parameter 'pet_id' is set + if @api_client.config.client_side_validation && pet_id.nil? + fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.update_pet_with_form" + end + # resource path + local_var_path = '/pet/{petId}'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) + + # form parameters + form_params = opts[:form_params] || {} + form_params['name'] = opts[:'name'] if !opts[:'name'].nil? + form_params['status'] = opts[:'status'] if !opts[:'status'].nil? + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || ['petstore_auth'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PetApi#update_pet_with_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # uploads an image + # @param pet_id [Integer] ID of pet to update + # @param [Hash] opts the optional parameters + # @option opts [String] :additional_metadata Additional data to pass to server + # @option opts [File] :file file to upload + # @return [ApiResponse] + def upload_file(pet_id, opts = {}) + data, _status_code, _headers = upload_file_with_http_info(pet_id, opts) + data + end + + # uploads an image + # @param pet_id [Integer] ID of pet to update + # @param [Hash] opts the optional parameters + # @option opts [String] :additional_metadata Additional data to pass to server + # @option opts [File] :file file to upload + # @return [Array<(ApiResponse, Integer, Hash)>] ApiResponse data, response status code and response headers + def upload_file_with_http_info(pet_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PetApi.upload_file ...' + end + # verify the required parameter 'pet_id' is set + if @api_client.config.client_side_validation && pet_id.nil? + fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.upload_file" + end + # resource path + local_var_path = '/pet/{petId}/uploadImage'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) + + # form parameters + form_params = opts[:form_params] || {} + form_params['additionalMetadata'] = opts[:'additional_metadata'] if !opts[:'additional_metadata'].nil? + form_params['file'] = opts[:'file'] if !opts[:'file'].nil? + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'ApiResponse' + + # auth_names + auth_names = opts[:auth_names] || ['petstore_auth'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PetApi#upload_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # uploads an image (required) + # @param pet_id [Integer] ID of pet to update + # @param required_file [File] file to upload + # @param [Hash] opts the optional parameters + # @option opts [String] :additional_metadata Additional data to pass to server + # @return [ApiResponse] + def upload_file_with_required_file(pet_id, required_file, opts = {}) + data, _status_code, _headers = upload_file_with_required_file_with_http_info(pet_id, required_file, opts) + data + end + + # uploads an image (required) + # @param pet_id [Integer] ID of pet to update + # @param required_file [File] file to upload + # @param [Hash] opts the optional parameters + # @option opts [String] :additional_metadata Additional data to pass to server + # @return [Array<(ApiResponse, Integer, Hash)>] ApiResponse data, response status code and response headers + def upload_file_with_required_file_with_http_info(pet_id, required_file, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: PetApi.upload_file_with_required_file ...' + end + # verify the required parameter 'pet_id' is set + if @api_client.config.client_side_validation && pet_id.nil? + fail ArgumentError, "Missing the required parameter 'pet_id' when calling PetApi.upload_file_with_required_file" + end + # verify the required parameter 'required_file' is set + if @api_client.config.client_side_validation && required_file.nil? + fail ArgumentError, "Missing the required parameter 'required_file' when calling PetApi.upload_file_with_required_file" + end + # resource path + local_var_path = '/fake/{petId}/uploadImageWithRequiredFile'.sub('{' + 'petId' + '}', CGI.escape(pet_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) + + # form parameters + form_params = opts[:form_params] || {} + form_params['requiredFile'] = required_file + form_params['additionalMetadata'] = opts[:'additional_metadata'] if !opts[:'additional_metadata'].nil? + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'ApiResponse' + + # auth_names + auth_names = opts[:auth_names] || ['petstore_auth'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: PetApi#upload_file_with_required_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb new file mode 100644 index 00000000000..42291902d9a --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb @@ -0,0 +1,270 @@ +=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.0-SNAPSHOT + +=end + +require 'cgi' + +module Petstore + class StoreApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Delete purchase order by ID + # For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + # @param order_id [String] ID of the order that needs to be deleted + # @param [Hash] opts the optional parameters + # @return [nil] + def delete_order(order_id, opts = {}) + delete_order_with_http_info(order_id, opts) + nil + end + + # Delete purchase order by ID + # For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + # @param order_id [String] ID of the order that needs to be deleted + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_order_with_http_info(order_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StoreApi.delete_order ...' + end + # verify the required parameter 'order_id' is set + if @api_client.config.client_side_validation && order_id.nil? + fail ArgumentError, "Missing the required parameter 'order_id' when calling StoreApi.delete_order" + end + # resource path + local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StoreApi#delete_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Returns pet inventories by status + # Returns a map of status codes to quantities + # @param [Hash] opts the optional parameters + # @return [Hash] + def get_inventory(opts = {}) + data, _status_code, _headers = get_inventory_with_http_info(opts) + data + end + + # Returns pet inventories by status + # Returns a map of status codes to quantities + # @param [Hash] opts the optional parameters + # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers + def get_inventory_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StoreApi.get_inventory ...' + end + # resource path + local_var_path = '/store/inventory' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Hash' + + # auth_names + auth_names = opts[:auth_names] || ['api_key'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StoreApi#get_inventory\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Find purchase order by ID + # For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + # @param order_id [Integer] ID of pet that needs to be fetched + # @param [Hash] opts the optional parameters + # @return [Order] + def get_order_by_id(order_id, opts = {}) + data, _status_code, _headers = get_order_by_id_with_http_info(order_id, opts) + data + end + + # Find purchase order by ID + # For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + # @param order_id [Integer] ID of pet that needs to be fetched + # @param [Hash] opts the optional parameters + # @return [Array<(Order, Integer, Hash)>] Order data, response status code and response headers + def get_order_by_id_with_http_info(order_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StoreApi.get_order_by_id ...' + end + # verify the required parameter 'order_id' is set + if @api_client.config.client_side_validation && order_id.nil? + fail ArgumentError, "Missing the required parameter 'order_id' when calling StoreApi.get_order_by_id" + end + if @api_client.config.client_side_validation && order_id > 5 + fail ArgumentError, 'invalid value for "order_id" when calling StoreApi.get_order_by_id, must be smaller than or equal to 5.' + end + + if @api_client.config.client_side_validation && order_id < 1 + fail ArgumentError, 'invalid value for "order_id" when calling StoreApi.get_order_by_id, must be greater than or equal to 1.' + end + + # resource path + local_var_path = '/store/order/{order_id}'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Order' + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StoreApi#get_order_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Place an order for a pet + # @param order [Order] order placed for purchasing the pet + # @param [Hash] opts the optional parameters + # @return [Order] + def place_order(order, opts = {}) + data, _status_code, _headers = place_order_with_http_info(order, opts) + data + end + + # Place an order for a pet + # @param order [Order] order placed for purchasing the pet + # @param [Hash] opts the optional parameters + # @return [Array<(Order, Integer, Hash)>] Order data, response status code and response headers + def place_order_with_http_info(order, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StoreApi.place_order ...' + end + # verify the required parameter 'order' is set + if @api_client.config.client_side_validation && order.nil? + fail ArgumentError, "Missing the required parameter 'order' when calling StoreApi.place_order" + end + # resource path + local_var_path = '/store/order' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(order) + + # return_type + return_type = opts[:return_type] || 'Order' + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StoreApi#place_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb new file mode 100644 index 00000000000..265a387653a --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb @@ -0,0 +1,512 @@ +=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.0-SNAPSHOT + +=end + +require 'cgi' + +module Petstore + class UserApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Create user + # This can only be done by the logged in user. + # @param user [User] Created user object + # @param [Hash] opts the optional parameters + # @return [nil] + def create_user(user, opts = {}) + create_user_with_http_info(user, opts) + nil + end + + # Create user + # This can only be done by the logged in user. + # @param user [User] Created user object + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def create_user_with_http_info(user, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserApi.create_user ...' + end + # verify the required parameter 'user' is set + if @api_client.config.client_side_validation && user.nil? + fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_user" + end + # resource path + local_var_path = '/user' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(user) + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UserApi#create_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Creates list of users with given input array + # @param user [Array] List of user object + # @param [Hash] opts the optional parameters + # @return [nil] + def create_users_with_array_input(user, opts = {}) + create_users_with_array_input_with_http_info(user, opts) + nil + end + + # Creates list of users with given input array + # @param user [Array] List of user object + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def create_users_with_array_input_with_http_info(user, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserApi.create_users_with_array_input ...' + end + # verify the required parameter 'user' is set + if @api_client.config.client_side_validation && user.nil? + fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_users_with_array_input" + end + # resource path + local_var_path = '/user/createWithArray' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(user) + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UserApi#create_users_with_array_input\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Creates list of users with given input array + # @param user [Array] List of user object + # @param [Hash] opts the optional parameters + # @return [nil] + def create_users_with_list_input(user, opts = {}) + create_users_with_list_input_with_http_info(user, opts) + nil + end + + # Creates list of users with given input array + # @param user [Array] List of user object + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def create_users_with_list_input_with_http_info(user, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserApi.create_users_with_list_input ...' + end + # verify the required parameter 'user' is set + if @api_client.config.client_side_validation && user.nil? + fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_users_with_list_input" + end + # resource path + local_var_path = '/user/createWithList' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(user) + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UserApi#create_users_with_list_input\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete user + # This can only be done by the logged in user. + # @param username [String] The name that needs to be deleted + # @param [Hash] opts the optional parameters + # @return [nil] + def delete_user(username, opts = {}) + delete_user_with_http_info(username, opts) + nil + end + + # Delete user + # This can only be done by the logged in user. + # @param username [String] The name that needs to be deleted + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_user_with_http_info(username, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserApi.delete_user ...' + end + # verify the required parameter 'username' is set + if @api_client.config.client_side_validation && username.nil? + fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.delete_user" + end + # resource path + local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UserApi#delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get user by user name + # @param username [String] The name that needs to be fetched. Use user1 for testing. + # @param [Hash] opts the optional parameters + # @return [User] + def get_user_by_name(username, opts = {}) + data, _status_code, _headers = get_user_by_name_with_http_info(username, opts) + data + end + + # Get user by user name + # @param username [String] The name that needs to be fetched. Use user1 for testing. + # @param [Hash] opts the optional parameters + # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers + def get_user_by_name_with_http_info(username, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserApi.get_user_by_name ...' + end + # verify the required parameter 'username' is set + if @api_client.config.client_side_validation && username.nil? + fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.get_user_by_name" + end + # resource path + local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'User' + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UserApi#get_user_by_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Logs user into the system + # @param username [String] The user name for login + # @param password [String] The password for login in clear text + # @param [Hash] opts the optional parameters + # @return [String] + def login_user(username, password, opts = {}) + data, _status_code, _headers = login_user_with_http_info(username, password, opts) + data + end + + # Logs user into the system + # @param username [String] The user name for login + # @param password [String] The password for login in clear text + # @param [Hash] opts the optional parameters + # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers + def login_user_with_http_info(username, password, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserApi.login_user ...' + end + # verify the required parameter 'username' is set + if @api_client.config.client_side_validation && username.nil? + fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.login_user" + end + # verify the required parameter 'password' is set + if @api_client.config.client_side_validation && password.nil? + fail ArgumentError, "Missing the required parameter 'password' when calling UserApi.login_user" + end + # resource path + local_var_path = '/user/login' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'username'] = username + query_params[:'password'] = password + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/xml', 'application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'String' + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UserApi#login_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Logs out current logged in user session + # @param [Hash] opts the optional parameters + # @return [nil] + def logout_user(opts = {}) + logout_user_with_http_info(opts) + nil + end + + # Logs out current logged in user session + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def logout_user_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserApi.logout_user ...' + end + # resource path + local_var_path = '/user/logout' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UserApi#logout_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Updated user + # This can only be done by the logged in user. + # @param username [String] name that need to be deleted + # @param user [User] Updated user object + # @param [Hash] opts the optional parameters + # @return [nil] + def update_user(username, user, opts = {}) + update_user_with_http_info(username, user, opts) + nil + end + + # Updated user + # This can only be done by the logged in user. + # @param username [String] name that need to be deleted + # @param user [User] Updated user object + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_user_with_http_info(username, user, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UserApi.update_user ...' + end + # verify the required parameter 'username' is set + if @api_client.config.client_side_validation && username.nil? + fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.update_user" + end + # verify the required parameter 'user' is set + if @api_client.config.client_side_validation && user.nil? + fail ArgumentError, "Missing the required parameter 'user' when calling UserApi.update_user" + end + # resource path + local_var_path = '/user/{username}'.sub('{' + 'username' + '}', CGI.escape(username.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(user) + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: UserApi#update_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_client.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_client.rb new file mode 100644 index 00000000000..f5167c18671 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_client.rb @@ -0,0 +1,403 @@ +=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.0-SNAPSHOT + +=end + +require 'date' +require 'faraday' +require 'json' +require 'logger' +require 'tempfile' + +module Petstore + class ApiClient + # The Configuration object holding settings to be used in the API client. + attr_accessor :config + + # Defines the headers to be used in HTTP requests of all API calls by default. + # + # @return [Hash] + attr_accessor :default_headers + + # Initializes the ApiClient + # @option config [Configuration] Configuration for initializing the object, default to Configuration.default + def initialize(config = Configuration.default) + @config = config + @user_agent = "OpenAPI-Generator/#{VERSION}/ruby" + @default_headers = { + 'Content-Type' => 'application/json', + 'User-Agent' => @user_agent + } + end + + def self.default + @@default ||= ApiClient.new + end + + # Call an API with given options. + # + # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: + # the data deserialized from response body (could be nil), response status code and response headers. + def call_api(http_method, path, opts = {}) + connection = Faraday.new(:url => config.base_url) do |conn| + conn.basic_auth(config.username, config.password) + if opts[:header_params]["Content-Type"] == "multipart/form-data" + conn.request :multipart + conn.request :url_encoded + end + conn.adapter(Faraday.default_adapter) + end + begin + response = connection.public_send(http_method.to_sym.downcase) do |req| + build_request(http_method, path, req, opts) + end + + if @config.debugging + @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" + end + + unless response.success? + if response.status == 0 + # Errors from libcurl will be made visible here + fail ApiError.new(:code => 0, + :message => response.return_message) + else + fail ApiError.new(:code => response.status, + :response_headers => response.headers, + :response_body => response.body), + response.reason_phrase + end + end + rescue Faraday::TimeoutError + fail ApiError.new('Connection timed out') + end + + if opts[:return_type] + data = deserialize(response, opts[:return_type]) + else + data = nil + end + return data, response.status, response.headers + end + + # Builds the HTTP request + # + # @param [String] http_method HTTP method/verb (e.g. POST) + # @param [String] path URL path (e.g. /account/new) + # @option opts [Hash] :header_params Header parameters + # @option opts [Hash] :query_params Query parameters + # @option opts [Hash] :form_params Query parameters + # @option opts [Object] :body HTTP body (JSON/XML) + # @return [Typhoeus::Request] A Typhoeus Request + def build_request(http_method, path, request, opts = {}) + url = build_request_url(path) + http_method = http_method.to_sym.downcase + + header_params = @default_headers.merge(opts[:header_params] || {}) + query_params = opts[:query_params] || {} + form_params = opts[:form_params] || {} + + update_params_for_auth! header_params, query_params, opts[:auth_names] + + # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) + _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 + + req_opts = { + :method => http_method, + :headers => header_params, + :params => query_params, + :params_encoding => @config.params_encoding, + :timeout => @config.timeout, + :ssl_verifypeer => @config.verify_ssl, + :ssl_verifyhost => _verify_ssl_host, + :sslcert => @config.cert_file, + :sslkey => @config.key_file, + :verbose => @config.debugging + } + + # set custom cert, if provided + req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert + + if [:post, :patch, :put, :delete].include?(http_method) + req_body = build_request_body(header_params, form_params, opts[:body]) + req_opts.update :body => req_body + if @config.debugging + @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" + end + end + request.headers = header_params + request.body = req_body + request.url url + request.params = query_params + download_file(request) if opts[:return_type] == 'File' + request + end + + # Check if the given MIME is a JSON MIME. + # JSON MIME examples: + # application/json + # application/json; charset=UTF8 + # APPLICATION/JSON + # */* + # @param [String] mime MIME + # @return [Boolean] True if the MIME is application/json + def json_mime?(mime) + (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? + end + + # Deserialize the response to the given return type. + # + # @param [Response] response HTTP response + # @param [String] return_type some examples: "User", "Array", "Hash" + def deserialize(response, return_type) + body = response.body + + # handle file downloading - return the File instance processed in request callbacks + # note that response body is empty when the file is written in chunks in request on_body callback + return @tempfile if return_type == 'File' + + return nil if body.nil? || body.empty? + + # return response body directly for String return type + return body if return_type == 'String' + + # ensuring a default content type + content_type = response.headers['Content-Type'] || 'application/json' + + fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) + + begin + data = JSON.parse("[#{body}]", :symbolize_names => true)[0] + rescue JSON::ParserError => e + if %w(String Date DateTime).include?(return_type) + data = body + else + raise e + end + end + + convert_to_type data, return_type + end + + # Convert data to the given return type. + # @param [Object] data Data to be converted + # @param [String] return_type Return type + # @return [Mixed] Data in a particular type + def convert_to_type(data, return_type) + return nil if data.nil? + case return_type + when 'String' + data.to_s + when 'Integer' + data.to_i + when 'Float' + data.to_f + when 'Boolean' + data == true + when 'DateTime' + # parse date time (expecting ISO 8601 format) + DateTime.parse data + when 'Date' + # parse date time (expecting ISO 8601 format) + Date.parse data + when 'Object' + # generic object (usually a Hash), return directly + data + when /\AArray<(.+)>\z/ + # e.g. Array + sub_type = $1 + data.map { |item| convert_to_type(item, sub_type) } + when /\AHash\\z/ + # e.g. Hash + sub_type = $1 + {}.tap do |hash| + data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } + end + else + # models, e.g. Pet + Petstore.const_get(return_type).build_from_hash(data) + end + end + + # Save response body into a file in (the defined) temporary folder, using the filename + # from the "Content-Disposition" header if provided, otherwise a random filename. + # The response body is written to the file in chunks in order to handle files which + # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby + # process can use. + # + # @see Configuration#temp_folder_path + def download_file(request) + tempfile = nil + encoding = nil + request.on_headers do |response| + content_disposition = response.headers['Content-Disposition'] + if content_disposition && content_disposition =~ /filename=/i + filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] + prefix = sanitize_filename(filename) + else + prefix = 'download-' + end + prefix = prefix + '-' unless prefix.end_with?('-') + encoding = response.body.encoding + tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) + @tempfile = tempfile + end + request.on_body do |chunk| + chunk.force_encoding(encoding) + tempfile.write(chunk) + end + request.on_complete do |response| + tempfile.close if tempfile + @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ + "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ + "will be deleted automatically with GC. It's also recommended to delete the temp file "\ + "explicitly with `tempfile.delete`" + end + end + + # Sanitize filename by removing path. + # e.g. ../../sun.gif becomes sun.gif + # + # @param [String] filename the filename to be sanitized + # @return [String] the sanitized filename + def sanitize_filename(filename) + filename.gsub(/.*[\/\\]/, '') + end + + def build_request_url(path) + # Add leading and trailing slashes to path + path = "/#{path}".gsub(/\/+/, '/') + @config.base_url + path + end + + # Builds the HTTP request body + # + # @param [Hash] header_params Header parameters + # @param [Hash] form_params Query parameters + # @param [Object] body HTTP body (JSON/XML) + # @return [String] HTTP body data in the form of string + def build_request_body(header_params, form_params, body) + # http form + if header_params['Content-Type'] == 'application/x-www-form-urlencoded' + data = URI.encode_www_form(form_params) + elsif header_params['Content-Type'] == 'multipart/form-data' + data = {} + form_params.each do |key, value| + case value + when ::File, ::Tempfile + # TODO hardcode to application/octet-stream, need better way to detect content type + data[key] = Faraday::UploadIO.new(value.path, 'application/octet-stream', value.path) + when ::Array, nil + # let Faraday handle Array and nil parameters + data[key] = value + else + data[key] = value.to_s + end + end + elsif body + data = body.is_a?(String) ? body : body.to_json + else + data = nil + end + data + end + + # Update hearder and query params based on authentication settings. + # + # @param [Hash] header_params Header parameters + # @param [Hash] query_params Query parameters + # @param [String] auth_names Authentication scheme name + def update_params_for_auth!(header_params, query_params, auth_names) + Array(auth_names).each do |auth_name| + auth_setting = @config.auth_settings[auth_name] + next unless auth_setting + case auth_setting[:in] + when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] + when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] + else fail ArgumentError, 'Authentication token must be in `query` of `header`' + end + end + end + + # Sets user agent in HTTP header + # + # @param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.0) + def user_agent=(user_agent) + @user_agent = user_agent + @default_headers['User-Agent'] = @user_agent + end + + # Return Accept header based on an array of accepts provided. + # @param [Array] accepts array for Accept + # @return [String] the Accept header (e.g. application/json) + def select_header_accept(accepts) + return nil if accepts.nil? || accepts.empty? + # use JSON when present, otherwise use all of the provided + json_accept = accepts.find { |s| json_mime?(s) } + json_accept || accepts.join(',') + end + + # Return Content-Type header based on an array of content types provided. + # @param [Array] content_types array for Content-Type + # @return [String] the Content-Type header (e.g. application/json) + def select_header_content_type(content_types) + # use application/json by default + return 'application/json' if content_types.nil? || content_types.empty? + # use JSON when present, otherwise use the first one + json_content_type = content_types.find { |s| json_mime?(s) } + json_content_type || content_types.first + end + + # Convert object (array, hash, object, etc) to JSON string. + # @param [Object] model object to be converted into JSON string + # @return [String] JSON string representation of the object + def object_to_http_body(model) + return model if model.nil? || model.is_a?(String) + local_body = nil + if model.is_a?(Array) + local_body = model.map { |m| object_to_hash(m) } + else + local_body = object_to_hash(model) + end + local_body.to_json + end + + # Convert object(non-array) to hash. + # @param [Object] obj object to be converted into JSON string + # @return [String] JSON string representation of the object + def object_to_hash(obj) + if obj.respond_to?(:to_hash) + obj.to_hash + else + obj + end + end + + # Build parameter value according to the given collection format. + # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi + def build_collection_param(param, collection_format) + case collection_format + when :csv + param.join(',') + when :ssv + param.join(' ') + when :tsv + param.join("\t") + when :pipes + param.join('|') + when :multi + # return the array directly as typhoeus will handle it as expected + param + else + fail "unknown collection format: #{collection_format.inspect}" + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_error.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_error.rb new file mode 100644 index 00000000000..9eab46a89b7 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_error.rb @@ -0,0 +1,57 @@ +=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.0-SNAPSHOT + +=end + +module Petstore + class ApiError < StandardError + attr_reader :code, :response_headers, :response_body + + # Usage examples: + # ApiError.new + # ApiError.new("message") + # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") + # ApiError.new(:code => 404, :message => "Not Found") + def initialize(arg = nil) + if arg.is_a? Hash + if arg.key?(:message) || arg.key?('message') + super(arg[:message] || arg['message']) + else + super arg + end + + arg.each do |k, v| + instance_variable_set "@#{k}", v + end + else + super arg + end + end + + # Override to_s to display a friendly error message + def to_s + message + end + + def message + if @message.nil? + msg = "Error message: the server returns an error" + else + msg = @message + end + + msg += "\nHTTP status code: #{code}" if code + msg += "\nResponse headers: #{response_headers}" if response_headers + msg += "\nResponse body: #{response_body}" if response_body + + msg + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/configuration.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/configuration.rb new file mode 100644 index 00000000000..73a5712c90d --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/configuration.rb @@ -0,0 +1,310 @@ +=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.0-SNAPSHOT + +=end + +module Petstore + class Configuration + # Defines url scheme + attr_accessor :scheme + + # Defines url host + attr_accessor :host + + # Defines url base path + attr_accessor :base_path + + # Defines API keys used with API Key authentications. + # + # @return [Hash] key: parameter name, value: parameter value (API key) + # + # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) + # config.api_key['api_key'] = 'xxx' + attr_accessor :api_key + + # Defines API key prefixes used with API Key authentications. + # + # @return [Hash] key: parameter name, value: API key prefix + # + # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) + # config.api_key_prefix['api_key'] = 'Token' + attr_accessor :api_key_prefix + + # Defines the username used with HTTP basic authentication. + # + # @return [String] + attr_accessor :username + + # Defines the password used with HTTP basic authentication. + # + # @return [String] + attr_accessor :password + + # Defines the access token (Bearer) used with OAuth2. + attr_accessor :access_token + + # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response + # details will be logged with `logger.debug` (see the `logger` attribute). + # Default to false. + # + # @return [true, false] + attr_accessor :debugging + + # Defines the logger used for debugging. + # Default to `Rails.logger` (when in Rails) or logging to STDOUT. + # + # @return [#debug] + attr_accessor :logger + + # Defines the temporary folder to store downloaded files + # (for API endpoints that have file response). + # Default to use `Tempfile`. + # + # @return [String] + attr_accessor :temp_folder_path + + # The time limit for HTTP request in seconds. + # Default to 0 (never times out). + attr_accessor :timeout + + # Set this to false to skip client side validation in the operation. + # Default to true. + # @return [true, false] + attr_accessor :client_side_validation + + ### TLS/SSL setting + # Set this to false to skip verifying SSL certificate when calling API from https server. + # Default to true. + # + # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. + # + # @return [true, false] + attr_accessor :verify_ssl + + ### TLS/SSL setting + # Set this to false to skip verifying SSL host name + # Default to true. + # + # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. + # + # @return [true, false] + attr_accessor :verify_ssl_host + + ### TLS/SSL setting + # Set this to customize the certificate file to verify the peer. + # + # @return [String] the path to the certificate file + # + # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: + # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 + attr_accessor :ssl_ca_cert + + ### TLS/SSL setting + # Client certificate file (for client certificate) + attr_accessor :cert_file + + ### TLS/SSL setting + # Client private key file (for client certificate) + attr_accessor :key_file + + # Set this to customize parameters encoding of array parameter with multi collectionFormat. + # Default to nil. + # + # @see The params_encoding option of Ethon. Related source code: + # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 + attr_accessor :params_encoding + + attr_accessor :inject_format + + attr_accessor :force_ending_format + + def initialize + @scheme = 'http' + @host = 'petstore.swagger.io' + @base_path = '/v2' + @api_key = {} + @api_key_prefix = {} + @timeout = 0 + @client_side_validation = true + @verify_ssl = true + @verify_ssl_host = true + @params_encoding = nil + @cert_file = nil + @key_file = nil + @debugging = false + @inject_format = false + @force_ending_format = false + @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) + + yield(self) if block_given? + end + + # The default Configuration object. + def self.default + @@default ||= Configuration.new + end + + def configure + yield(self) if block_given? + end + + def scheme=(scheme) + # remove :// from scheme + @scheme = scheme.sub(/:\/\//, '') + end + + def host=(host) + # remove http(s):// and anything after a slash + @host = host.sub(/https?:\/\//, '').split('/').first + end + + def base_path=(base_path) + # Add leading and trailing slashes to base_path + @base_path = "/#{base_path}".gsub(/\/+/, '/') + @base_path = '' if @base_path == '/' + end + + def base_url + "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') + end + + # Gets API key (with prefix if set). + # @param [String] param_name the parameter name of API key auth + def api_key_with_prefix(param_name) + if @api_key_prefix[param_name] + "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" + else + @api_key[param_name] + end + end + + # Gets Basic Auth token string + def basic_auth_token + 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") + end + + # Returns Auth Settings hash for api client. + def auth_settings + { + 'api_key' => + { + type: 'api_key', + in: 'header', + key: 'api_key', + value: api_key_with_prefix('api_key') + }, + 'api_key_query' => + { + type: 'api_key', + in: 'query', + key: 'api_key_query', + value: api_key_with_prefix('api_key_query') + }, + 'bearer_test' => + { + type: 'bearer', + in: 'header', + format: 'JWT', + key: 'Authorization', + value: "Bearer #{access_token}" + }, + 'http_basic_test' => + { + type: 'basic', + in: 'header', + key: 'Authorization', + value: basic_auth_token + }, + 'petstore_auth' => + { + type: 'oauth2', + in: 'header', + key: 'Authorization', + value: "Bearer #{access_token}" + }, + } + end + + # Returns an array of Server setting + def server_settings + [ + { + url: "http://{server}.swagger.io:{port}/v2", + description: "petstore server", + variables: { + server: { + description: "No descriptoin provided", + default_value: "petstore", + enum_values: [ + "petstore", + "qa-petstore", + "dev-petstore" + ] + }, + port: { + description: "No descriptoin provided", + default_value: "80", + enum_values: [ + "80", + "8080" + ] + } + } + }, + { + url: "https://localhost:8080/{version}", + description: "The local server", + variables: { + version: { + description: "No descriptoin provided", + default_value: "v2", + enum_values: [ + "v1", + "v2" + ] + } + } + } + ] + end + + # Returns URL based on server settings + # + # @param index array index of the server settings + # @param variables hash of variable and the corresponding value + def server_url(index, variables = {}) + servers = server_settings + + # check array index out of bound + if (index < 0 || index >= servers.size) + fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}" + end + + server = servers[index] + url = server[:url] + + # go through variable and assign a value + server[:variables].each do |name, variable| + if variables.key?(name) + if (server[:variables][name][:enum_values].include? variables[name]) + url.gsub! "{" + name.to_s + "}", variables[name] + else + fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}." + end + else + # use default value + url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value] + end + end + + url + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb new file mode 100644 index 00000000000..a4b791a17f7 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb @@ -0,0 +1,209 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class AdditionalPropertiesClass + attr_accessor :map_property + + attr_accessor :map_of_map_property + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'map_property' => :'map_property', + :'map_of_map_property' => :'map_of_map_property' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'map_property' => :'Hash', + :'map_of_map_property' => :'Hash>' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::AdditionalPropertiesClass` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesClass`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'map_property') + if (value = attributes[:'map_property']).is_a?(Hash) + self.map_property = value + end + end + + if attributes.key?(:'map_of_map_property') + if (value = attributes[:'map_of_map_property']).is_a?(Hash) + self.map_of_map_property = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + map_property == o.map_property && + map_of_map_property == o.map_of_map_property + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [map_property, map_of_map_property].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/animal.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/animal.rb new file mode 100644 index 00000000000..396199ca411 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/animal.rb @@ -0,0 +1,217 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class Animal + attr_accessor :class_name + + attr_accessor :color + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'class_name' => :'className', + :'color' => :'color' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'class_name' => :'String', + :'color' => :'String' + } + end + + # discriminator's property name in OpenAPI v3 + def self.openapi_discriminator_name + :'class_name' + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Animal` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Animal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'class_name') + self.class_name = attributes[:'class_name'] + end + + if attributes.key?(:'color') + self.color = attributes[:'color'] + else + self.color = 'red' + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @class_name.nil? + invalid_properties.push('invalid value for "class_name", class_name cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @class_name.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + class_name == o.class_name && + color == o.color + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [class_name, color].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb new file mode 100644 index 00000000000..998250d20ae --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb @@ -0,0 +1,214 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class ApiResponse + attr_accessor :code + + attr_accessor :type + + attr_accessor :message + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'code' => :'code', + :'type' => :'type', + :'message' => :'message' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'code' => :'Integer', + :'type' => :'String', + :'message' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ApiResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ApiResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + type == o.type && + message == o.message + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [code, type, message].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb new file mode 100644 index 00000000000..99aa9482fa3 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb @@ -0,0 +1,198 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class ArrayOfArrayOfNumberOnly + attr_accessor :array_array_number + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'array_array_number' => :'ArrayArrayNumber' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'array_array_number' => :'Array>' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ArrayOfArrayOfNumberOnly` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ArrayOfArrayOfNumberOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'array_array_number') + if (value = attributes[:'array_array_number']).is_a?(Array) + self.array_array_number = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + array_array_number == o.array_array_number + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [array_array_number].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb new file mode 100644 index 00000000000..e7da1699d45 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb @@ -0,0 +1,198 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class ArrayOfNumberOnly + attr_accessor :array_number + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'array_number' => :'ArrayNumber' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'array_number' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ArrayOfNumberOnly` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ArrayOfNumberOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'array_number') + if (value = attributes[:'array_number']).is_a?(Array) + self.array_number = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + array_number == o.array_number + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [array_number].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb new file mode 100644 index 00000000000..121bff2f022 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb @@ -0,0 +1,220 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class ArrayTest + attr_accessor :array_of_string + + attr_accessor :array_array_of_integer + + attr_accessor :array_array_of_model + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'array_of_string' => :'array_of_string', + :'array_array_of_integer' => :'array_array_of_integer', + :'array_array_of_model' => :'array_array_of_model' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'array_of_string' => :'Array', + :'array_array_of_integer' => :'Array>', + :'array_array_of_model' => :'Array>' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ArrayTest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ArrayTest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'array_of_string') + if (value = attributes[:'array_of_string']).is_a?(Array) + self.array_of_string = value + end + end + + if attributes.key?(:'array_array_of_integer') + if (value = attributes[:'array_array_of_integer']).is_a?(Array) + self.array_array_of_integer = value + end + end + + if attributes.key?(:'array_array_of_model') + if (value = attributes[:'array_array_of_model']).is_a?(Array) + self.array_array_of_model = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + array_of_string == o.array_of_string && + array_array_of_integer == o.array_array_of_integer && + array_array_of_model == o.array_array_of_model + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [array_of_string, array_array_of_integer, array_array_of_model].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb new file mode 100644 index 00000000000..02567bdfd45 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb @@ -0,0 +1,242 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class Capitalization + attr_accessor :small_camel + + attr_accessor :capital_camel + + attr_accessor :small_snake + + attr_accessor :capital_snake + + attr_accessor :sca_eth_flow_points + + # Name of the pet + attr_accessor :att_name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'small_camel' => :'smallCamel', + :'capital_camel' => :'CapitalCamel', + :'small_snake' => :'small_Snake', + :'capital_snake' => :'Capital_Snake', + :'sca_eth_flow_points' => :'SCA_ETH_Flow_Points', + :'att_name' => :'ATT_NAME' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'small_camel' => :'String', + :'capital_camel' => :'String', + :'small_snake' => :'String', + :'capital_snake' => :'String', + :'sca_eth_flow_points' => :'String', + :'att_name' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Capitalization` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Capitalization`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'small_camel') + self.small_camel = attributes[:'small_camel'] + end + + if attributes.key?(:'capital_camel') + self.capital_camel = attributes[:'capital_camel'] + end + + if attributes.key?(:'small_snake') + self.small_snake = attributes[:'small_snake'] + end + + if attributes.key?(:'capital_snake') + self.capital_snake = attributes[:'capital_snake'] + end + + if attributes.key?(:'sca_eth_flow_points') + self.sca_eth_flow_points = attributes[:'sca_eth_flow_points'] + end + + if attributes.key?(:'att_name') + self.att_name = attributes[:'att_name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + small_camel == o.small_camel && + capital_camel == o.capital_camel && + small_snake == o.small_snake && + capital_snake == o.capital_snake && + sca_eth_flow_points == o.sca_eth_flow_points && + att_name == o.att_name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [small_camel, capital_camel, small_snake, capital_snake, sca_eth_flow_points, att_name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat.rb new file mode 100644 index 00000000000..51ab33355e3 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat.rb @@ -0,0 +1,208 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class Cat < Animal + attr_accessor :declawed + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'declawed' => :'declawed' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'declawed' => :'Boolean' + } + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Animal', + :'CatAllOf' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Cat` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Cat`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + # call parent's initialize + super(attributes) + + if attributes.key?(:'declawed') + self.declawed = attributes[:'declawed'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = super + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true && super + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + declawed == o.declawed && super(o) + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [declawed].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + super(attributes) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = super + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb new file mode 100644 index 00000000000..a971e6f5566 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb @@ -0,0 +1,196 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class CatAllOf + attr_accessor :declawed + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'declawed' => :'declawed' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'declawed' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::CatAllOf` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::CatAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'declawed') + self.declawed = attributes[:'declawed'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + declawed == o.declawed + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [declawed].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/category.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/category.rb new file mode 100644 index 00000000000..344ca690654 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/category.rb @@ -0,0 +1,212 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class Category + attr_accessor :id + + attr_accessor :name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'Integer', + :'name' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Category` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Category`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + else + self.name = 'default-name' + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @name.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb new file mode 100644 index 00000000000..01b2b965d60 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb @@ -0,0 +1,197 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + # Model for testing model with \"_class\" property + class ClassModel + attr_accessor :_class + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'_class' => :'_class' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'_class' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ClassModel` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ClassModel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'_class') + self._class = attributes[:'_class'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _class == o._class + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [_class].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/client.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/client.rb new file mode 100644 index 00000000000..830ab1d0f00 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/client.rb @@ -0,0 +1,196 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class Client + attr_accessor :client + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'client' => :'client' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'client' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Client` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Client`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'client') + self.client = attributes[:'client'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + client == o.client + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [client].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog.rb new file mode 100644 index 00000000000..07c31216bc3 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog.rb @@ -0,0 +1,208 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class Dog < Animal + attr_accessor :breed + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'breed' => :'breed' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'breed' => :'String' + } + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Animal', + :'DogAllOf' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Dog` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Dog`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + # call parent's initialize + super(attributes) + + if attributes.key?(:'breed') + self.breed = attributes[:'breed'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = super + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true && super + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + breed == o.breed && super(o) + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [breed].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + super(attributes) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = super + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb new file mode 100644 index 00000000000..18cf6197720 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb @@ -0,0 +1,196 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class DogAllOf + attr_accessor :breed + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'breed' => :'breed' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'breed' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::DogAllOf` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::DogAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'breed') + self.breed = attributes[:'breed'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + breed == o.breed + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [breed].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb new file mode 100644 index 00000000000..1f12cb43b9c --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb @@ -0,0 +1,241 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class EnumArrays + attr_accessor :just_symbol + + attr_accessor :array_enum + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'just_symbol' => :'just_symbol', + :'array_enum' => :'array_enum' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'just_symbol' => :'String', + :'array_enum' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::EnumArrays` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::EnumArrays`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'just_symbol') + self.just_symbol = attributes[:'just_symbol'] + end + + if attributes.key?(:'array_enum') + if (value = attributes[:'array_enum']).is_a?(Array) + self.array_enum = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + just_symbol_validator = EnumAttributeValidator.new('String', [">=", "$"]) + return false unless just_symbol_validator.valid?(@just_symbol) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] just_symbol Object to be assigned + def just_symbol=(just_symbol) + validator = EnumAttributeValidator.new('String', [">=", "$"]) + unless validator.valid?(just_symbol) + fail ArgumentError, "invalid value for \"just_symbol\", must be one of #{validator.allowable_values}." + end + @just_symbol = just_symbol + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + just_symbol == o.just_symbol && + array_enum == o.array_enum + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [just_symbol, array_enum].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb new file mode 100644 index 00000000000..406b0dccc95 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb @@ -0,0 +1,37 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class EnumClass + ABC = "_abc".freeze + EFG = "-efg".freeze + XYZ = "(xyz)".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = EnumClass.constants.select { |c| EnumClass::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #EnumClass" if constantValues.empty? + value + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb new file mode 100644 index 00000000000..6db05c48aaa --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb @@ -0,0 +1,334 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class EnumTest + attr_accessor :enum_string + + attr_accessor :enum_string_required + + attr_accessor :enum_integer + + attr_accessor :enum_number + + attr_accessor :outer_enum + + attr_accessor :outer_enum_integer + + attr_accessor :outer_enum_default_value + + attr_accessor :outer_enum_integer_default_value + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'enum_string' => :'enum_string', + :'enum_string_required' => :'enum_string_required', + :'enum_integer' => :'enum_integer', + :'enum_number' => :'enum_number', + :'outer_enum' => :'outerEnum', + :'outer_enum_integer' => :'outerEnumInteger', + :'outer_enum_default_value' => :'outerEnumDefaultValue', + :'outer_enum_integer_default_value' => :'outerEnumIntegerDefaultValue' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'enum_string' => :'String', + :'enum_string_required' => :'String', + :'enum_integer' => :'Integer', + :'enum_number' => :'Float', + :'outer_enum' => :'OuterEnum', + :'outer_enum_integer' => :'OuterEnumInteger', + :'outer_enum_default_value' => :'OuterEnumDefaultValue', + :'outer_enum_integer_default_value' => :'OuterEnumIntegerDefaultValue' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::EnumTest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::EnumTest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'enum_string') + self.enum_string = attributes[:'enum_string'] + end + + if attributes.key?(:'enum_string_required') + self.enum_string_required = attributes[:'enum_string_required'] + end + + if attributes.key?(:'enum_integer') + self.enum_integer = attributes[:'enum_integer'] + end + + if attributes.key?(:'enum_number') + self.enum_number = attributes[:'enum_number'] + end + + if attributes.key?(:'outer_enum') + self.outer_enum = attributes[:'outer_enum'] + end + + if attributes.key?(:'outer_enum_integer') + self.outer_enum_integer = attributes[:'outer_enum_integer'] + end + + if attributes.key?(:'outer_enum_default_value') + self.outer_enum_default_value = attributes[:'outer_enum_default_value'] + end + + if attributes.key?(:'outer_enum_integer_default_value') + self.outer_enum_integer_default_value = attributes[:'outer_enum_integer_default_value'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @enum_string_required.nil? + invalid_properties.push('invalid value for "enum_string_required", enum_string_required cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + enum_string_validator = EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) + return false unless enum_string_validator.valid?(@enum_string) + return false if @enum_string_required.nil? + enum_string_required_validator = EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) + return false unless enum_string_required_validator.valid?(@enum_string_required) + enum_integer_validator = EnumAttributeValidator.new('Integer', [1, -1]) + return false unless enum_integer_validator.valid?(@enum_integer) + enum_number_validator = EnumAttributeValidator.new('Float', [1.1, -1.2]) + return false unless enum_number_validator.valid?(@enum_number) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] enum_string Object to be assigned + def enum_string=(enum_string) + validator = EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) + unless validator.valid?(enum_string) + fail ArgumentError, "invalid value for \"enum_string\", must be one of #{validator.allowable_values}." + end + @enum_string = enum_string + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] enum_string_required Object to be assigned + def enum_string_required=(enum_string_required) + validator = EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) + unless validator.valid?(enum_string_required) + fail ArgumentError, "invalid value for \"enum_string_required\", must be one of #{validator.allowable_values}." + end + @enum_string_required = enum_string_required + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] enum_integer Object to be assigned + def enum_integer=(enum_integer) + validator = EnumAttributeValidator.new('Integer', [1, -1]) + unless validator.valid?(enum_integer) + fail ArgumentError, "invalid value for \"enum_integer\", must be one of #{validator.allowable_values}." + end + @enum_integer = enum_integer + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] enum_number Object to be assigned + def enum_number=(enum_number) + validator = EnumAttributeValidator.new('Float', [1.1, -1.2]) + unless validator.valid?(enum_number) + fail ArgumentError, "invalid value for \"enum_number\", must be one of #{validator.allowable_values}." + end + @enum_number = enum_number + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + enum_string == o.enum_string && + enum_string_required == o.enum_string_required && + enum_integer == o.enum_integer && + enum_number == o.enum_number && + outer_enum == o.outer_enum && + outer_enum_integer == o.outer_enum_integer && + outer_enum_default_value == o.outer_enum_default_value && + outer_enum_integer_default_value == o.outer_enum_integer_default_value + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [enum_string, enum_string_required, enum_integer, enum_number, outer_enum, outer_enum_integer, outer_enum_default_value, outer_enum_integer_default_value].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file.rb new file mode 100644 index 00000000000..459e4deba8f --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file.rb @@ -0,0 +1,198 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + # Must be named `File` for test. + class File + # Test capitalization + attr_accessor :source_uri + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'source_uri' => :'sourceURI' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'source_uri' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::File` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::File`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'source_uri') + self.source_uri = attributes[:'source_uri'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + source_uri == o.source_uri + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [source_uri].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb new file mode 100644 index 00000000000..c01bb104a3e --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb @@ -0,0 +1,207 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class FileSchemaTestClass + attr_accessor :file + + attr_accessor :files + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'file' => :'file', + :'files' => :'files' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'file' => :'File', + :'files' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::FileSchemaTestClass` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::FileSchemaTestClass`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'file') + self.file = attributes[:'file'] + end + + if attributes.key?(:'files') + if (value = attributes[:'files']).is_a?(Array) + self.files = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + file == o.file && + files == o.files + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [file, files].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/foo.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/foo.rb new file mode 100644 index 00000000000..0546ad92695 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/foo.rb @@ -0,0 +1,198 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class Foo + attr_accessor :bar + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'bar' => :'bar' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'bar' => :'String' + } + 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::Foo` 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::Foo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'bar') + self.bar = attributes[:'bar'] + else + self.bar = 'bar' + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + bar == o.bar + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [bar].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb new file mode 100644 index 00000000000..010a1d0efad --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb @@ -0,0 +1,547 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class FormatTest + attr_accessor :integer + + attr_accessor :int32 + + attr_accessor :int64 + + attr_accessor :number + + attr_accessor :float + + attr_accessor :double + + attr_accessor :string + + attr_accessor :byte + + attr_accessor :binary + + attr_accessor :date + + attr_accessor :date_time + + attr_accessor :uuid + + attr_accessor :password + + # A string that is a 10 digit number. Can have leading zeros. + attr_accessor :pattern_with_digits + + # A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + attr_accessor :pattern_with_digits_and_delimiter + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'integer' => :'integer', + :'int32' => :'int32', + :'int64' => :'int64', + :'number' => :'number', + :'float' => :'float', + :'double' => :'double', + :'string' => :'string', + :'byte' => :'byte', + :'binary' => :'binary', + :'date' => :'date', + :'date_time' => :'dateTime', + :'uuid' => :'uuid', + :'password' => :'password', + :'pattern_with_digits' => :'pattern_with_digits', + :'pattern_with_digits_and_delimiter' => :'pattern_with_digits_and_delimiter' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'integer' => :'Integer', + :'int32' => :'Integer', + :'int64' => :'Integer', + :'number' => :'Float', + :'float' => :'Float', + :'double' => :'Float', + :'string' => :'String', + :'byte' => :'String', + :'binary' => :'File', + :'date' => :'Date', + :'date_time' => :'DateTime', + :'uuid' => :'String', + :'password' => :'String', + :'pattern_with_digits' => :'String', + :'pattern_with_digits_and_delimiter' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::FormatTest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::FormatTest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'integer') + self.integer = attributes[:'integer'] + end + + if attributes.key?(:'int32') + self.int32 = attributes[:'int32'] + end + + if attributes.key?(:'int64') + self.int64 = attributes[:'int64'] + end + + if attributes.key?(:'number') + self.number = attributes[:'number'] + end + + if attributes.key?(:'float') + self.float = attributes[:'float'] + end + + if attributes.key?(:'double') + self.double = attributes[:'double'] + end + + if attributes.key?(:'string') + self.string = attributes[:'string'] + end + + if attributes.key?(:'byte') + self.byte = attributes[:'byte'] + end + + if attributes.key?(:'binary') + self.binary = attributes[:'binary'] + end + + if attributes.key?(:'date') + self.date = attributes[:'date'] + end + + if attributes.key?(:'date_time') + self.date_time = attributes[:'date_time'] + end + + if attributes.key?(:'uuid') + self.uuid = attributes[:'uuid'] + end + + if attributes.key?(:'password') + self.password = attributes[:'password'] + end + + if attributes.key?(:'pattern_with_digits') + self.pattern_with_digits = attributes[:'pattern_with_digits'] + end + + if attributes.key?(:'pattern_with_digits_and_delimiter') + self.pattern_with_digits_and_delimiter = attributes[:'pattern_with_digits_and_delimiter'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@integer.nil? && @integer > 100 + invalid_properties.push('invalid value for "integer", must be smaller than or equal to 100.') + end + + if !@integer.nil? && @integer < 10 + invalid_properties.push('invalid value for "integer", must be greater than or equal to 10.') + end + + if !@int32.nil? && @int32 > 200 + invalid_properties.push('invalid value for "int32", must be smaller than or equal to 200.') + end + + if !@int32.nil? && @int32 < 20 + invalid_properties.push('invalid value for "int32", must be greater than or equal to 20.') + end + + if @number.nil? + invalid_properties.push('invalid value for "number", number cannot be nil.') + end + + if @number > 543.2 + invalid_properties.push('invalid value for "number", must be smaller than or equal to 543.2.') + end + + if @number < 32.1 + invalid_properties.push('invalid value for "number", must be greater than or equal to 32.1.') + end + + if !@float.nil? && @float > 987.6 + invalid_properties.push('invalid value for "float", must be smaller than or equal to 987.6.') + end + + if !@float.nil? && @float < 54.3 + invalid_properties.push('invalid value for "float", must be greater than or equal to 54.3.') + end + + if !@double.nil? && @double > 123.4 + invalid_properties.push('invalid value for "double", must be smaller than or equal to 123.4.') + end + + if !@double.nil? && @double < 67.8 + invalid_properties.push('invalid value for "double", must be greater than or equal to 67.8.') + end + + pattern = Regexp.new(/[a-z]/i) + if !@string.nil? && @string !~ pattern + invalid_properties.push("invalid value for \"string\", must conform to the pattern #{pattern}.") + end + + if @byte.nil? + invalid_properties.push('invalid value for "byte", byte cannot be nil.') + end + + if @date.nil? + invalid_properties.push('invalid value for "date", date cannot be nil.') + end + + if @password.nil? + invalid_properties.push('invalid value for "password", password cannot be nil.') + end + + if @password.to_s.length > 64 + invalid_properties.push('invalid value for "password", the character length must be smaller than or equal to 64.') + end + + if @password.to_s.length < 10 + invalid_properties.push('invalid value for "password", the character length must be great than or equal to 10.') + end + + pattern = Regexp.new(/^\d{10}$/) + if !@pattern_with_digits.nil? && @pattern_with_digits !~ pattern + invalid_properties.push("invalid value for \"pattern_with_digits\", must conform to the pattern #{pattern}.") + end + + pattern = Regexp.new(/^image_\d{1,3}$/i) + if !@pattern_with_digits_and_delimiter.nil? && @pattern_with_digits_and_delimiter !~ pattern + invalid_properties.push("invalid value for \"pattern_with_digits_and_delimiter\", must conform to the pattern #{pattern}.") + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@integer.nil? && @integer > 100 + return false if !@integer.nil? && @integer < 10 + return false if !@int32.nil? && @int32 > 200 + return false if !@int32.nil? && @int32 < 20 + return false if @number.nil? + return false if @number > 543.2 + return false if @number < 32.1 + return false if !@float.nil? && @float > 987.6 + return false if !@float.nil? && @float < 54.3 + return false if !@double.nil? && @double > 123.4 + return false if !@double.nil? && @double < 67.8 + return false if !@string.nil? && @string !~ Regexp.new(/[a-z]/i) + return false if @byte.nil? + return false if @date.nil? + return false if @password.nil? + return false if @password.to_s.length > 64 + return false if @password.to_s.length < 10 + return false if !@pattern_with_digits.nil? && @pattern_with_digits !~ Regexp.new(/^\d{10}$/) + return false if !@pattern_with_digits_and_delimiter.nil? && @pattern_with_digits_and_delimiter !~ Regexp.new(/^image_\d{1,3}$/i) + true + end + + # Custom attribute writer method with validation + # @param [Object] integer Value to be assigned + def integer=(integer) + if !integer.nil? && integer > 100 + fail ArgumentError, 'invalid value for "integer", must be smaller than or equal to 100.' + end + + if !integer.nil? && integer < 10 + fail ArgumentError, 'invalid value for "integer", must be greater than or equal to 10.' + end + + @integer = integer + end + + # Custom attribute writer method with validation + # @param [Object] int32 Value to be assigned + def int32=(int32) + if !int32.nil? && int32 > 200 + fail ArgumentError, 'invalid value for "int32", must be smaller than or equal to 200.' + end + + if !int32.nil? && int32 < 20 + fail ArgumentError, 'invalid value for "int32", must be greater than or equal to 20.' + end + + @int32 = int32 + end + + # Custom attribute writer method with validation + # @param [Object] number Value to be assigned + def number=(number) + if number.nil? + fail ArgumentError, 'number cannot be nil' + end + + if number > 543.2 + fail ArgumentError, 'invalid value for "number", must be smaller than or equal to 543.2.' + end + + if number < 32.1 + fail ArgumentError, 'invalid value for "number", must be greater than or equal to 32.1.' + end + + @number = number + end + + # Custom attribute writer method with validation + # @param [Object] float Value to be assigned + def float=(float) + if !float.nil? && float > 987.6 + fail ArgumentError, 'invalid value for "float", must be smaller than or equal to 987.6.' + end + + if !float.nil? && float < 54.3 + fail ArgumentError, 'invalid value for "float", must be greater than or equal to 54.3.' + end + + @float = float + end + + # Custom attribute writer method with validation + # @param [Object] double Value to be assigned + def double=(double) + if !double.nil? && double > 123.4 + fail ArgumentError, 'invalid value for "double", must be smaller than or equal to 123.4.' + end + + if !double.nil? && double < 67.8 + fail ArgumentError, 'invalid value for "double", must be greater than or equal to 67.8.' + end + + @double = double + end + + # Custom attribute writer method with validation + # @param [Object] string Value to be assigned + def string=(string) + pattern = Regexp.new(/[a-z]/i) + if !string.nil? && string !~ pattern + fail ArgumentError, "invalid value for \"string\", must conform to the pattern #{pattern}." + end + + @string = string + end + + # Custom attribute writer method with validation + # @param [Object] password Value to be assigned + def password=(password) + if password.nil? + fail ArgumentError, 'password cannot be nil' + end + + if password.to_s.length > 64 + fail ArgumentError, 'invalid value for "password", the character length must be smaller than or equal to 64.' + end + + if password.to_s.length < 10 + fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 10.' + end + + @password = password + end + + # Custom attribute writer method with validation + # @param [Object] pattern_with_digits Value to be assigned + def pattern_with_digits=(pattern_with_digits) + pattern = Regexp.new(/^\d{10}$/) + if !pattern_with_digits.nil? && pattern_with_digits !~ pattern + fail ArgumentError, "invalid value for \"pattern_with_digits\", must conform to the pattern #{pattern}." + end + + @pattern_with_digits = pattern_with_digits + end + + # Custom attribute writer method with validation + # @param [Object] pattern_with_digits_and_delimiter Value to be assigned + def pattern_with_digits_and_delimiter=(pattern_with_digits_and_delimiter) + pattern = Regexp.new(/^image_\d{1,3}$/i) + if !pattern_with_digits_and_delimiter.nil? && pattern_with_digits_and_delimiter !~ pattern + fail ArgumentError, "invalid value for \"pattern_with_digits_and_delimiter\", must conform to the pattern #{pattern}." + end + + @pattern_with_digits_and_delimiter = pattern_with_digits_and_delimiter + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + integer == o.integer && + int32 == o.int32 && + int64 == o.int64 && + number == o.number && + float == o.float && + double == o.double && + string == o.string && + byte == o.byte && + binary == o.binary && + date == o.date && + date_time == o.date_time && + uuid == o.uuid && + password == o.password && + pattern_with_digits == o.pattern_with_digits && + pattern_with_digits_and_delimiter == o.pattern_with_digits_and_delimiter + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [integer, int32, int64, number, float, double, string, byte, binary, date, date_time, uuid, password, pattern_with_digits, pattern_with_digits_and_delimiter].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb new file mode 100644 index 00000000000..6d24ac174c5 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb @@ -0,0 +1,205 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class HasOnlyReadOnly + attr_accessor :bar + + attr_accessor :foo + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'bar' => :'bar', + :'foo' => :'foo' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'bar' => :'String', + :'foo' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::HasOnlyReadOnly` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::HasOnlyReadOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'bar') + self.bar = attributes[:'bar'] + end + + if attributes.key?(:'foo') + self.foo = attributes[:'foo'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + bar == o.bar && + foo == o.foo + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [bar, foo].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb new file mode 100644 index 00000000000..7d31c85a1d3 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb @@ -0,0 +1,197 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + # Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + class HealthCheckResult + attr_accessor :nullable_message + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'nullable_message' => :'NullableMessage' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'nullable_message' => :'String' + } + 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::HealthCheckResult` 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::HealthCheckResult`. 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?(:'nullable_message') + self.nullable_message = attributes[:'nullable_message'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + nullable_message == o.nullable_message + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [nullable_message].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb new file mode 100644 index 00000000000..3fc98931783 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb @@ -0,0 +1,207 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class InlineObject + # Updated name of the pet + attr_accessor :name + + # Updated status of the pet + attr_accessor :status + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'status' => :'status' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'status' => :'String' + } + 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::InlineObject` 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::InlineObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + 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 && + status == o.status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb new file mode 100644 index 00000000000..e61b19c09b0 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb @@ -0,0 +1,207 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class InlineObject1 + # Additional data to pass to server + attr_accessor :additional_metadata + + # file to upload + attr_accessor :file + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'additional_metadata' => :'additionalMetadata', + :'file' => :'file' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'additional_metadata' => :'String', + :'file' => :'File' + } + 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::InlineObject1` 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::InlineObject1`. 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?(:'additional_metadata') + self.additional_metadata = attributes[:'additional_metadata'] + end + + if attributes.key?(:'file') + self.file = attributes[:'file'] + 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 && + additional_metadata == o.additional_metadata && + file == o.file + 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 + [additional_metadata, file].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb new file mode 100644 index 00000000000..50514beacec --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb @@ -0,0 +1,245 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class InlineObject2 + # Form parameter enum test (string array) + attr_accessor :enum_form_string_array + + # Form parameter enum test (string) + attr_accessor :enum_form_string + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'enum_form_string_array' => :'enum_form_string_array', + :'enum_form_string' => :'enum_form_string' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'enum_form_string_array' => :'Array', + :'enum_form_string' => :'String' + } + 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::InlineObject2` 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::InlineObject2`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'enum_form_string_array') + if (value = attributes[:'enum_form_string_array']).is_a?(Array) + self.enum_form_string_array = value + end + end + + if attributes.key?(:'enum_form_string') + self.enum_form_string = attributes[:'enum_form_string'] + else + self.enum_form_string = '-efg' + 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? + enum_form_string_validator = EnumAttributeValidator.new('String', ["_abc", "-efg", "(xyz)"]) + return false unless enum_form_string_validator.valid?(@enum_form_string) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] enum_form_string Object to be assigned + def enum_form_string=(enum_form_string) + validator = EnumAttributeValidator.new('String', ["_abc", "-efg", "(xyz)"]) + unless validator.valid?(enum_form_string) + fail ArgumentError, "invalid value for \"enum_form_string\", must be one of #{validator.allowable_values}." + end + @enum_form_string = enum_form_string + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + enum_form_string_array == o.enum_form_string_array && + enum_form_string == o.enum_form_string + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [enum_form_string_array, enum_form_string].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb new file mode 100644 index 00000000000..15245d845c6 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb @@ -0,0 +1,528 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class InlineObject3 + # None + attr_accessor :integer + + # None + attr_accessor :int32 + + # None + attr_accessor :int64 + + # None + attr_accessor :number + + # None + attr_accessor :float + + # None + attr_accessor :double + + # None + attr_accessor :string + + # None + attr_accessor :pattern_without_delimiter + + # None + attr_accessor :byte + + # None + attr_accessor :binary + + # None + attr_accessor :date + + # None + attr_accessor :date_time + + # None + attr_accessor :password + + # None + attr_accessor :callback + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'integer' => :'integer', + :'int32' => :'int32', + :'int64' => :'int64', + :'number' => :'number', + :'float' => :'float', + :'double' => :'double', + :'string' => :'string', + :'pattern_without_delimiter' => :'pattern_without_delimiter', + :'byte' => :'byte', + :'binary' => :'binary', + :'date' => :'date', + :'date_time' => :'dateTime', + :'password' => :'password', + :'callback' => :'callback' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'integer' => :'Integer', + :'int32' => :'Integer', + :'int64' => :'Integer', + :'number' => :'Float', + :'float' => :'Float', + :'double' => :'Float', + :'string' => :'String', + :'pattern_without_delimiter' => :'String', + :'byte' => :'String', + :'binary' => :'File', + :'date' => :'Date', + :'date_time' => :'DateTime', + :'password' => :'String', + :'callback' => :'String' + } + 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::InlineObject3` 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::InlineObject3`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'integer') + self.integer = attributes[:'integer'] + end + + if attributes.key?(:'int32') + self.int32 = attributes[:'int32'] + end + + if attributes.key?(:'int64') + self.int64 = attributes[:'int64'] + end + + if attributes.key?(:'number') + self.number = attributes[:'number'] + end + + if attributes.key?(:'float') + self.float = attributes[:'float'] + end + + if attributes.key?(:'double') + self.double = attributes[:'double'] + end + + if attributes.key?(:'string') + self.string = attributes[:'string'] + end + + if attributes.key?(:'pattern_without_delimiter') + self.pattern_without_delimiter = attributes[:'pattern_without_delimiter'] + end + + if attributes.key?(:'byte') + self.byte = attributes[:'byte'] + end + + if attributes.key?(:'binary') + self.binary = attributes[:'binary'] + end + + if attributes.key?(:'date') + self.date = attributes[:'date'] + end + + if attributes.key?(:'date_time') + self.date_time = attributes[:'date_time'] + end + + if attributes.key?(:'password') + self.password = attributes[:'password'] + end + + if attributes.key?(:'callback') + self.callback = attributes[:'callback'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@integer.nil? && @integer > 100 + invalid_properties.push('invalid value for "integer", must be smaller than or equal to 100.') + end + + if !@integer.nil? && @integer < 10 + invalid_properties.push('invalid value for "integer", must be greater than or equal to 10.') + end + + if !@int32.nil? && @int32 > 200 + invalid_properties.push('invalid value for "int32", must be smaller than or equal to 200.') + end + + if !@int32.nil? && @int32 < 20 + invalid_properties.push('invalid value for "int32", must be greater than or equal to 20.') + end + + if @number.nil? + invalid_properties.push('invalid value for "number", number cannot be nil.') + end + + if @number > 543.2 + invalid_properties.push('invalid value for "number", must be smaller than or equal to 543.2.') + end + + if @number < 32.1 + invalid_properties.push('invalid value for "number", must be greater than or equal to 32.1.') + end + + if !@float.nil? && @float > 987.6 + invalid_properties.push('invalid value for "float", must be smaller than or equal to 987.6.') + end + + if @double.nil? + invalid_properties.push('invalid value for "double", double cannot be nil.') + end + + if @double > 123.4 + invalid_properties.push('invalid value for "double", must be smaller than or equal to 123.4.') + end + + if @double < 67.8 + invalid_properties.push('invalid value for "double", must be greater than or equal to 67.8.') + end + + pattern = Regexp.new(/[a-z]/i) + if !@string.nil? && @string !~ pattern + invalid_properties.push("invalid value for \"string\", must conform to the pattern #{pattern}.") + end + + if @pattern_without_delimiter.nil? + invalid_properties.push('invalid value for "pattern_without_delimiter", pattern_without_delimiter cannot be nil.') + end + + pattern = Regexp.new(/^[A-Z].*/) + if @pattern_without_delimiter !~ pattern + invalid_properties.push("invalid value for \"pattern_without_delimiter\", must conform to the pattern #{pattern}.") + end + + if @byte.nil? + invalid_properties.push('invalid value for "byte", byte cannot be nil.') + end + + if !@password.nil? && @password.to_s.length > 64 + invalid_properties.push('invalid value for "password", the character length must be smaller than or equal to 64.') + end + + if !@password.nil? && @password.to_s.length < 10 + invalid_properties.push('invalid value for "password", the character length must be great than or equal to 10.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@integer.nil? && @integer > 100 + return false if !@integer.nil? && @integer < 10 + return false if !@int32.nil? && @int32 > 200 + return false if !@int32.nil? && @int32 < 20 + return false if @number.nil? + return false if @number > 543.2 + return false if @number < 32.1 + return false if !@float.nil? && @float > 987.6 + return false if @double.nil? + return false if @double > 123.4 + return false if @double < 67.8 + return false if !@string.nil? && @string !~ Regexp.new(/[a-z]/i) + return false if @pattern_without_delimiter.nil? + return false if @pattern_without_delimiter !~ Regexp.new(/^[A-Z].*/) + return false if @byte.nil? + return false if !@password.nil? && @password.to_s.length > 64 + return false if !@password.nil? && @password.to_s.length < 10 + true + end + + # Custom attribute writer method with validation + # @param [Object] integer Value to be assigned + def integer=(integer) + if !integer.nil? && integer > 100 + fail ArgumentError, 'invalid value for "integer", must be smaller than or equal to 100.' + end + + if !integer.nil? && integer < 10 + fail ArgumentError, 'invalid value for "integer", must be greater than or equal to 10.' + end + + @integer = integer + end + + # Custom attribute writer method with validation + # @param [Object] int32 Value to be assigned + def int32=(int32) + if !int32.nil? && int32 > 200 + fail ArgumentError, 'invalid value for "int32", must be smaller than or equal to 200.' + end + + if !int32.nil? && int32 < 20 + fail ArgumentError, 'invalid value for "int32", must be greater than or equal to 20.' + end + + @int32 = int32 + end + + # Custom attribute writer method with validation + # @param [Object] number Value to be assigned + def number=(number) + if number.nil? + fail ArgumentError, 'number cannot be nil' + end + + if number > 543.2 + fail ArgumentError, 'invalid value for "number", must be smaller than or equal to 543.2.' + end + + if number < 32.1 + fail ArgumentError, 'invalid value for "number", must be greater than or equal to 32.1.' + end + + @number = number + end + + # Custom attribute writer method with validation + # @param [Object] float Value to be assigned + def float=(float) + if !float.nil? && float > 987.6 + fail ArgumentError, 'invalid value for "float", must be smaller than or equal to 987.6.' + end + + @float = float + end + + # Custom attribute writer method with validation + # @param [Object] double Value to be assigned + def double=(double) + if double.nil? + fail ArgumentError, 'double cannot be nil' + end + + if double > 123.4 + fail ArgumentError, 'invalid value for "double", must be smaller than or equal to 123.4.' + end + + if double < 67.8 + fail ArgumentError, 'invalid value for "double", must be greater than or equal to 67.8.' + end + + @double = double + end + + # Custom attribute writer method with validation + # @param [Object] string Value to be assigned + def string=(string) + pattern = Regexp.new(/[a-z]/i) + if !string.nil? && string !~ pattern + fail ArgumentError, "invalid value for \"string\", must conform to the pattern #{pattern}." + end + + @string = string + end + + # Custom attribute writer method with validation + # @param [Object] pattern_without_delimiter Value to be assigned + def pattern_without_delimiter=(pattern_without_delimiter) + if pattern_without_delimiter.nil? + fail ArgumentError, 'pattern_without_delimiter cannot be nil' + end + + pattern = Regexp.new(/^[A-Z].*/) + if pattern_without_delimiter !~ pattern + fail ArgumentError, "invalid value for \"pattern_without_delimiter\", must conform to the pattern #{pattern}." + end + + @pattern_without_delimiter = pattern_without_delimiter + end + + # Custom attribute writer method with validation + # @param [Object] password Value to be assigned + def password=(password) + if !password.nil? && password.to_s.length > 64 + fail ArgumentError, 'invalid value for "password", the character length must be smaller than or equal to 64.' + end + + if !password.nil? && password.to_s.length < 10 + fail ArgumentError, 'invalid value for "password", the character length must be great than or equal to 10.' + end + + @password = password + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + integer == o.integer && + int32 == o.int32 && + int64 == o.int64 && + number == o.number && + float == o.float && + double == o.double && + string == o.string && + pattern_without_delimiter == o.pattern_without_delimiter && + byte == o.byte && + binary == o.binary && + date == o.date && + date_time == o.date_time && + password == o.password && + callback == o.callback + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [integer, int32, int64, number, float, double, string, pattern_without_delimiter, byte, binary, date, date_time, password, callback].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb new file mode 100644 index 00000000000..72c7595b858 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb @@ -0,0 +1,217 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class InlineObject4 + # field1 + attr_accessor :param + + # field2 + attr_accessor :param2 + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'param' => :'param', + :'param2' => :'param2' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'param' => :'String', + :'param2' => :'String' + } + 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::InlineObject4` 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::InlineObject4`. 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?(:'param') + self.param = attributes[:'param'] + end + + if attributes.key?(:'param2') + self.param2 = attributes[:'param2'] + 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 @param.nil? + invalid_properties.push('invalid value for "param", param cannot be nil.') + end + + if @param2.nil? + invalid_properties.push('invalid value for "param2", param2 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 @param.nil? + return false if @param2.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 && + param == o.param && + param2 == o.param2 + 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 + [param, param2].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb new file mode 100644 index 00000000000..fdff4997056 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb @@ -0,0 +1,212 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class InlineObject5 + # Additional data to pass to server + attr_accessor :additional_metadata + + # file to upload + attr_accessor :required_file + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'additional_metadata' => :'additionalMetadata', + :'required_file' => :'requiredFile' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'additional_metadata' => :'String', + :'required_file' => :'File' + } + 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::InlineObject5` 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::InlineObject5`. 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?(:'additional_metadata') + self.additional_metadata = attributes[:'additional_metadata'] + end + + if attributes.key?(:'required_file') + self.required_file = attributes[:'required_file'] + 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 @required_file.nil? + invalid_properties.push('invalid value for "required_file", required_file 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 @required_file.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 && + additional_metadata == o.additional_metadata && + required_file == o.required_file + 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 + [additional_metadata, required_file].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb new file mode 100644 index 00000000000..fa811479dc0 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb @@ -0,0 +1,196 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class InlineResponseDefault + attr_accessor :string + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'string' => :'string' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'string' => :'Foo' + } + 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::InlineResponseDefault` 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::InlineResponseDefault`. 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') + self.string = attributes[:'string'] + 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 && + string == o.string + 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].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/list.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/list.rb new file mode 100644 index 00000000000..ab8318101b5 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/list.rb @@ -0,0 +1,196 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class List + attr_accessor :_123_list + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'_123_list' => :'123-list' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'_123_list' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::List` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::List`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'_123_list') + self._123_list = attributes[:'_123_list'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _123_list == o._123_list + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [_123_list].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb new file mode 100644 index 00000000000..68509874a7d --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb @@ -0,0 +1,253 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class MapTest + attr_accessor :map_map_of_string + + attr_accessor :map_of_enum_string + + attr_accessor :direct_map + + attr_accessor :indirect_map + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'map_map_of_string' => :'map_map_of_string', + :'map_of_enum_string' => :'map_of_enum_string', + :'direct_map' => :'direct_map', + :'indirect_map' => :'indirect_map' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'map_map_of_string' => :'Hash>', + :'map_of_enum_string' => :'Hash', + :'direct_map' => :'Hash', + :'indirect_map' => :'Hash' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::MapTest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::MapTest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'map_map_of_string') + if (value = attributes[:'map_map_of_string']).is_a?(Hash) + self.map_map_of_string = value + end + end + + if attributes.key?(:'map_of_enum_string') + if (value = attributes[:'map_of_enum_string']).is_a?(Hash) + self.map_of_enum_string = value + end + end + + if attributes.key?(:'direct_map') + if (value = attributes[:'direct_map']).is_a?(Hash) + self.direct_map = value + end + end + + if attributes.key?(:'indirect_map') + if (value = attributes[:'indirect_map']).is_a?(Hash) + self.indirect_map = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + map_map_of_string == o.map_map_of_string && + map_of_enum_string == o.map_of_enum_string && + direct_map == o.direct_map && + indirect_map == o.indirect_map + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [map_map_of_string, map_of_enum_string, direct_map, indirect_map].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb new file mode 100644 index 00000000000..f82bdde7721 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -0,0 +1,216 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class MixedPropertiesAndAdditionalPropertiesClass + attr_accessor :uuid + + attr_accessor :date_time + + attr_accessor :map + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'uuid' => :'uuid', + :'date_time' => :'dateTime', + :'map' => :'map' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'uuid' => :'String', + :'date_time' => :'DateTime', + :'map' => :'Hash' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::MixedPropertiesAndAdditionalPropertiesClass` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::MixedPropertiesAndAdditionalPropertiesClass`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'uuid') + self.uuid = attributes[:'uuid'] + end + + if attributes.key?(:'date_time') + self.date_time = attributes[:'date_time'] + end + + if attributes.key?(:'map') + if (value = attributes[:'map']).is_a?(Hash) + self.map = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + uuid == o.uuid && + date_time == o.date_time && + map == o.map + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [uuid, date_time, map].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb new file mode 100644 index 00000000000..d87939a4b8a --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb @@ -0,0 +1,206 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + # Model for testing model name starting with number + class Model200Response + attr_accessor :name + + attr_accessor :_class + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'_class' => :'class' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'Integer', + :'_class' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Model200Response` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Model200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'_class') + self._class = attributes[:'_class'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + _class == o._class + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, _class].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb new file mode 100644 index 00000000000..32b75d1f088 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb @@ -0,0 +1,197 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + # Model for testing reserved words + class ModelReturn + attr_accessor :_return + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'_return' => :'return' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'_return' => :'Integer' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ModelReturn` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ModelReturn`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'_return') + self._return = attributes[:'_return'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _return == o._return + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [_return].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/name.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/name.rb new file mode 100644 index 00000000000..665fc352764 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/name.rb @@ -0,0 +1,229 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + # Model for testing model name same as property name + class Name + attr_accessor :name + + attr_accessor :snake_case + + attr_accessor :property + + attr_accessor :_123_number + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'snake_case' => :'snake_case', + :'property' => :'property', + :'_123_number' => :'123Number' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'Integer', + :'snake_case' => :'Integer', + :'property' => :'String', + :'_123_number' => :'Integer' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Name` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Name`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'snake_case') + self.snake_case = attributes[:'snake_case'] + end + + if attributes.key?(:'property') + self.property = attributes[:'property'] + end + + if attributes.key?(:'_123_number') + self._123_number = attributes[:'_123_number'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @name.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + snake_case == o.snake_case && + property == o.property && + _123_number == o._123_number + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, snake_case, property, _123_number].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb new file mode 100644 index 00000000000..eab0edde201 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb @@ -0,0 +1,307 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class NullableClass + attr_accessor :integer_prop + + attr_accessor :number_prop + + attr_accessor :boolean_prop + + attr_accessor :string_prop + + attr_accessor :date_prop + + attr_accessor :datetime_prop + + attr_accessor :array_nullable_prop + + attr_accessor :array_and_items_nullable_prop + + attr_accessor :array_items_nullable + + attr_accessor :object_nullable_prop + + attr_accessor :object_and_items_nullable_prop + + attr_accessor :object_items_nullable + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'integer_prop' => :'integer_prop', + :'number_prop' => :'number_prop', + :'boolean_prop' => :'boolean_prop', + :'string_prop' => :'string_prop', + :'date_prop' => :'date_prop', + :'datetime_prop' => :'datetime_prop', + :'array_nullable_prop' => :'array_nullable_prop', + :'array_and_items_nullable_prop' => :'array_and_items_nullable_prop', + :'array_items_nullable' => :'array_items_nullable', + :'object_nullable_prop' => :'object_nullable_prop', + :'object_and_items_nullable_prop' => :'object_and_items_nullable_prop', + :'object_items_nullable' => :'object_items_nullable' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'integer_prop' => :'Integer', + :'number_prop' => :'Float', + :'boolean_prop' => :'Boolean', + :'string_prop' => :'String', + :'date_prop' => :'Date', + :'datetime_prop' => :'DateTime', + :'array_nullable_prop' => :'Array', + :'array_and_items_nullable_prop' => :'Array', + :'array_items_nullable' => :'Array', + :'object_nullable_prop' => :'Hash', + :'object_and_items_nullable_prop' => :'Hash', + :'object_items_nullable' => :'Hash' + } + 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::NullableClass` 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::NullableClass`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'integer_prop') + self.integer_prop = attributes[:'integer_prop'] + end + + if attributes.key?(:'number_prop') + self.number_prop = attributes[:'number_prop'] + end + + if attributes.key?(:'boolean_prop') + self.boolean_prop = attributes[:'boolean_prop'] + end + + if attributes.key?(:'string_prop') + self.string_prop = attributes[:'string_prop'] + end + + if attributes.key?(:'date_prop') + self.date_prop = attributes[:'date_prop'] + end + + if attributes.key?(:'datetime_prop') + self.datetime_prop = attributes[:'datetime_prop'] + end + + if attributes.key?(:'array_nullable_prop') + if (value = attributes[:'array_nullable_prop']).is_a?(Array) + self.array_nullable_prop = value + end + end + + if attributes.key?(:'array_and_items_nullable_prop') + if (value = attributes[:'array_and_items_nullable_prop']).is_a?(Array) + self.array_and_items_nullable_prop = value + end + end + + if attributes.key?(:'array_items_nullable') + if (value = attributes[:'array_items_nullable']).is_a?(Array) + self.array_items_nullable = value + end + end + + if attributes.key?(:'object_nullable_prop') + if (value = attributes[:'object_nullable_prop']).is_a?(Hash) + self.object_nullable_prop = value + end + end + + if attributes.key?(:'object_and_items_nullable_prop') + if (value = attributes[:'object_and_items_nullable_prop']).is_a?(Hash) + self.object_and_items_nullable_prop = value + end + end + + if attributes.key?(:'object_items_nullable') + if (value = attributes[:'object_items_nullable']).is_a?(Hash) + self.object_items_nullable = 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 && + integer_prop == o.integer_prop && + number_prop == o.number_prop && + boolean_prop == o.boolean_prop && + string_prop == o.string_prop && + date_prop == o.date_prop && + datetime_prop == o.datetime_prop && + array_nullable_prop == o.array_nullable_prop && + array_and_items_nullable_prop == o.array_and_items_nullable_prop && + array_items_nullable == o.array_items_nullable && + object_nullable_prop == o.object_nullable_prop && + object_and_items_nullable_prop == o.object_and_items_nullable_prop && + object_items_nullable == o.object_items_nullable + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [integer_prop, number_prop, boolean_prop, string_prop, date_prop, datetime_prop, array_nullable_prop, array_and_items_nullable_prop, array_items_nullable, object_nullable_prop, object_and_items_nullable_prop, object_items_nullable].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb new file mode 100644 index 00000000000..8b6da24af4b --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb @@ -0,0 +1,196 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class NumberOnly + attr_accessor :just_number + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'just_number' => :'JustNumber' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'just_number' => :'Float' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::NumberOnly` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::NumberOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'just_number') + self.just_number = attributes[:'just_number'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + just_number == o.just_number + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [just_number].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/order.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/order.rb new file mode 100644 index 00000000000..bcfc925dbf3 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/order.rb @@ -0,0 +1,278 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class Order + attr_accessor :id + + attr_accessor :pet_id + + attr_accessor :quantity + + attr_accessor :ship_date + + # Order Status + attr_accessor :status + + attr_accessor :complete + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'pet_id' => :'petId', + :'quantity' => :'quantity', + :'ship_date' => :'shipDate', + :'status' => :'status', + :'complete' => :'complete' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'Integer', + :'pet_id' => :'Integer', + :'quantity' => :'Integer', + :'ship_date' => :'DateTime', + :'status' => :'String', + :'complete' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Order` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Order`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'pet_id') + self.pet_id = attributes[:'pet_id'] + end + + if attributes.key?(:'quantity') + self.quantity = attributes[:'quantity'] + end + + if attributes.key?(:'ship_date') + self.ship_date = attributes[:'ship_date'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'complete') + self.complete = attributes[:'complete'] + else + self.complete = false + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + status_validator = EnumAttributeValidator.new('String', ["placed", "approved", "delivered"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["placed", "approved", "delivered"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + pet_id == o.pet_id && + quantity == o.quantity && + ship_date == o.ship_date && + status == o.status && + complete == o.complete + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, pet_id, quantity, ship_date, status, complete].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb new file mode 100644 index 00000000000..1cfbf6659a7 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb @@ -0,0 +1,214 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class OuterComposite + attr_accessor :my_number + + attr_accessor :my_string + + attr_accessor :my_boolean + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'my_number' => :'my_number', + :'my_string' => :'my_string', + :'my_boolean' => :'my_boolean' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'my_number' => :'Float', + :'my_string' => :'String', + :'my_boolean' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::OuterComposite` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::OuterComposite`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'my_number') + self.my_number = attributes[:'my_number'] + end + + if attributes.key?(:'my_string') + self.my_string = attributes[:'my_string'] + end + + if attributes.key?(:'my_boolean') + self.my_boolean = attributes[:'my_boolean'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + my_number == o.my_number && + my_string == o.my_string && + my_boolean == o.my_boolean + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [my_number, my_string, my_boolean].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb new file mode 100644 index 00000000000..c7d622d9703 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb @@ -0,0 +1,37 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class OuterEnum + PLACED = "placed".freeze + APPROVED = "approved".freeze + DELIVERED = "delivered".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = OuterEnum.constants.select { |c| OuterEnum::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #OuterEnum" if constantValues.empty? + value + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb new file mode 100644 index 00000000000..38e51df938c --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb @@ -0,0 +1,37 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class OuterEnumDefaultValue + PLACED = "placed".freeze + APPROVED = "approved".freeze + DELIVERED = "delivered".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = OuterEnumDefaultValue.constants.select { |c| OuterEnumDefaultValue::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #OuterEnumDefaultValue" if constantValues.empty? + value + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb new file mode 100644 index 00000000000..70788d1e873 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb @@ -0,0 +1,37 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class OuterEnumInteger + N0 = 0.freeze + N1 = 1.freeze + N2 = 2.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = OuterEnumInteger.constants.select { |c| OuterEnumInteger::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #OuterEnumInteger" if constantValues.empty? + value + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb new file mode 100644 index 00000000000..0d074b8b9f5 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb @@ -0,0 +1,37 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class OuterEnumIntegerDefaultValue + N0 = 0.freeze + N1 = 1.freeze + N2 = 2.freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = OuterEnumIntegerDefaultValue.constants.select { |c| OuterEnumIntegerDefaultValue::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #OuterEnumIntegerDefaultValue" if constantValues.empty? + value + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/pet.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/pet.rb new file mode 100644 index 00000000000..20a476bbe9f --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/pet.rb @@ -0,0 +1,290 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class Pet + attr_accessor :id + + attr_accessor :category + + attr_accessor :name + + attr_accessor :photo_urls + + attr_accessor :tags + + # pet status in the store + attr_accessor :status + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'category' => :'category', + :'name' => :'name', + :'photo_urls' => :'photoUrls', + :'tags' => :'tags', + :'status' => :'status' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'Integer', + :'category' => :'Category', + :'name' => :'String', + :'photo_urls' => :'Array', + :'tags' => :'Array', + :'status' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Pet` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Pet`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'category') + self.category = attributes[:'category'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'photo_urls') + if (value = attributes[:'photo_urls']).is_a?(Array) + self.photo_urls = value + end + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @photo_urls.nil? + invalid_properties.push('invalid value for "photo_urls", photo_urls cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @name.nil? + return false if @photo_urls.nil? + status_validator = EnumAttributeValidator.new('String', ["available", "pending", "sold"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["available", "pending", "sold"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + category == o.category && + name == o.name && + photo_urls == o.photo_urls && + tags == o.tags && + status == o.status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, category, name, photo_urls, tags, status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb new file mode 100644 index 00000000000..012f382be79 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb @@ -0,0 +1,205 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class ReadOnlyFirst + attr_accessor :bar + + attr_accessor :baz + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'bar' => :'bar', + :'baz' => :'baz' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'bar' => :'String', + :'baz' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::ReadOnlyFirst` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ReadOnlyFirst`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'bar') + self.bar = attributes[:'bar'] + end + + if attributes.key?(:'baz') + self.baz = attributes[:'baz'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + bar == o.bar && + baz == o.baz + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [bar, baz].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb new file mode 100644 index 00000000000..b2bc0dc84a6 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb @@ -0,0 +1,196 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class SpecialModelName + attr_accessor :special_property_name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'special_property_name' => :'$special[property.name]' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'special_property_name' => :'Integer' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::SpecialModelName` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::SpecialModelName`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'special_property_name') + self.special_property_name = attributes[:'special_property_name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + special_property_name == o.special_property_name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [special_property_name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/tag.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/tag.rb new file mode 100644 index 00000000000..6d79193b09a --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/tag.rb @@ -0,0 +1,205 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class Tag + attr_accessor :id + + attr_accessor :name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'Integer', + :'name' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::Tag` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Tag`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + name == o.name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/user.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/user.rb new file mode 100644 index 00000000000..5b97445cc16 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/user.rb @@ -0,0 +1,260 @@ +=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.0-SNAPSHOT + +=end + +require 'date' + +module Petstore + class User + attr_accessor :id + + attr_accessor :username + + attr_accessor :first_name + + attr_accessor :last_name + + attr_accessor :email + + attr_accessor :password + + attr_accessor :phone + + # User Status + attr_accessor :user_status + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'username' => :'username', + :'first_name' => :'firstName', + :'last_name' => :'lastName', + :'email' => :'email', + :'password' => :'password', + :'phone' => :'phone', + :'user_status' => :'userStatus' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'Integer', + :'username' => :'String', + :'first_name' => :'String', + :'last_name' => :'String', + :'email' => :'String', + :'password' => :'String', + :'phone' => :'String', + :'user_status' => :'Integer' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Petstore::User` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::User`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'username') + self.username = attributes[:'username'] + end + + if attributes.key?(:'first_name') + self.first_name = attributes[:'first_name'] + end + + if attributes.key?(:'last_name') + self.last_name = attributes[:'last_name'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'password') + self.password = attributes[:'password'] + end + + if attributes.key?(:'phone') + self.phone = attributes[:'phone'] + end + + if attributes.key?(:'user_status') + self.user_status = attributes[:'user_status'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + username == o.username && + first_name == o.first_name && + last_name == o.last_name && + email == o.email && + password == o.password && + phone == o.phone && + user_status == o.user_status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, username, first_name, last_name, email, password, phone, user_status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Petstore.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/version.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/version.rb new file mode 100644 index 00000000000..29645445838 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/version.rb @@ -0,0 +1,15 @@ +=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.0-SNAPSHOT + +=end + +module Petstore + VERSION = '1.0.0' +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec b/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec new file mode 100644 index 00000000000..6cbf88ba127 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec @@ -0,0 +1,41 @@ +# -*- encoding: utf-8 -*- + +=begin +#OpenAPI Petstore + +#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +The version of the OpenAPI document: 1.0.0 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.1.0-SNAPSHOT + +=end + +$:.push File.expand_path("../lib", __FILE__) +require "petstore/version" + +Gem::Specification.new do |s| + s.name = "petstore" + s.version = Petstore::VERSION + s.platform = Gem::Platform::RUBY + s.authors = ["OpenAPI-Generator"] + s.email = [""] + s.homepage = "https://openapi-generator.tech" + s.summary = "OpenAPI Petstore Ruby Gem" + s.description = "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\" + s.license = "Unlicense" + s.required_ruby_version = ">= 1.9" + + s.add_runtime_dependency 'faraday', '>= 0.14.0' + s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' + + s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' + s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1' + s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3' + + s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } + s.test_files = `find spec/*`.split("\n") + s.executables = [] + s.require_paths = ["lib"] +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/pom.xml b/samples/openapi3/client/petstore/ruby-faraday/pom.xml new file mode 100644 index 00000000000..ceb55edcec4 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/pom.xml @@ -0,0 +1,62 @@ + + 4.0.0 + org.openapitools + RubyPetstoreFaradayClientTests + pom + 1.0-SNAPSHOT + Ruby OpenAPI Faraday Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + bundle-install + pre-integration-test + + exec + + + bundle + + install + --path + vendor/bundle + + + + + bundle-test + integration-test + + exec + + + bundle + + exec + rspec + + + + + + + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb new file mode 100644 index 00000000000..7fc8ef59bdc --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb @@ -0,0 +1,47 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for Petstore::AnotherFakeApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'AnotherFakeApi' do + before do + # run before each test + @api_instance = Petstore::AnotherFakeApi.new + end + + after do + # run after each test + end + + describe 'test an instance of AnotherFakeApi' do + it 'should create an instance of AnotherFakeApi' do + expect(@api_instance).to be_instance_of(Petstore::AnotherFakeApi) + end + end + + # unit tests for call_123_test_special_tags + # To test special tags + # To test special tags and operation ID starting with number + # @param client client model + # @param [Hash] opts the optional parameters + # @return [Client] + describe 'call_123_test_special_tags test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/default_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/default_api_spec.rb new file mode 100644 index 00000000000..132532dde17 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/default_api_spec.rb @@ -0,0 +1,44 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for Petstore::DefaultApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'DefaultApi' do + before do + # run before each test + @api_instance = Petstore::DefaultApi.new + end + + after do + # run after each test + end + + describe 'test an instance of DefaultApi' do + it 'should create an instance of DefaultApi' do + expect(@api_instance).to be_instance_of(Petstore::DefaultApi) + end + end + + # unit tests for foo_get + # @param [Hash] opts the optional parameters + # @return [InlineResponseDefault] + describe 'foo_get test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb new file mode 100644 index 00000000000..f0d6a13636f --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb @@ -0,0 +1,207 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for Petstore::FakeApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'FakeApi' do + before do + # run before each test + @api_instance = Petstore::FakeApi.new + end + + after do + # run after each test + end + + describe 'test an instance of FakeApi' do + it 'should create an instance of FakeApi' do + expect(@api_instance).to be_instance_of(Petstore::FakeApi) + end + end + + # unit tests for fake_health_get + # Health check endpoint + # @param [Hash] opts the optional parameters + # @return [HealthCheckResult] + describe 'fake_health_get test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for fake_outer_boolean_serialize + # Test serialization of outer boolean types + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :body Input boolean as post body + # @return [Boolean] + describe 'fake_outer_boolean_serialize test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for fake_outer_composite_serialize + # Test serialization of object with outer number type + # @param [Hash] opts the optional parameters + # @option opts [OuterComposite] :outer_composite Input composite as post body + # @return [OuterComposite] + describe 'fake_outer_composite_serialize test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for fake_outer_number_serialize + # Test serialization of outer number types + # @param [Hash] opts the optional parameters + # @option opts [Float] :body Input number as post body + # @return [Float] + describe 'fake_outer_number_serialize test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for fake_outer_string_serialize + # Test serialization of outer string types + # @param [Hash] opts the optional parameters + # @option opts [String] :body Input string as post body + # @return [String] + describe 'fake_outer_string_serialize test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for test_body_with_file_schema + # For this test, the body for this request much reference a schema named `File`. + # @param file_schema_test_class + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'test_body_with_file_schema test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for test_body_with_query_params + # @param query + # @param user + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'test_body_with_query_params test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for test_client_model + # To test \"client\" model + # To test \"client\" model + # @param client client model + # @param [Hash] opts the optional parameters + # @return [Client] + describe 'test_client_model test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for test_endpoint_parameters + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + # @param number None + # @param double None + # @param pattern_without_delimiter None + # @param byte None + # @param [Hash] opts the optional parameters + # @option opts [Integer] :integer None + # @option opts [Integer] :int32 None + # @option opts [Integer] :int64 None + # @option opts [Float] :float None + # @option opts [String] :string None + # @option opts [File] :binary None + # @option opts [Date] :date None + # @option opts [DateTime] :date_time None + # @option opts [String] :password None + # @option opts [String] :callback None + # @return [nil] + describe 'test_endpoint_parameters test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for test_enum_parameters + # To test enum parameters + # To test enum parameters + # @param [Hash] opts the optional parameters + # @option opts [Array] :enum_header_string_array Header parameter enum test (string array) + # @option opts [String] :enum_header_string Header parameter enum test (string) + # @option opts [Array] :enum_query_string_array Query parameter enum test (string array) + # @option opts [String] :enum_query_string Query parameter enum test (string) + # @option opts [Integer] :enum_query_integer Query parameter enum test (double) + # @option opts [Float] :enum_query_double Query parameter enum test (double) + # @option opts [Array] :enum_form_string_array Form parameter enum test (string array) + # @option opts [String] :enum_form_string Form parameter enum test (string) + # @return [nil] + describe 'test_enum_parameters test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for test_group_parameters + # Fake endpoint to test group parameters (optional) + # Fake endpoint to test group parameters (optional) + # @param required_string_group Required String in group parameters + # @param required_boolean_group Required Boolean in group parameters + # @param required_int64_group Required Integer in group parameters + # @param [Hash] opts the optional parameters + # @option opts [Integer] :string_group String in group parameters + # @option opts [Boolean] :boolean_group Boolean in group parameters + # @option opts [Integer] :int64_group Integer in group parameters + # @return [nil] + describe 'test_group_parameters test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for test_inline_additional_properties + # test inline additionalProperties + # @param request_body request body + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'test_inline_additional_properties test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for test_json_form_data + # test json serialization of form data + # @param param field1 + # @param param2 field2 + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'test_json_form_data test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb new file mode 100644 index 00000000000..12c2278ca20 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb @@ -0,0 +1,47 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for Petstore::FakeClassnameTags123Api +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'FakeClassnameTags123Api' do + before do + # run before each test + @api_instance = Petstore::FakeClassnameTags123Api.new + end + + after do + # run after each test + end + + describe 'test an instance of FakeClassnameTags123Api' do + it 'should create an instance of FakeClassnameTags123Api' do + expect(@api_instance).to be_instance_of(Petstore::FakeClassnameTags123Api) + end + end + + # unit tests for test_classname + # To test class name in snake case + # To test class name in snake case + # @param client client model + # @param [Hash] opts the optional parameters + # @return [Client] + describe 'test_classname test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb new file mode 100644 index 00000000000..a202df82415 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb @@ -0,0 +1,144 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for Petstore::PetApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'PetApi' do + before do + # run before each test + @api_instance = Petstore::PetApi.new + end + + after do + # run after each test + end + + describe 'test an instance of PetApi' do + it 'should create an instance of PetApi' do + expect(@api_instance).to be_instance_of(Petstore::PetApi) + end + end + + # unit tests for add_pet + # Add a new pet to the store + # @param pet Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'add_pet test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for delete_pet + # Deletes a pet + # @param pet_id Pet id to delete + # @param [Hash] opts the optional parameters + # @option opts [String] :api_key + # @return [nil] + describe 'delete_pet test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for find_pets_by_status + # Finds Pets by status + # Multiple status values can be provided with comma separated strings + # @param status Status values that need to be considered for filter + # @param [Hash] opts the optional parameters + # @return [Array] + describe 'find_pets_by_status test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for find_pets_by_tags + # Finds Pets by tags + # Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + # @param tags Tags to filter by + # @param [Hash] opts the optional parameters + # @return [Array] + describe 'find_pets_by_tags test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_pet_by_id + # Find pet by ID + # Returns a single pet + # @param pet_id ID of pet to return + # @param [Hash] opts the optional parameters + # @return [Pet] + describe 'get_pet_by_id test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_pet + # Update an existing pet + # @param pet Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'update_pet test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_pet_with_form + # Updates a pet in the store with form data + # @param pet_id ID of pet that needs to be updated + # @param [Hash] opts the optional parameters + # @option opts [String] :name Updated name of the pet + # @option opts [String] :status Updated status of the pet + # @return [nil] + describe 'update_pet_with_form test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for upload_file + # uploads an image + # @param pet_id ID of pet to update + # @param [Hash] opts the optional parameters + # @option opts [String] :additional_metadata Additional data to pass to server + # @option opts [File] :file file to upload + # @return [ApiResponse] + describe 'upload_file test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for upload_file_with_required_file + # uploads an image (required) + # @param pet_id ID of pet to update + # @param required_file file to upload + # @param [Hash] opts the optional parameters + # @option opts [String] :additional_metadata Additional data to pass to server + # @return [ApiResponse] + describe 'upload_file_with_required_file test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/store_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/store_api_spec.rb new file mode 100644 index 00000000000..61b633b4085 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/store_api_spec.rb @@ -0,0 +1,81 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for Petstore::StoreApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'StoreApi' do + before do + # run before each test + @api_instance = Petstore::StoreApi.new + end + + after do + # run after each test + end + + describe 'test an instance of StoreApi' do + it 'should create an instance of StoreApi' do + expect(@api_instance).to be_instance_of(Petstore::StoreApi) + end + end + + # unit tests for delete_order + # Delete purchase order by ID + # For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + # @param order_id ID of the order that needs to be deleted + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'delete_order test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_inventory + # Returns pet inventories by status + # Returns a map of status codes to quantities + # @param [Hash] opts the optional parameters + # @return [Hash] + describe 'get_inventory test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_order_by_id + # Find purchase order by ID + # For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + # @param order_id ID of pet that needs to be fetched + # @param [Hash] opts the optional parameters + # @return [Order] + describe 'get_order_by_id test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for place_order + # Place an order for a pet + # @param order order placed for purchasing the pet + # @param [Hash] opts the optional parameters + # @return [Order] + describe 'place_order test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/user_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/user_api_spec.rb new file mode 100644 index 00000000000..248006835ed --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/user_api_spec.rb @@ -0,0 +1,127 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for Petstore::UserApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'UserApi' do + before do + # run before each test + @api_instance = Petstore::UserApi.new + end + + after do + # run after each test + end + + describe 'test an instance of UserApi' do + it 'should create an instance of UserApi' do + expect(@api_instance).to be_instance_of(Petstore::UserApi) + end + end + + # unit tests for create_user + # Create user + # This can only be done by the logged in user. + # @param user Created user object + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'create_user test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_users_with_array_input + # Creates list of users with given input array + # @param user List of user object + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'create_users_with_array_input test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_users_with_list_input + # Creates list of users with given input array + # @param user List of user object + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'create_users_with_list_input test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for delete_user + # Delete user + # This can only be done by the logged in user. + # @param username The name that needs to be deleted + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'delete_user test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_user_by_name + # Get user by user name + # @param username The name that needs to be fetched. Use user1 for testing. + # @param [Hash] opts the optional parameters + # @return [User] + describe 'get_user_by_name test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for login_user + # Logs user into the system + # @param username The user name for login + # @param password The password for login in clear text + # @param [Hash] opts the optional parameters + # @return [String] + describe 'login_user test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for logout_user + # Logs out current logged in user session + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'logout_user test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_user + # Updated user + # This can only be done by the logged in user. + # @param username name that need to be deleted + # @param user Updated user object + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'update_user test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api_client_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api_client_spec.rb new file mode 100644 index 00000000000..a9fd5b4ba1e --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api_client_spec.rb @@ -0,0 +1,188 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' + +describe Petstore::ApiClient do + context 'initialization' do + context 'URL stuff' do + context 'host' do + it 'removes http from host' do + Petstore.configure { |c| c.host = 'http://example.com' } + expect(Petstore::Configuration.default.host).to eq('example.com') + end + + it 'removes https from host' do + Petstore.configure { |c| c.host = 'https://wookiee.com' } + expect(Petstore::ApiClient.default.config.host).to eq('wookiee.com') + end + + it 'removes trailing path from host' do + Petstore.configure { |c| c.host = 'hobo.com/v4' } + expect(Petstore::Configuration.default.host).to eq('hobo.com') + end + end + + context 'base_path' do + it "prepends a slash to base_path" do + Petstore.configure { |c| c.base_path = 'v4/dog' } + expect(Petstore::Configuration.default.base_path).to eq('/v4/dog') + end + + it "doesn't prepend a slash if one is already there" do + Petstore.configure { |c| c.base_path = '/v4/dog' } + expect(Petstore::Configuration.default.base_path).to eq('/v4/dog') + end + + it "ends up as a blank string if nil" do + Petstore.configure { |c| c.base_path = nil } + expect(Petstore::Configuration.default.base_path).to eq('') + end + end + end + end + + describe '#deserialize' do + it "handles Array" do + api_client = Petstore::ApiClient.new + headers = { 'Content-Type' => 'application/json' } + response = double('response', headers: headers, body: '[12, 34]') + data = api_client.deserialize(response, 'Array') + expect(data).to be_instance_of(Array) + expect(data).to eq([12, 34]) + end + + it 'handles Array>' do + api_client = Petstore::ApiClient.new + headers = { 'Content-Type' => 'application/json' } + response = double('response', headers: headers, body: '[[12, 34], [56]]') + data = api_client.deserialize(response, 'Array>') + expect(data).to be_instance_of(Array) + expect(data).to eq([[12, 34], [56]]) + end + + it 'handles Hash' do + api_client = Petstore::ApiClient.new + headers = { 'Content-Type' => 'application/json' } + response = double('response', headers: headers, body: '{"message": "Hello"}') + data = api_client.deserialize(response, 'Hash') + expect(data).to be_instance_of(Hash) + expect(data).to eq(:message => 'Hello') + end + end + + describe "#object_to_hash" do + it 'ignores nils and includes empty arrays' do + # uncomment below to test object_to_hash for model + # api_client = Petstore::ApiClient.new + # _model = Petstore::ModelName.new + # update the model attribute below + # _model.id = 1 + # update the expected value (hash) below + # expected = {id: 1, name: '', tags: []} + # expect(api_client.object_to_hash(_model)).to eq(expected) + end + end + + describe '#build_collection_param' do + let(:param) { ['aa', 'bb', 'cc'] } + let(:api_client) { Petstore::ApiClient.new } + + it 'works for csv' do + expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc') + end + + it 'works for ssv' do + expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc') + end + + it 'works for tsv' do + expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc") + end + + it 'works for pipes' do + expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc') + end + + it 'works for multi' do + expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc']) + end + + it 'fails for invalid collection format' do + expect(proc { api_client.build_collection_param(param, :INVALID) }).to raise_error(RuntimeError, 'unknown collection format: :INVALID') + end + end + + describe '#json_mime?' do + let(:api_client) { Petstore::ApiClient.new } + + it 'works' do + expect(api_client.json_mime?(nil)).to eq false + expect(api_client.json_mime?('')).to eq false + + expect(api_client.json_mime?('application/json')).to eq true + expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true + expect(api_client.json_mime?('APPLICATION/JSON')).to eq true + + expect(api_client.json_mime?('application/xml')).to eq false + expect(api_client.json_mime?('text/plain')).to eq false + expect(api_client.json_mime?('application/jsonp')).to eq false + end + end + + describe '#select_header_accept' do + let(:api_client) { Petstore::ApiClient.new } + + it 'works' do + expect(api_client.select_header_accept(nil)).to be_nil + expect(api_client.select_header_accept([])).to be_nil + + expect(api_client.select_header_accept(['application/json'])).to eq('application/json') + expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8') + expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON') + + expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml') + expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml') + end + end + + describe '#select_header_content_type' do + let(:api_client) { Petstore::ApiClient.new } + + it 'works' do + expect(api_client.select_header_content_type(nil)).to eq('application/json') + expect(api_client.select_header_content_type([])).to eq('application/json') + + expect(api_client.select_header_content_type(['application/json'])).to eq('application/json') + expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8') + expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON') + expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml') + expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain') + end + end + + describe '#sanitize_filename' do + let(:api_client) { Petstore::ApiClient.new } + + it 'works' do + expect(api_client.sanitize_filename('sun')).to eq('sun') + expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif') + expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif') + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/configuration_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/configuration_spec.rb new file mode 100644 index 00000000000..08263fa509b --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/configuration_spec.rb @@ -0,0 +1,42 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' + +describe Petstore::Configuration do + let(:config) { Petstore::Configuration.default } + + before(:each) do + # uncomment below to setup host and base_path + # require 'URI' + # uri = URI.parse("http://petstore.swagger.io:80/v2") + # Petstore.configure do |c| + # c.host = uri.host + # c.base_path = uri.path + # end + end + + describe '#base_url' do + it 'should have the default value' do + # uncomment below to test default value of the base path + # expect(config.base_url).to eq("http://petstore.swagger.io:80/v2") + end + + it 'should remove trailing slashes' do + [nil, '', '/', '//'].each do |base_path| + config.base_path = base_path + # uncomment below to test trailing slashes + # expect(config.base_url).to eq("http://petstore.swagger.io:80/v2") + end + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/custom/api_error_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/custom/api_error_spec.rb new file mode 100644 index 00000000000..46b86b1a250 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/custom/api_error_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +describe Petstore::ApiClient do + describe '#initialize' do + it "should save the message if one is given" do + err = Petstore::ApiError.new(message: "Hello") + expect(err.message).to eq("Hello") + end + + it "should save the message and code if both are given" do + err = Petstore::ApiError.new(message: "Hello", code: 0) + expect(err.message).to eq("Hello\nHTTP status code: 0") + end + + it "should save the hash as message if no message is given" do + err = Petstore::ApiError.new(code: 500, response_body: "server error") + expect(err.message).to eq("Error message: the server returns an error\nHTTP status code: 500\nResponse body: server error") + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/custom/base_object_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/custom/base_object_spec.rb new file mode 100644 index 00000000000..a603b6d3c44 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/custom/base_object_spec.rb @@ -0,0 +1,109 @@ +require 'spec_helper' + +class ArrayMapObject < Petstore::Category + attr_accessor :int_arr, :pet_arr, :int_map, :pet_map, :int_arr_map, :pet_arr_map, :boolean_true_arr, :boolean_false_arr + + def self.attribute_map + { + :int_arr => :int_arr, + :pet_arr => :pet_arr, + :int_map => :int_map, + :pet_map => :pet_map, + :int_arr_map => :int_arr_map, + :pet_arr_map => :pet_arr_map, + :boolean_true_arr => :boolean_true_arr, + :boolean_false_arr => :boolean_false_arr, + } + end + + def self.openapi_types + { + :int_arr => :'Array', + :pet_arr => :'Array', + :int_map => :'Hash', + :pet_map => :'Hash', + :int_arr_map => :'Hash>', + :pet_arr_map => :'Hash>', + :boolean_true_arr => :'Array', + :boolean_false_arr => :'Array', + } + end +end + +describe 'BaseObject' do + describe 'boolean values' do + let(:obj) { Petstore::Cat.new(declawed: false) } + + it 'should have values set' do + expect(obj.declawed).not_to be_nil + expect(obj.declawed).to eq(false) + end + end + + describe 'array and map properties' do + let(:obj) { ArrayMapObject.new } + + let(:data) do + { int_arr: [123, 456], + pet_arr: [{ name: 'Kitty' }], + int_map: { 'int' => 123 }, + pet_map: { 'pet' => { name: 'Kitty' } }, + int_arr_map: { 'int_arr' => [123, 456] }, + pet_arr_map: { 'pet_arr' => [{ name: 'Kitty' }] }, + boolean_true_arr: [true, "true", "TruE", 1, "y", "yes", "1", "t", "T"], + boolean_false_arr: [false, "", 0, "0", "f", nil, "null", "\ntrue\n"], + } + end + + it 'works for #build_from_hash' do + obj.build_from_hash(data) + + expect(obj.int_arr).to match_array([123, 456]) + + expect(obj.pet_arr).to be_instance_of(Array) + expect(obj.pet_arr.size).to eq(1) + + pet = obj.pet_arr.first + expect(pet).to be_instance_of(Petstore::Pet) + expect(pet.name).to eq('Kitty') + + expect(obj.int_map).to be_instance_of(Hash) + expect(obj.int_map).to eq('int' => 123) + + expect(obj.pet_map).to be_instance_of(Hash) + pet = obj.pet_map['pet'] + expect(pet).to be_instance_of(Petstore::Pet) + expect(pet.name).to eq('Kitty') + + expect(obj.int_arr_map).to be_instance_of(Hash) + arr = obj.int_arr_map['int_arr'] + expect(arr).to match_array([123, 456]) + + expect(obj.pet_arr_map).to be_instance_of(Hash) + arr = obj.pet_arr_map['pet_arr'] + expect(arr).to be_instance_of(Array) + expect(arr.size).to eq(1) + pet = arr.first + expect(pet).to be_instance_of(Petstore::Pet) + expect(pet.name).to eq('Kitty') + + expect(obj.boolean_true_arr).to be_instance_of(Array) + obj.boolean_true_arr.each do |b| + expect(b).to eq(true) + end + + expect(obj.boolean_false_arr).to be_instance_of(Array) + obj.boolean_false_arr.each do |b| + expect(b).to eq(false) + end + end + + it 'works for #to_hash' do + obj.build_from_hash(data) + expect_data = data.dup + expect_data[:boolean_true_arr].map! { true } + expect_data[:boolean_false_arr].map! { false } + expect(obj.to_hash).to eq(expect_data) + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/custom/pet_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/custom/pet_spec.rb new file mode 100644 index 00000000000..c56be964a2f --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/custom/pet_spec.rb @@ -0,0 +1,219 @@ +require 'petstore_helper' +require 'spec_helper' +require 'json' + +describe "Pet" do + before do + @pet_api = Petstore::PetApi.new(API_CLIENT) + @pet_id = prepare_pet(@pet_api) + end + + after do + # remove the testing pet + begin + @pet_api.delete_pet(@pet_id) + rescue Petstore::ApiError => e + # ignore ApiError 404 (Not Found) + raise e if e.code != 404 + end + end + + describe "pet methods" do + it "should construct a new pet object" do + tag1 = Petstore::Tag.new('id' => 1, 'name' => 'tag1') + tag2 = Petstore::Tag.new('id' => 2, 'name' => 'tag2') + category1 = Petstore::Category.new(:id => 1, :name => 'category unknown') + # initalize using both string and symbol key + pet_hash = { + :id => @pet_id, + :name => "RUBY UNIT TESTING", + :status => "pending", + :photo_urls => ["url1", "url2"], + :category => category1, + :tags => [tag1, tag2] + } + pet = Petstore::Pet.new(pet_hash) + # test new + expect(pet.name).to eq("RUBY UNIT TESTING") + expect(pet.status).to eq("pending") + expect(pet.id).to eq(@pet_id) + expect(pet.tags[0].id).to eq(1) + expect(pet.tags[1].name).to eq('tag2') + expect(pet.category.name).to eq('category unknown') + + # test build_from_hash + pet2 = Petstore::Pet.new + pet2.build_from_hash(pet.to_hash) + expect(pet.to_hash).to eq(pet2.to_hash) + + # make sure sub-object has different object id + expect(pet.tags[0].object_id).not_to eq(pet2.tags[0].object_id) + expect(pet.tags[1].object_id).not_to eq(pet2.tags[1].object_id) + expect(pet.category.object_id).not_to eq(pet2.category.object_id) + end + + it "should fetch a pet object" do + pet = @pet_api.get_pet_by_id(@pet_id) + expect(pet).to be_a(Petstore::Pet) + expect(pet.id).to eq(@pet_id) + expect(pet.name).to eq("RUBY UNIT TESTING") + expect(pet.tags[0].name).to eq("tag test") + expect(pet.category.name).to eq("category test") + end + + it "should fetch a pet object with http info" do + pet, status_code, headers = @pet_api.get_pet_by_id_with_http_info(@pet_id) + expect(status_code).to eq(200) + expect(headers['Content-Type']).to eq('application/json') + expect(pet).to be_a(Petstore::Pet) + expect(pet.id).to eq(@pet_id) + expect(pet.name).to eq("RUBY UNIT TESTING") + expect(pet.tags[0].name).to eq("tag test") + expect(pet.category.name).to eq("category test") + end + + it "should not find a pet that does not exist" do + begin + @pet_api.get_pet_by_id(-@pet_id) + fail 'it should raise error' + rescue Petstore::ApiError => e + expect(e.code).to eq(404) + # skip the check as the response contains a timestamp that changes on every reponse + #expect(e.message).to eq("Error message: the server returns an error\nHTTP status code: 404\nResponse headers: {\"Date\"=>\"Tue, 26 Feb 2019 04:35:40 GMT\", \"Access-Control-Allow-Origin\"=>\"*\", \"Access-Control-Allow-Methods\"=>\"GET, POST, DELETE, PUT\", \"Access-Control-Allow-Headers\"=>\"Content-Type, api_key, Authorization\", \"Content-Type\"=>\"application/json\", \"Connection\"=>\"close\", \"Server\"=>\"Jetty(9.2.9.v20150224)\"}\nResponse body: {\"code\":1,\"type\":\"error\",\"message\":\"Pet not found\"}") + expect(e.response_body).to eq('{"code":1,"type":"error","message":"Pet not found"}') + expect(e.response_headers).to include('Content-Type') + expect(e.response_headers['Content-Type']).to eq('application/json') + end + end + + # skip the following as original petstore spec does not have endpoints for testing byte array + # we will re-enable this after updating the petstore server + xit "should create and get pet with byte array (binary, string)" do + pet = @pet_api.get_pet_by_id(@pet_id) + pet.id = @pet_id + 1 + str = serialize_json(pet) + @pet_api.add_pet_using_byte_array(body: str) + + fetched_str = @pet_api.pet_pet_idtesting_byte_arraytrue_get(pet.id) + expect(fetched_str).to be_a(String) + fetched = deserialize_json(fetched_str, 'Pet') + expect(fetched).to be_a(Petstore::Pet) + expect(fetched.id).to eq(pet.id) + expect(fetched.category).to be_a(Petstore::Category) + expect(fetched.category.name).to eq(pet.category.name) + + @pet_api.delete_pet(pet.id) + end + + # skip the following as original petstore spec does not have endpoints for testing byte array + # we will re-enable this after updating the petstore server + xit "should get pet in object" do + pet = @pet_api.get_pet_by_id_in_object(@pet_id) + expect(pet).to be_a(Petstore::InlineResponse200) + expect(pet.id).to eq(@pet_id) + expect(pet.name).to eq("RUBY UNIT TESTING") + expect(pet.category).to be_a(Hash) + expect(pet.category[:id]).to eq(20002) + expect(pet.category[:name]).to eq('category test') + end + + it "should update a pet" do + pet = @pet_api.get_pet_by_id(@pet_id) + expect(pet.id).to eq(@pet_id) + expect(pet.name).to eq("RUBY UNIT TESTING") + expect(pet.status).to eq('pending') + + @pet_api.update_pet_with_form(@pet_id, name: 'new name', status: 'sold') + + fetched = @pet_api.get_pet_by_id(@pet_id) + expect(fetched.id).to eq(@pet_id) + expect(fetched.name).to eq("new name") + expect(fetched.status).to eq('sold') + end + + it "should find pets by status" do + pets = @pet_api.find_pets_by_status(['available']) + expect(pets.length).to be >= 3 + pets.each do |pet| + expect(pet).to be_a(Petstore::Pet) + expect(pet.status).to eq('available') + end + end + + it "should not find a pet with invalid status" do + pets = @pet_api.find_pets_by_status(['invalid-status']) + expect(pets.length).to eq(0) + end + + it "should find a pet by status" do + pets = @pet_api.find_pets_by_status(["available", "sold"]) + pets.each do |pet| + if pet.status != 'available' && pet.status != 'sold' + raise "pet status wasn't right" + end + end + end + + it "should create a pet" do + id = @pet_id + 1 + + pet = Petstore::Pet.new('id' => id, 'name' => "RUBY UNIT TESTING") + result = @pet_api.add_pet(pet) + # nothing is returned + expect(result).to be_nil + + pet = @pet_api.get_pet_by_id(id) + expect(pet.id).to eq(id) + expect(pet.name).to eq("RUBY UNIT TESTING") + + @pet_api.delete_pet(id) + end + + it "should upload a file to a pet" do + result = @pet_api.upload_file(@pet_id, file: File.new('hello.txt')) + # ApiResponse is returned + expect(result).to be_a(Petstore::ApiResponse) + end + + it "should upload a file with form parameter to a pet" do + result = @pet_api.upload_file(@pet_id, file: File.new('hello.txt'), additional_metadata: 'metadata') + # ApiResponse is returned + expect(result).to be_a(Petstore::ApiResponse) + end + + it "should implement eql? and hash" do + pet1 = Petstore::Pet.new + pet2 = Petstore::Pet.new + expect(pet1).to eq(pet2) + expect(pet2).to eq(pet1) + expect(pet1.eql?(pet2)).to eq(true) + expect(pet2.eql?(pet1)).to eq(true) + expect(pet1.hash).to eq(pet2.hash) + expect(pet1).to eq(pet1) + expect(pet1.eql?(pet1)).to eq(true) + expect(pet1.hash).to eq(pet1.hash) + + pet1.name = 'really-happy' + pet1.photo_urls = ['http://foo.bar.com/1', 'http://foo.bar.com/2'] + expect(pet1).not_to eq(pet2) + expect(pet2).not_to eq(pet1) + expect(pet1.eql?(pet2)).to eq(false) + expect(pet2.eql?(pet1)).to eq(false) + expect(pet1.hash).not_to eq(pet2.hash) + expect(pet1).to eq(pet1) + expect(pet1.eql?(pet1)).to eq(true) + expect(pet1.hash).to eq(pet1.hash) + + pet2.name = 'really-happy' + pet2.photo_urls = ['http://foo.bar.com/1', 'http://foo.bar.com/2'] + expect(pet1).to eq(pet2) + expect(pet2).to eq(pet1) + expect(pet1.eql?(pet2)).to eq(true) + expect(pet2.eql?(pet1)).to eq(true) + expect(pet1.hash).to eq(pet2.hash) + expect(pet2).to eq(pet2) + expect(pet2.eql?(pet2)).to eq(true) + expect(pet2.hash).to eq(pet2.hash) + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/custom/store_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/custom/store_spec.rb new file mode 100644 index 00000000000..346601e0a41 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/custom/store_spec.rb @@ -0,0 +1,39 @@ +require 'spec_helper' +require 'petstore_helper' + +describe "Store" do + before do + @api = Petstore::StoreApi.new(API_CLIENT) + end + + it "should fetch an order" do + @order_id = prepare_store(@api) + + item = @api.get_order_by_id(@order_id) + expect(item.id).to eq(@order_id) + + @api.delete_order(@order_id) + end + + it "should fetch the inventory" do + result = @api.get_inventory + expect(result).to be_a(Hash) + expect(result).not_to be_empty + result.each do |k, v| + expect(k).to be_a(Symbol) + expect(v).to be_a(Integer) + end + end + + # mark as pending since original petstore does not return object + # will re-enable this after updating the petstore server + xit "should fetch the inventory in object" do + result = @api.get_inventory_in_object + expect(result).to be_a(Hash) + expect(result).not_to be_empty + result.each do |k, v| + expect(k).to be_a(Symbol) + expect(v).to be_a(Integer) + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb new file mode 100644 index 00000000000..a6885692f64 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb @@ -0,0 +1,47 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::AdditionalPropertiesClass +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'AdditionalPropertiesClass' do + before do + # run before each test + @instance = Petstore::AdditionalPropertiesClass.new + end + + after do + # run after each test + end + + describe 'test an instance of AdditionalPropertiesClass' do + it 'should create an instance of AdditionalPropertiesClass' do + expect(@instance).to be_instance_of(Petstore::AdditionalPropertiesClass) + end + end + describe 'test attribute "map_property"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "map_of_map_property"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/animal_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/animal_spec.rb new file mode 100644 index 00000000000..08155ef3949 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/animal_spec.rb @@ -0,0 +1,47 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::Animal +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Animal' do + before do + # run before each test + @instance = Petstore::Animal.new + end + + after do + # run after each test + end + + describe 'test an instance of Animal' do + it 'should create an instance of Animal' do + expect(@instance).to be_instance_of(Petstore::Animal) + end + end + describe 'test attribute "class_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "color"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/api_response_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/api_response_spec.rb new file mode 100644 index 00000000000..991bb81df72 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/api_response_spec.rb @@ -0,0 +1,53 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::ApiResponse +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ApiResponse' do + before do + # run before each test + @instance = Petstore::ApiResponse.new + end + + after do + # run after each test + end + + describe 'test an instance of ApiResponse' do + it 'should create an instance of ApiResponse' do + expect(@instance).to be_instance_of(Petstore::ApiResponse) + end + end + describe 'test attribute "code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "message"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb new file mode 100644 index 00000000000..372539c55cb --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb @@ -0,0 +1,41 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::ArrayOfArrayOfNumberOnly +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ArrayOfArrayOfNumberOnly' do + before do + # run before each test + @instance = Petstore::ArrayOfArrayOfNumberOnly.new + end + + after do + # run after each test + end + + describe 'test an instance of ArrayOfArrayOfNumberOnly' do + it 'should create an instance of ArrayOfArrayOfNumberOnly' do + expect(@instance).to be_instance_of(Petstore::ArrayOfArrayOfNumberOnly) + end + end + describe 'test attribute "array_array_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb new file mode 100644 index 00000000000..759a272f686 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb @@ -0,0 +1,41 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::ArrayOfNumberOnly +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ArrayOfNumberOnly' do + before do + # run before each test + @instance = Petstore::ArrayOfNumberOnly.new + end + + after do + # run after each test + end + + describe 'test an instance of ArrayOfNumberOnly' do + it 'should create an instance of ArrayOfNumberOnly' do + expect(@instance).to be_instance_of(Petstore::ArrayOfNumberOnly) + end + end + describe 'test attribute "array_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_test_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_test_spec.rb new file mode 100644 index 00000000000..c3819c9a9f6 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_test_spec.rb @@ -0,0 +1,53 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::ArrayTest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ArrayTest' do + before do + # run before each test + @instance = Petstore::ArrayTest.new + end + + after do + # run after each test + end + + describe 'test an instance of ArrayTest' do + it 'should create an instance of ArrayTest' do + expect(@instance).to be_instance_of(Petstore::ArrayTest) + end + end + describe 'test attribute "array_of_string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "array_array_of_integer"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "array_array_of_model"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb new file mode 100644 index 00000000000..98059918537 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb @@ -0,0 +1,71 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::Capitalization +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Capitalization' do + before do + # run before each test + @instance = Petstore::Capitalization.new + end + + after do + # run after each test + end + + describe 'test an instance of Capitalization' do + it 'should create an instance of Capitalization' do + expect(@instance).to be_instance_of(Petstore::Capitalization) + end + end + describe 'test attribute "small_camel"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "capital_camel"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "small_snake"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "capital_snake"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "sca_eth_flow_points"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "att_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb new file mode 100644 index 00000000000..49859a0524f --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb @@ -0,0 +1,41 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::CatAllOf +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'CatAllOf' do + before do + # run before each test + @instance = Petstore::CatAllOf.new + end + + after do + # run after each test + end + + describe 'test an instance of CatAllOf' do + it 'should create an instance of CatAllOf' do + expect(@instance).to be_instance_of(Petstore::CatAllOf) + end + end + describe 'test attribute "declawed"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_spec.rb new file mode 100644 index 00000000000..0ee7d2a7f68 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_spec.rb @@ -0,0 +1,41 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::Cat +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Cat' do + before do + # run before each test + @instance = Petstore::Cat.new + end + + after do + # run after each test + end + + describe 'test an instance of Cat' do + it 'should create an instance of Cat' do + expect(@instance).to be_instance_of(Petstore::Cat) + end + end + describe 'test attribute "declawed"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/category_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/category_spec.rb new file mode 100644 index 00000000000..1f9f8897fde --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/category_spec.rb @@ -0,0 +1,47 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::Category +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Category' do + before do + # run before each test + @instance = Petstore::Category.new + end + + after do + # run after each test + end + + describe 'test an instance of Category' do + it 'should create an instance of Category' do + expect(@instance).to be_instance_of(Petstore::Category) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/class_model_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/class_model_spec.rb new file mode 100644 index 00000000000..589f3d1f121 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/class_model_spec.rb @@ -0,0 +1,41 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::ClassModel +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ClassModel' do + before do + # run before each test + @instance = Petstore::ClassModel.new + end + + after do + # run after each test + end + + describe 'test an instance of ClassModel' do + it 'should create an instance of ClassModel' do + expect(@instance).to be_instance_of(Petstore::ClassModel) + end + end + describe 'test attribute "_class"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/client_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/client_spec.rb new file mode 100644 index 00000000000..b246962e2ba --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/client_spec.rb @@ -0,0 +1,41 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::Client +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Client' do + before do + # run before each test + @instance = Petstore::Client.new + end + + after do + # run after each test + end + + describe 'test an instance of Client' do + it 'should create an instance of Client' do + expect(@instance).to be_instance_of(Petstore::Client) + end + end + describe 'test attribute "client"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb new file mode 100644 index 00000000000..6cba24ecd94 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb @@ -0,0 +1,41 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::DogAllOf +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'DogAllOf' do + before do + # run before each test + @instance = Petstore::DogAllOf.new + end + + after do + # run after each test + end + + describe 'test an instance of DogAllOf' do + it 'should create an instance of DogAllOf' do + expect(@instance).to be_instance_of(Petstore::DogAllOf) + end + end + describe 'test attribute "breed"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_spec.rb new file mode 100644 index 00000000000..d13a6864497 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_spec.rb @@ -0,0 +1,41 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::Dog +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Dog' do + before do + # run before each test + @instance = Petstore::Dog.new + end + + after do + # run after each test + end + + describe 'test an instance of Dog' do + it 'should create an instance of Dog' do + expect(@instance).to be_instance_of(Petstore::Dog) + end + end + describe 'test attribute "breed"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb new file mode 100644 index 00000000000..993d8f3a3ee --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb @@ -0,0 +1,55 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::EnumArrays +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EnumArrays' do + before do + # run before each test + @instance = Petstore::EnumArrays.new + end + + after do + # run after each test + end + + describe 'test an instance of EnumArrays' do + it 'should create an instance of EnumArrays' do + expect(@instance).to be_instance_of(Petstore::EnumArrays) + end + end + describe 'test attribute "just_symbol"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', [">=", "$"]) + # validator.allowable_values.each do |value| + # expect { @instance.just_symbol = value }.not_to raise_error + # end + end + end + + describe 'test attribute "array_enum"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array', ["fish", "crab"]) + # validator.allowable_values.each do |value| + # expect { @instance.array_enum = value }.not_to raise_error + # end + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb new file mode 100644 index 00000000000..50c56e53df8 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb @@ -0,0 +1,35 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::EnumClass +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EnumClass' do + before do + # run before each test + @instance = Petstore::EnumClass.new + end + + after do + # run after each test + end + + describe 'test an instance of EnumClass' do + it 'should create an instance of EnumClass' do + expect(@instance).to be_instance_of(Petstore::EnumClass) + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb new file mode 100644 index 00000000000..903b7f9c9ef --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb @@ -0,0 +1,99 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::EnumTest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'EnumTest' do + before do + # run before each test + @instance = Petstore::EnumTest.new + end + + after do + # run after each test + end + + describe 'test an instance of EnumTest' do + it 'should create an instance of EnumTest' do + expect(@instance).to be_instance_of(Petstore::EnumTest) + end + end + describe 'test attribute "enum_string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) + # validator.allowable_values.each do |value| + # expect { @instance.enum_string = value }.not_to raise_error + # end + end + end + + describe 'test attribute "enum_string_required"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["UPPER", "lower", ""]) + # validator.allowable_values.each do |value| + # expect { @instance.enum_string_required = value }.not_to raise_error + # end + end + end + + describe 'test attribute "enum_integer"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('Integer', [1, -1]) + # validator.allowable_values.each do |value| + # expect { @instance.enum_integer = value }.not_to raise_error + # end + end + end + + describe 'test attribute "enum_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('Float', [1.1, -1.2]) + # validator.allowable_values.each do |value| + # expect { @instance.enum_number = value }.not_to raise_error + # end + end + end + + describe 'test attribute "outer_enum"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "outer_enum_integer"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "outer_enum_default_value"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "outer_enum_integer_default_value"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb new file mode 100644 index 00000000000..c59870f674f --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb @@ -0,0 +1,47 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::FileSchemaTestClass +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'FileSchemaTestClass' do + before do + # run before each test + @instance = Petstore::FileSchemaTestClass.new + end + + after do + # run after each test + end + + describe 'test an instance of FileSchemaTestClass' do + it 'should create an instance of FileSchemaTestClass' do + expect(@instance).to be_instance_of(Petstore::FileSchemaTestClass) + end + end + describe 'test attribute "file"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "files"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_spec.rb new file mode 100644 index 00000000000..38513a9593e --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_spec.rb @@ -0,0 +1,41 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::File +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'File' do + before do + # run before each test + @instance = Petstore::File.new + end + + after do + # run after each test + end + + describe 'test an instance of File' do + it 'should create an instance of File' do + expect(@instance).to be_instance_of(Petstore::File) + end + end + describe 'test attribute "source_uri"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/foo_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/foo_spec.rb new file mode 100644 index 00000000000..829f18ac0d9 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/foo_spec.rb @@ -0,0 +1,41 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::Foo +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Foo' do + before do + # run before each test + @instance = Petstore::Foo.new + end + + after do + # run after each test + end + + describe 'test an instance of Foo' do + it 'should create an instance of Foo' do + expect(@instance).to be_instance_of(Petstore::Foo) + end + end + describe 'test attribute "bar"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/format_test_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/format_test_spec.rb new file mode 100644 index 00000000000..3b015816707 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/format_test_spec.rb @@ -0,0 +1,125 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::FormatTest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'FormatTest' do + before do + # run before each test + @instance = Petstore::FormatTest.new + end + + after do + # run after each test + end + + describe 'test an instance of FormatTest' do + it 'should create an instance of FormatTest' do + expect(@instance).to be_instance_of(Petstore::FormatTest) + end + end + describe 'test attribute "integer"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "int32"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "int64"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "float"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "double"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "byte"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "binary"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "date_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "uuid"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "password"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pattern_with_digits"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pattern_with_digits_and_delimiter"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb new file mode 100644 index 00000000000..f1e7908be13 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb @@ -0,0 +1,47 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::HasOnlyReadOnly +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'HasOnlyReadOnly' do + before do + # run before each test + @instance = Petstore::HasOnlyReadOnly.new + end + + after do + # run after each test + end + + describe 'test an instance of HasOnlyReadOnly' do + it 'should create an instance of HasOnlyReadOnly' do + expect(@instance).to be_instance_of(Petstore::HasOnlyReadOnly) + end + end + describe 'test attribute "bar"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "foo"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/health_check_result_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/health_check_result_spec.rb new file mode 100644 index 00000000000..d94dfae3e1a --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/health_check_result_spec.rb @@ -0,0 +1,41 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::HealthCheckResult +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'HealthCheckResult' do + before do + # run before each test + @instance = Petstore::HealthCheckResult.new + end + + after do + # run after each test + end + + describe 'test an instance of HealthCheckResult' do + it 'should create an instance of HealthCheckResult' do + expect(@instance).to be_instance_of(Petstore::HealthCheckResult) + end + end + describe 'test attribute "nullable_message"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object1_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object1_spec.rb new file mode 100644 index 00000000000..40d5f80b322 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object1_spec.rb @@ -0,0 +1,47 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::InlineObject1 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'InlineObject1' do + before do + # run before each test + @instance = Petstore::InlineObject1.new + end + + after do + # run after each test + end + + describe 'test an instance of InlineObject1' do + it 'should create an instance of InlineObject1' do + expect(@instance).to be_instance_of(Petstore::InlineObject1) + end + end + describe 'test attribute "additional_metadata"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "file"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object2_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object2_spec.rb new file mode 100644 index 00000000000..d9ee4e8d6bd --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object2_spec.rb @@ -0,0 +1,55 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::InlineObject2 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'InlineObject2' do + before do + # run before each test + @instance = Petstore::InlineObject2.new + end + + after do + # run after each test + end + + describe 'test an instance of InlineObject2' do + it 'should create an instance of InlineObject2' do + expect(@instance).to be_instance_of(Petstore::InlineObject2) + end + end + describe 'test attribute "enum_form_string_array"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array', [">", "$"]) + # validator.allowable_values.each do |value| + # expect { @instance.enum_form_string_array = value }.not_to raise_error + # end + end + end + + describe 'test attribute "enum_form_string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["_abc", "-efg", "(xyz)"]) + # validator.allowable_values.each do |value| + # expect { @instance.enum_form_string = value }.not_to raise_error + # end + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object3_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object3_spec.rb new file mode 100644 index 00000000000..2fb2d0acd0a --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object3_spec.rb @@ -0,0 +1,119 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::InlineObject3 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'InlineObject3' do + before do + # run before each test + @instance = Petstore::InlineObject3.new + end + + after do + # run after each test + end + + describe 'test an instance of InlineObject3' do + it 'should create an instance of InlineObject3' do + expect(@instance).to be_instance_of(Petstore::InlineObject3) + end + end + describe 'test attribute "integer"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "int32"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "int64"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "float"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "double"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pattern_without_delimiter"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "byte"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "binary"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "date_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "password"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "callback"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object4_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object4_spec.rb new file mode 100644 index 00000000000..467108f38b7 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object4_spec.rb @@ -0,0 +1,47 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::InlineObject4 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'InlineObject4' do + before do + # run before each test + @instance = Petstore::InlineObject4.new + end + + after do + # run after each test + end + + describe 'test an instance of InlineObject4' do + it 'should create an instance of InlineObject4' do + expect(@instance).to be_instance_of(Petstore::InlineObject4) + end + end + describe 'test attribute "param"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "param2"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object5_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object5_spec.rb new file mode 100644 index 00000000000..76b646c1949 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object5_spec.rb @@ -0,0 +1,47 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::InlineObject5 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'InlineObject5' do + before do + # run before each test + @instance = Petstore::InlineObject5.new + end + + after do + # run after each test + end + + describe 'test an instance of InlineObject5' do + it 'should create an instance of InlineObject5' do + expect(@instance).to be_instance_of(Petstore::InlineObject5) + end + end + describe 'test attribute "additional_metadata"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "required_file"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object_spec.rb new file mode 100644 index 00000000000..ccb47629bd3 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object_spec.rb @@ -0,0 +1,47 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::InlineObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'InlineObject' do + before do + # run before each test + @instance = Petstore::InlineObject.new + end + + after do + # run after each test + end + + describe 'test an instance of InlineObject' do + it 'should create an instance of InlineObject' do + expect(@instance).to be_instance_of(Petstore::InlineObject) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_response_default_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_response_default_spec.rb new file mode 100644 index 00000000000..859051fae22 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_response_default_spec.rb @@ -0,0 +1,41 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::InlineResponseDefault +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'InlineResponseDefault' do + before do + # run before each test + @instance = Petstore::InlineResponseDefault.new + end + + after do + # run after each test + end + + describe 'test an instance of InlineResponseDefault' do + it 'should create an instance of InlineResponseDefault' do + expect(@instance).to be_instance_of(Petstore::InlineResponseDefault) + end + end + describe 'test attribute "string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/list_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/list_spec.rb new file mode 100644 index 00000000000..305f503079d --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/list_spec.rb @@ -0,0 +1,41 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::List +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'List' do + before do + # run before each test + @instance = Petstore::List.new + end + + after do + # run after each test + end + + describe 'test an instance of List' do + it 'should create an instance of List' do + expect(@instance).to be_instance_of(Petstore::List) + end + end + describe 'test attribute "_123_list"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/map_test_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/map_test_spec.rb new file mode 100644 index 00000000000..6be8c3aff53 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/map_test_spec.rb @@ -0,0 +1,63 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::MapTest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'MapTest' do + before do + # run before each test + @instance = Petstore::MapTest.new + end + + after do + # run after each test + end + + describe 'test an instance of MapTest' do + it 'should create an instance of MapTest' do + expect(@instance).to be_instance_of(Petstore::MapTest) + end + end + describe 'test attribute "map_map_of_string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "map_of_enum_string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('Hash', ["UPPER", "lower"]) + # validator.allowable_values.each do |value| + # expect { @instance.map_of_enum_string = value }.not_to raise_error + # end + end + end + + describe 'test attribute "direct_map"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "indirect_map"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb new file mode 100644 index 00000000000..d9070acf516 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb @@ -0,0 +1,53 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::MixedPropertiesAndAdditionalPropertiesClass +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'MixedPropertiesAndAdditionalPropertiesClass' do + before do + # run before each test + @instance = Petstore::MixedPropertiesAndAdditionalPropertiesClass.new + end + + after do + # run after each test + end + + describe 'test an instance of MixedPropertiesAndAdditionalPropertiesClass' do + it 'should create an instance of MixedPropertiesAndAdditionalPropertiesClass' do + expect(@instance).to be_instance_of(Petstore::MixedPropertiesAndAdditionalPropertiesClass) + end + end + describe 'test attribute "uuid"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "date_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "map"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb new file mode 100644 index 00000000000..6502d960cb8 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb @@ -0,0 +1,47 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::Model200Response +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Model200Response' do + before do + # run before each test + @instance = Petstore::Model200Response.new + end + + after do + # run after each test + end + + describe 'test an instance of Model200Response' do + it 'should create an instance of Model200Response' do + expect(@instance).to be_instance_of(Petstore::Model200Response) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "_class"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/model_return_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/model_return_spec.rb new file mode 100644 index 00000000000..e4fc442810c --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/model_return_spec.rb @@ -0,0 +1,41 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::ModelReturn +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ModelReturn' do + before do + # run before each test + @instance = Petstore::ModelReturn.new + end + + after do + # run after each test + end + + describe 'test an instance of ModelReturn' do + it 'should create an instance of ModelReturn' do + expect(@instance).to be_instance_of(Petstore::ModelReturn) + end + end + describe 'test attribute "_return"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/name_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/name_spec.rb new file mode 100644 index 00000000000..362d499d125 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/name_spec.rb @@ -0,0 +1,59 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::Name +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Name' do + before do + # run before each test + @instance = Petstore::Name.new + end + + after do + # run after each test + end + + describe 'test an instance of Name' do + it 'should create an instance of Name' do + expect(@instance).to be_instance_of(Petstore::Name) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "snake_case"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "property"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "_123_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/nullable_class_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/nullable_class_spec.rb new file mode 100644 index 00000000000..b7a8c99c1b5 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/nullable_class_spec.rb @@ -0,0 +1,107 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::NullableClass +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'NullableClass' do + before do + # run before each test + @instance = Petstore::NullableClass.new + end + + after do + # run after each test + end + + describe 'test an instance of NullableClass' do + it 'should create an instance of NullableClass' do + expect(@instance).to be_instance_of(Petstore::NullableClass) + end + end + describe 'test attribute "integer_prop"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "number_prop"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "boolean_prop"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "string_prop"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "date_prop"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "datetime_prop"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "array_nullable_prop"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "array_and_items_nullable_prop"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "array_items_nullable"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "object_nullable_prop"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "object_and_items_nullable_prop"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "object_items_nullable"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/number_only_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/number_only_spec.rb new file mode 100644 index 00000000000..440a2d377d7 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/number_only_spec.rb @@ -0,0 +1,41 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::NumberOnly +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'NumberOnly' do + before do + # run before each test + @instance = Petstore::NumberOnly.new + end + + after do + # run after each test + end + + describe 'test an instance of NumberOnly' do + it 'should create an instance of NumberOnly' do + expect(@instance).to be_instance_of(Petstore::NumberOnly) + end + end + describe 'test attribute "just_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/order_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/order_spec.rb new file mode 100644 index 00000000000..45788b835ab --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/order_spec.rb @@ -0,0 +1,75 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::Order +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Order' do + before do + # run before each test + @instance = Petstore::Order.new + end + + after do + # run after each test + end + + describe 'test an instance of Order' do + it 'should create an instance of Order' do + expect(@instance).to be_instance_of(Petstore::Order) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pet_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "quantity"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "ship_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["placed", "approved", "delivered"]) + # validator.allowable_values.each do |value| + # expect { @instance.status = value }.not_to raise_error + # end + end + end + + describe 'test attribute "complete"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb new file mode 100644 index 00000000000..a7c25a114cc --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb @@ -0,0 +1,53 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::OuterComposite +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'OuterComposite' do + before do + # run before each test + @instance = Petstore::OuterComposite.new + end + + after do + # run after each test + end + + describe 'test an instance of OuterComposite' do + it 'should create an instance of OuterComposite' do + expect(@instance).to be_instance_of(Petstore::OuterComposite) + end + end + describe 'test attribute "my_number"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "my_string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "my_boolean"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_default_value_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_default_value_spec.rb new file mode 100644 index 00000000000..80c852db9fb --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_default_value_spec.rb @@ -0,0 +1,35 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::OuterEnumDefaultValue +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'OuterEnumDefaultValue' do + before do + # run before each test + @instance = Petstore::OuterEnumDefaultValue.new + end + + after do + # run after each test + end + + describe 'test an instance of OuterEnumDefaultValue' do + it 'should create an instance of OuterEnumDefaultValue' do + expect(@instance).to be_instance_of(Petstore::OuterEnumDefaultValue) + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_default_value_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_default_value_spec.rb new file mode 100644 index 00000000000..0be262b5dfc --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_default_value_spec.rb @@ -0,0 +1,35 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::OuterEnumIntegerDefaultValue +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'OuterEnumIntegerDefaultValue' do + before do + # run before each test + @instance = Petstore::OuterEnumIntegerDefaultValue.new + end + + after do + # run after each test + end + + describe 'test an instance of OuterEnumIntegerDefaultValue' do + it 'should create an instance of OuterEnumIntegerDefaultValue' do + expect(@instance).to be_instance_of(Petstore::OuterEnumIntegerDefaultValue) + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_spec.rb new file mode 100644 index 00000000000..9696979e03c --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_spec.rb @@ -0,0 +1,35 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::OuterEnumInteger +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'OuterEnumInteger' do + before do + # run before each test + @instance = Petstore::OuterEnumInteger.new + end + + after do + # run after each test + end + + describe 'test an instance of OuterEnumInteger' do + it 'should create an instance of OuterEnumInteger' do + expect(@instance).to be_instance_of(Petstore::OuterEnumInteger) + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb new file mode 100644 index 00000000000..f6de5c89911 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb @@ -0,0 +1,35 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::OuterEnum +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'OuterEnum' do + before do + # run before each test + @instance = Petstore::OuterEnum.new + end + + after do + # run after each test + end + + describe 'test an instance of OuterEnum' do + it 'should create an instance of OuterEnum' do + expect(@instance).to be_instance_of(Petstore::OuterEnum) + end + end +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/pet_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/pet_spec.rb new file mode 100644 index 00000000000..b0c7076815b --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/pet_spec.rb @@ -0,0 +1,75 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::Pet +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Pet' do + before do + # run before each test + @instance = Petstore::Pet.new + end + + after do + # run after each test + end + + describe 'test an instance of Pet' do + it 'should create an instance of Pet' do + expect(@instance).to be_instance_of(Petstore::Pet) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "category"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "photo_urls"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tags"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["available", "pending", "sold"]) + # validator.allowable_values.each do |value| + # expect { @instance.status = value }.not_to raise_error + # end + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb new file mode 100644 index 00000000000..d8a42302760 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb @@ -0,0 +1,47 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::ReadOnlyFirst +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ReadOnlyFirst' do + before do + # run before each test + @instance = Petstore::ReadOnlyFirst.new + end + + after do + # run after each test + end + + describe 'test an instance of ReadOnlyFirst' do + it 'should create an instance of ReadOnlyFirst' do + expect(@instance).to be_instance_of(Petstore::ReadOnlyFirst) + end + end + describe 'test attribute "bar"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "baz"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb new file mode 100644 index 00000000000..43eb2ec61ec --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb @@ -0,0 +1,41 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::SpecialModelName +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'SpecialModelName' do + before do + # run before each test + @instance = Petstore::SpecialModelName.new + end + + after do + # run after each test + end + + describe 'test an instance of SpecialModelName' do + it 'should create an instance of SpecialModelName' do + expect(@instance).to be_instance_of(Petstore::SpecialModelName) + end + end + describe 'test attribute "special_property_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/tag_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/tag_spec.rb new file mode 100644 index 00000000000..abb8380ff3a --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/tag_spec.rb @@ -0,0 +1,47 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::Tag +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Tag' do + before do + # run before each test + @instance = Petstore::Tag.new + end + + after do + # run after each test + end + + describe 'test an instance of Tag' do + it 'should create an instance of Tag' do + expect(@instance).to be_instance_of(Petstore::Tag) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/user_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/user_spec.rb new file mode 100644 index 00000000000..d313a360bbb --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/user_spec.rb @@ -0,0 +1,83 @@ +=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.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Petstore::User +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'User' do + before do + # run before each test + @instance = Petstore::User.new + end + + after do + # run after each test + end + + describe 'test an instance of User' do + it 'should create an instance of User' do + expect(@instance).to be_instance_of(Petstore::User) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "username"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "first_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "last_name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "email"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "password"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "phone"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "user_status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/petstore_helper.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/petstore_helper.rb new file mode 100644 index 00000000000..96b0711cec5 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/petstore_helper.rb @@ -0,0 +1,52 @@ +# load the gem +require 'petstore' + +# API client (shared between all the test cases) +API_CLIENT = Petstore::ApiClient.new(Petstore::Configuration.new) + +# randomly generate an ID +def random_id + rand(1000000) + 20000 +end + +# create a random pet, return its id +def prepare_pet(pet_api) + pet_id = random_id + category = Petstore::Category.new('id' => 20002, 'name' => 'category test') + tag = Petstore::Tag.new('id' => 30002, 'name' => 'tag test') + pet = Petstore::Pet.new('id' => pet_id, 'name' => "RUBY UNIT TESTING", 'photo_urls' => 'photo url', + 'category' => category, 'tags' => [tag], 'status' => 'pending') + pet_api.add_pet(pet) + pet_id +end + +# create a random order, return its id +def prepare_store(store_api) + order_id = 5 + order = Petstore::Order.new("id" => order_id, + "pet_id" => 123, + "quantity" => 789, + "ship_date" => "2015-04-06T23:42:01.678Z", + "status" => "placed", + "complete" => false) + store_api.place_order(order) + order_id +end + +# A random string to tack onto stuff to ensure we're not seeing +# data from a previous test run +RAND = ("a".."z").to_a.sample(8).join + +# helper method to serialize object to json string +def serialize_json(o) + API_CLIENT.object_to_http_body(o) +end + +# helper method to deserialize json string back to object +def deserialize_json(s, type) + headers = { 'Content-Type' => 'application/json' } + response = double('response', headers: headers, body: s) + API_CLIENT.deserialize(response, type) +end + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/spec_helper.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/spec_helper.rb new file mode 100644 index 00000000000..dc8611b437d --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/spec_helper.rb @@ -0,0 +1,111 @@ +=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.0-SNAPSHOT + +=end + +# load the gem +require 'petstore' + +# The following was generated by the `rspec --init` command. Conventionally, all +# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. +# The generated `.rspec` file contains `--require spec_helper` which will cause +# this file to always be loaded, without a need to explicitly require it in any +# files. +# +# Given that it is always loaded, you are encouraged to keep this file as +# light-weight as possible. Requiring heavyweight dependencies from this file +# will add to the boot time of your test suite on EVERY test run, even for an +# individual file that may not need all of that loaded. Instead, consider making +# a separate helper file that requires the additional dependencies and performs +# the additional setup, and require it from the spec files that actually need +# it. +# +# The `.rspec` file also contains a few flags that are not defaults but that +# users commonly want. +# +# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration +RSpec.configure do |config| + # rspec-expectations config goes here. You can use an alternate + # assertion/expectation library such as wrong or the stdlib/minitest + # assertions if you prefer. + config.expect_with :rspec do |expectations| + # This option will default to `true` in RSpec 4. It makes the `description` + # and `failure_message` of custom matchers include text for helper methods + # defined using `chain`, e.g.: + # be_bigger_than(2).and_smaller_than(4).description + # # => "be bigger than 2 and smaller than 4" + # ...rather than: + # # => "be bigger than 2" + expectations.include_chain_clauses_in_custom_matcher_descriptions = true + end + + # rspec-mocks config goes here. You can use an alternate test double + # library (such as bogus or mocha) by changing the `mock_with` option here. + config.mock_with :rspec do |mocks| + # Prevents you from mocking or stubbing a method that does not exist on + # a real object. This is generally recommended, and will default to + # `true` in RSpec 4. + mocks.verify_partial_doubles = true + end + +# The settings below are suggested to provide a good initial experience +# with RSpec, but feel free to customize to your heart's content. +=begin + # These two settings work together to allow you to limit a spec run + # to individual examples or groups you care about by tagging them with + # `:focus` metadata. When nothing is tagged with `:focus`, all examples + # get run. + config.filter_run :focus + config.run_all_when_everything_filtered = true + + # Allows RSpec to persist some state between runs in order to support + # the `--only-failures` and `--next-failure` CLI options. We recommend + # you configure your source control system to ignore this file. + config.example_status_persistence_file_path = "spec/examples.txt" + + # Limits the available syntax to the non-monkey patched syntax that is + # recommended. For more details, see: + # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ + # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ + # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode + config.disable_monkey_patching! + + # This setting enables warnings. It's recommended, but in some cases may + # be too noisy due to issues in dependencies. + config.warnings = true + + # Many RSpec users commonly either run the entire suite or an individual + # file, and it's useful to allow more verbose output when running an + # individual spec file. + if config.files_to_run.one? + # Use the documentation formatter for detailed output, + # unless a formatter has already been configured + # (e.g. via a command-line flag). + config.default_formatter = 'doc' + end + + # Print the 10 slowest examples and example groups at the + # end of the spec run, to help surface which specs are running + # particularly slow. + config.profile_examples = 10 + + # Run specs in random order to surface order dependencies. If you find an + # order dependency and want to debug it, you can fix the order by providing + # the seed, which is printed after each run. + # --seed 1234 + config.order = :random + + # Seed global randomization in this process using the `--seed` CLI option. + # Setting this allows you to use `--seed` to deterministically reproduce + # test failures related to randomization by passing the same `--seed` value + # as the one that triggered the failure. + Kernel.srand config.seed +=end +end diff --git a/samples/openapi3/client/petstore/ruby/spec/custom/store_spec.rb b/samples/openapi3/client/petstore/ruby/spec/custom/store_spec.rb index a45f414544f..346601e0a41 100644 --- a/samples/openapi3/client/petstore/ruby/spec/custom/store_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/custom/store_spec.rb @@ -1,4 +1,5 @@ require 'spec_helper' +require 'petstore_helper' describe "Store" do before do From dff3386594b25c5069664e2509d523cc8f416035 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 2 Aug 2019 09:44:42 +0800 Subject: [PATCH 34/75] Remove Gitter badge --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 599b0d4f234..3daf269384c 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,6 @@
-[![Join the chat at https://gitter.im/OpenAPITools/openapi-generator](https://badges.gitter.im/OpenAPITools/openapi-generator.svg)](https://gitter.im/OpenAPITools/openapi-generator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Stable releaases in the Maven store](https://img.shields.io/maven-metadata/v/http/central.maven.org/maven2/org/openapitools/openapi-generator/maven-metadata.xml.svg)](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.openapitools%22%20AND%20a%3A%22openapi-generator%22) [![Follow OpenAPI Generator Twitter account to get the latest update](https://img.shields.io/twitter/follow/oas_generator.svg?style=social&label=Follow)](https://twitter.com/oas_generator) From 4c1133be3f36c9782c362c663f00c461dfb00386 Mon Sep 17 00:00:00 2001 From: Dennis Kliban Date: Fri, 2 Aug 2019 00:20:16 -0400 Subject: [PATCH 35/75] Problem: faraday ruby client does not respect TLS settings (#3527) Solution: pass in tls settings to the faraday client --- .../codegen/languages/RubyClientCodegen.java | 3 +- .../ruby-client/faraday_api_client.mustache | 20 +- .../faraday_configuration.mustache | 300 ++++++++++++++++++ 3 files changed, 313 insertions(+), 10 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/ruby-client/faraday_configuration.mustache diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java index 8395c045944..2f2af730e38 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java @@ -236,10 +236,11 @@ public class RubyClientCodegen extends AbstractRubyCodegen { if (TYPHOEUS.equals(getLibrary())) { supportingFiles.add(new SupportingFile("api_client.mustache", gemFolder, "api_client.rb")); + supportingFiles.add(new SupportingFile("configuration.mustache", gemFolder, "configuration.rb")); supportingFiles.add(new SupportingFile("Gemfile.lock.mustache", "", "Gemfile.lock")); } else if (FARADAY.equals(getLibrary())) { supportingFiles.add(new SupportingFile("faraday_api_client.mustache", gemFolder, "api_client.rb")); - additionalProperties.put("isFaraday", Boolean.TRUE); + supportingFiles.add(new SupportingFile("faraday_configuration.mustache", gemFolder, "configuration.rb")); } else { throw new RuntimeException("Invalid HTTP library " + getLibrary() + ". Only faraday, typhoeus are supported."); } diff --git a/modules/openapi-generator/src/main/resources/ruby-client/faraday_api_client.mustache b/modules/openapi-generator/src/main/resources/ruby-client/faraday_api_client.mustache index 58b36c179d4..f628ffecf07 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/faraday_api_client.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/faraday_api_client.mustache @@ -38,7 +38,15 @@ module {{moduleName}} # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: # the data deserialized from response body (could be nil), response status code and response headers. def call_api(http_method, path, opts = {}) - connection = Faraday.new(:url => config.base_url) do |conn| + ssl_options = { + :ca_file => @config.ssl_ca_file, + :verify => @config.ssl_verify, + :verify => @config.ssl_verify_mode, + :client_cert => @config.ssl_client_cert, + :client_key => @config.ssl_client_key + } + + connection = Faraday.new(:url => config.base_url, :ssl => ssl_options) do |conn| conn.basic_auth(config.username, config.password) if opts[:header_params]["Content-Type"] == "multipart/form-data" conn.request :multipart @@ -46,6 +54,7 @@ module {{moduleName}} end conn.adapter(Faraday.default_adapter) end + begin response = connection.public_send(http_method.to_sym.downcase) do |req| build_request(http_method, path, req, opts) @@ -98,8 +107,7 @@ module {{moduleName}} update_params_for_auth! header_params, query_params, opts[:auth_names] - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 + req_opts = { :method => http_method, @@ -107,15 +115,9 @@ module {{moduleName}} :params => query_params, :params_encoding => @config.params_encoding, :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, :verbose => @config.debugging } - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert if [:post, :patch, :put, :delete].include?(http_method) req_body = build_request_body(header_params, form_params, opts[:body]) diff --git a/modules/openapi-generator/src/main/resources/ruby-client/faraday_configuration.mustache b/modules/openapi-generator/src/main/resources/ruby-client/faraday_configuration.mustache new file mode 100644 index 00000000000..67aaaf4f00f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/ruby-client/faraday_configuration.mustache @@ -0,0 +1,300 @@ +=begin +{{> api_info}} +=end + +module {{moduleName}} + class Configuration + # Defines url scheme + attr_accessor :scheme + + # Defines url host + attr_accessor :host + + # Defines url base path + attr_accessor :base_path + + # Defines API keys used with API Key authentications. + # + # @return [Hash] key: parameter name, value: parameter value (API key) + # + # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) + # config.api_key['api_key'] = 'xxx' + attr_accessor :api_key + + # Defines API key prefixes used with API Key authentications. + # + # @return [Hash] key: parameter name, value: API key prefix + # + # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) + # config.api_key_prefix['api_key'] = 'Token' + attr_accessor :api_key_prefix + + # Defines the username used with HTTP basic authentication. + # + # @return [String] + attr_accessor :username + + # Defines the password used with HTTP basic authentication. + # + # @return [String] + attr_accessor :password + + # Defines the access token (Bearer) used with OAuth2. + attr_accessor :access_token + + # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response + # details will be logged with `logger.debug` (see the `logger` attribute). + # Default to false. + # + # @return [true, false] + attr_accessor :debugging + + # Defines the logger used for debugging. + # Default to `Rails.logger` (when in Rails) or logging to STDOUT. + # + # @return [#debug] + attr_accessor :logger + + # Defines the temporary folder to store downloaded files + # (for API endpoints that have file response). + # Default to use `Tempfile`. + # + # @return [String] + attr_accessor :temp_folder_path + + # The time limit for HTTP request in seconds. + # Default to 0 (never times out). + attr_accessor :timeout + + # Set this to false to skip client side validation in the operation. + # Default to true. + # @return [true, false] + attr_accessor :client_side_validation + + # Set this to false to skip client side validation in the operation. + # Default to true. + # @return [true, false] + attr_accessor :client_side_validation + + ### TLS/SSL setting + # Set this to false to skip verifying SSL certificate when calling API from https server. + # Default to true. + # + # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. + # + # @return [true, false] + attr_accessor :ssl_verify + + ### TLS/SSL setting + # Any `OpenSSL::SSL::` constant (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html) + # + # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. + # + attr_accessor :ssl_verify_mode + + ### TLS/SSL setting + # Set this to customize the certificate file to verify the peer. + # + # @return [String] the path to the certificate file + attr_accessor :ssl_ca_file + + ### TLS/SSL setting + # Client certificate file (for client certificate) + attr_accessor :ssl_client_cert + + ### TLS/SSL setting + # Client private key file (for client certificate) + attr_accessor :ssl_client_key + + # Set this to customize parameters encoding of array parameter with multi collectionFormat. + # Default to nil. + # + # @see The params_encoding option of Ethon. Related source code: + # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 + attr_accessor :params_encoding + + attr_accessor :inject_format + + attr_accessor :force_ending_format + + def initialize + @scheme = 'http' + @host = 'localhost' + @base_path = '' + @api_key = {} + @api_key_prefix = {} + @params_encoding = nil + @timeout = 0 + @client_side_validation = true + @ssl_verify = true + @ssl_verify_mode = nil + @ssl_ca_file = nil + @ssl_client_cert = nil + @ssl_client_key = nil + @debugging = false + @inject_format = false + @force_ending_format = false + @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) + + yield(self) if block_given? + end + + # The default Configuration object. + def self.default + @@default ||= Configuration.new + end + + def configure + yield(self) if block_given? + end + + def scheme=(scheme) + # remove :// from scheme + @scheme = scheme.sub(/:\/\//, '') + end + + def host=(host) + # remove http(s):// and anything after a slash + @host = host.sub(/https?:\/\//, '').split('/').first + end + + def base_path=(base_path) + # Add leading and trailing slashes to base_path + @base_path = "/#{base_path}".gsub(/\/+/, '/') + @base_path = '' if @base_path == '/' + end + + def base_url + "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') + end + + # Gets API key (with prefix if set). + # @param [String] param_name the parameter name of API key auth + def api_key_with_prefix(param_name) + if @api_key_prefix[param_name] + "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" + else + @api_key[param_name] + end + end + + # Gets Basic Auth token string + def basic_auth_token + 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") + end + + # Returns Auth Settings hash for api client. + def auth_settings + { +{{#authMethods}} +{{#isApiKey}} + '{{name}}' => + { + type: 'api_key', + in: {{#isKeyInHeader}}'header'{{/isKeyInHeader}}{{#isKeyInQuery}}'query'{{/isKeyInQuery}}, + key: '{{keyParamName}}', + value: api_key_with_prefix('{{keyParamName}}') + }, +{{/isApiKey}} +{{#isBasic}} +{{^isBasicBearer}} + '{{name}}' => + { + type: 'basic', + in: 'header', + key: 'Authorization', + value: basic_auth_token + }, +{{/isBasicBearer}} +{{#isBasicBearer}} + '{{name}}' => + { + type: 'bearer', + in: 'header', + {{#bearerFormat}} + format: '{{{.}}}', + {{/bearerFormat}} + key: 'Authorization', + value: "Bearer #{access_token}" + }, +{{/isBasicBearer}} +{{/isBasic}} +{{#isOAuth}} + '{{name}}' => + { + type: 'oauth2', + in: 'header', + key: 'Authorization', + value: "Bearer #{access_token}" + }, +{{/isOAuth}} +{{/authMethods}} + } + end + + # Returns an array of Server setting + def server_settings + [ + {{#servers}} + { + url: "{{{url}}}", + description: "{{{description}}}{{^description}}No descriptoin provided{{/description}}", + {{#variables}} + {{#-first}} + variables: { + {{/-first}} + {{{name}}}: { + description: "{{{description}}}{{^description}}No descriptoin provided{{/description}}", + default_value: "{{{defaultValue}}}", + {{#enumValues}} + {{#-first}} + enum_values: [ + {{/-first}} + "{{{.}}}"{{^-last}},{{/-last}} + {{#-last}} + ] + {{/-last}} + {{/enumValues}} + }{{^-last}},{{/-last}} + {{#-last}} + } + {{/-last}} + {{/variables}} + }{{^-last}},{{/-last}} + {{/servers}} + ] + end + + # Returns URL based on server settings + # + # @param index array index of the server settings + # @param variables hash of variable and the corresponding value + def server_url(index, variables = {}) + servers = server_settings + + # check array index out of bound + if (index < 0 || index >= servers.size) + fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}" + end + + server = servers[index] + url = server[:url] + + # go through variable and assign a value + server[:variables].each do |name, variable| + if variables.key?(name) + if (server[:variables][name][:enum_values].include? variables[name]) + url.gsub! "{" + name.to_s + "}", variables[name] + else + fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}." + end + else + # use default value + url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value] + end + end + + url + end + end +end From ffaeb11a6122d7e3a75bb6e6f4401d65bb77f056 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 2 Aug 2019 14:15:49 +0800 Subject: [PATCH 36/75] Add cgensoul to OCaml tech committee (#3536) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3daf269384c..3051212965b 100644 --- a/README.md +++ b/README.md @@ -803,6 +803,7 @@ If you want to join the committee, please kindly apply by sending an email to te | Lua | @daurnimator (2017/08) | | NodeJS/Javascript | @CodeNinjai (2017/07) @frol (2017/07) @cliffano (2017/07) | | ObjC | | +| OCaml | @cgensoul (2019/08) | | Perl | @wing328 (2017/07) [:heart:](https://www.patreon.com/wing328) @yue9944882 (2019/06) | | PHP | @jebentier (2017/07), @dkarlovi (2017/07), @mandrean (2017/08), @jfastnacht (2017/09), @ackintosh (2017/09) [:heart:](https://www.patreon.com/ackintosh/overview), @ybelenko (2018/07), @renepardon (2018/12) | | PowerShell | | From d0f0e175423dbf239c80f7633ea452890793ed53 Mon Sep 17 00:00:00 2001 From: Steven Masala Date: Fri, 2 Aug 2019 11:33:15 +0200 Subject: [PATCH 37/75] remove fixme by setting param to final and creating local variable for sanitising model name (#3525) - general cleanup (cherry picked from commit 88cf7e801f78a6611fc0d63479c78296e7312419) --- .../AbstractTypeScriptClientCodegen.java | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java index b022f73c5f7..95a12c1274c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java @@ -98,7 +98,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp "object" )); - languageGenericTypes = new HashSet<>(Arrays.asList( + languageGenericTypes = new HashSet<>(Collections.singletonList( "Array" )); @@ -181,7 +181,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp this.setNpmVersion(openAPI.getInfo().getVersion()); } - if (additionalProperties.containsKey(SNAPSHOT) && Boolean.valueOf(additionalProperties.get(SNAPSHOT).toString())) { + if (additionalProperties.containsKey(SNAPSHOT) && Boolean.parseBoolean(additionalProperties.get(SNAPSHOT).toString())) { if (npmVersion.toUpperCase(Locale.ROOT).matches("^.*-SNAPSHOT$")) { this.setNpmVersion(npmVersion + "." + SNAPSHOT_SUFFIX_FORMAT.format(new Date())); } else { @@ -264,46 +264,45 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp final String regex = "^.*[+*:;,.()-]+.*$"; final Pattern pattern = Pattern.compile(regex); final Matcher matcher = pattern.matcher(str); - boolean matches = matcher.matches(); - return matches; + return matcher.matches(); } @Override - public String toModelName(String name) { + public String toModelName(final String name) { ArrayList exceptions = new ArrayList(Arrays.asList("\\|", " ")); - name = sanitizeName(name, "(?![| ])\\W", exceptions); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. + String sanName = sanitizeName(name, "(?![| ])\\W", exceptions); if (!StringUtils.isEmpty(modelNamePrefix)) { - name = modelNamePrefix + "_" + name; + sanName = modelNamePrefix + "_" + sanName; } if (!StringUtils.isEmpty(modelNameSuffix)) { - name = name + "_" + modelNameSuffix; + sanName = sanName + "_" + modelNameSuffix; } // model name cannot use reserved keyword, e.g. return - if (isReservedWord(name)) { - String modelName = camelize("model_" + name); - LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + modelName); + if (isReservedWord(sanName)) { + String modelName = camelize("model_" + sanName); + LOGGER.warn(sanName + " (reserved word) cannot be used as model name. Renamed to " + modelName); return modelName; } // model name starts with number - if (name.matches("^\\d.*")) { - String modelName = camelize("model_" + name); // e.g. 200Response => Model200Response (after camelize) - LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + modelName); + if (sanName.matches("^\\d.*")) { + String modelName = camelize("model_" + sanName); // e.g. 200Response => Model200Response (after camelize) + LOGGER.warn(sanName + " (model name starts with number) cannot be used as model name. Renamed to " + modelName); return modelName; } - if (languageSpecificPrimitives.contains(name)) { - String modelName = camelize("model_" + name); - LOGGER.warn(name + " (model name matches existing language type) cannot be used as a model name. Renamed to " + modelName); + if (languageSpecificPrimitives.contains(sanName)) { + String modelName = camelize("model_" + sanName); + LOGGER.warn(sanName + " (model name matches existing language type) cannot be used as a model name. Renamed to " + modelName); return modelName; } // camelize the model name // phone_number => PhoneNumber - return camelize(name); + return camelize(sanName); } @Override From 1c36fa9fe33624e0dd7e9a1f1aa8a0313c5751e4 Mon Sep 17 00:00:00 2001 From: cgensoul <53224246+cgensoul@users.noreply.github.com> Date: Fri, 2 Aug 2019 13:04:53 +0200 Subject: [PATCH 38/75] Fixed #3521. Response headers were not processed for enums collection. (#3526) * Fixed #3521. Response headers were not processed for enums collection. * Replace " by '' in text fields to allow these to be used in OCaml comments. * Added support of ByteArray (i.e. base64 encoded data) body and free form object as request body. Added support of free form object in response body as well. * Added result as a reserved word to prevent generating model files with this name (having a result.ml model file confuses dune into thinking some other model modules depend on Result when they don't). * Updated samples to reflect the latest changes in the OCaml generator. --- .../codegen/languages/OCamlClientCodegen.java | 20 ++++++++++++++++--- .../main/resources/ocaml/api-impl.mustache | 4 ++-- .../src/main/resources/ocaml/support.mustache | 14 ++++++++++--- .../main/resources/ocaml/to_string.mustache | 2 +- .../client/petstore/ocaml/src/apis/pet_api.ml | 4 ++-- .../petstore/ocaml/src/apis/store_api.ml | 2 +- .../petstore/ocaml/src/apis/user_api.ml | 8 ++++---- .../petstore/ocaml/src/support/request.ml | 14 ++++++++++--- 8 files changed, 49 insertions(+), 19 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java index 2ad91492b2e..2e388012b15 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java @@ -18,6 +18,7 @@ package org.openapitools.codegen.languages; import com.google.common.base.Strings; import io.swagger.v3.oas.models.*; +import io.swagger.v3.oas.models.headers.Header; import io.swagger.v3.oas.models.media.*; import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.responses.ApiResponse; @@ -87,7 +88,9 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig "new", "nonrec", "object", "of", "open", "or", "private", "rec", "sig", "struct", "then", "to", "true", "try", "type", "val", "virtual", "when", - "while", "with" + "while", "with", + + "result" ) ); @@ -141,7 +144,7 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig typeMapping.put("object", "Yojson.Safe.t"); typeMapping.put("any", "Yojson.Safe.t"); typeMapping.put("file", "string"); - typeMapping.put("ByteArray", "bytes"); + typeMapping.put("ByteArray", "string"); // lib typeMapping.put("string", "string"); typeMapping.put("UUID", "string"); @@ -318,6 +321,13 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig collectEnumSchemas(p, content.get(p).getSchema()); } } + if (apiResponse.getHeaders() != null) { + Map headers = apiResponse.getHeaders(); + for (String h : headers.keySet()) { + Header header = headers.get(h); + collectEnumSchemas(h, header.getSchema()); + } + } } } } @@ -668,6 +678,10 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig param.vendorExtensions.put(X_MODEL_MODULE, param.dataType.substring(0, param.dataType.lastIndexOf('.'))); } } + + if ("Yojson.Safe.t".equals(operation.returnBaseType)) { + operation.vendorExtensions.put("x-returnFreeFormObject", true); + } } for (Map.Entry e : enumUniqNames.entrySet()) { @@ -704,7 +718,7 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig return input .replace("*)", "*_)") .replace("(*", "(_*") - .replace("\"", "\\\""); + .replace("\"", "''"); } @Override diff --git a/modules/openapi-generator/src/main/resources/ocaml/api-impl.mustache b/modules/openapi-generator/src/main/resources/ocaml/api-impl.mustache index 5b9e498eb5f..dc0c5d96776 100644 --- a/modules/openapi-generator/src/main/resources/ocaml/api-impl.mustache +++ b/modules/openapi-generator/src/main/resources/ocaml/api-impl.mustache @@ -18,13 +18,13 @@ let {{{operationId}}} {{^hasParams}}(){{/hasParams}}{{#allParams}}{{{paramName}} let uri = Request.replace_path_param uri "{{{baseName}}}" ({{> to_string}}{{{paramName}}}) in{{/pathParams}}{{#queryParams}} let uri = Uri.add_query_param{{^isListContainer}}'{{/isListContainer}} uri ("{{{baseName}}}", {{> to_string}}{{{paramName}}}) in{{/queryParams}}{{#hasAuthMethods}}{{#authMethods}}{{#isApiKey}}{{#isKeyInQuery}} let uri = Uri.add_query_param' uri ("{{{keyParamName}}}", Request.api_key) in{{/isKeyInQuery}}{{/isApiKey}}{{/authMethods}}{{/hasAuthMethods}}{{#bodyParams}} - let body = Request.write_json_body {{> to_json}} {{{paramName}}} in{{/bodyParams}}{{^hasBodyParam}}{{#hasFormParams}} + let body = Request.{{#isFreeFormObject}}write_json_body{{/isFreeFormObject}}{{#isByteArray}}write_string_body{{/isByteArray}}{{^isFreeFormObject}}{{^isByteArray}}write_as_json_body{{/isByteArray}}{{/isFreeFormObject}} {{> to_json}} {{{paramName}}} in{{/bodyParams}}{{^hasBodyParam}}{{#hasFormParams}} let body = Request.init_form_encoded_body () in{{/hasFormParams}}{{#formParams}} let body = Request.add_form_encoded_body_param{{#isContainer}}s{{/isContainer}} body ("{{{paramName}}}", {{> to_string}}{{{paramName}}}) in{{/formParams}}{{#hasFormParams}} let body = Request.finalize_form_encoded_body body in{{/hasFormParams}}{{/hasBodyParam}} Cohttp_lwt_unix.Client.call `{{{httpMethod}}} uri ~headers {{#hasBodyParam}}~body {{/hasBodyParam}}{{^hasBodyParam}}{{#hasFormParams}}~body {{/hasFormParams}}{{/hasBodyParam}}>>= fun (resp, body) ->{{^returnType}} Request.handle_unit_response resp{{/returnType}}{{#returnType}} - Request.read_json_body{{#returnContainer}}{{#isListContainer}}_as_list{{/isListContainer}}{{#isMapContainer}}_as_map{{/isMapContainer}}{{#returnBaseType}}_of{{/returnBaseType}}{{/returnContainer}}{{^returnContainer}}{{#returnBaseType}}_as{{/returnBaseType}}{{/returnContainer}} {{#returnType}}({{> of_json}}){{/returnType}} resp body{{/returnType}} + Request.read_json_body{{#returnContainer}}{{#isListContainer}}_as_list{{/isListContainer}}{{#isMapContainer}}_as_map{{/isMapContainer}}{{#returnBaseType}}{{^vendorExtensions.x-returnFreeFormObject}}_of{{/vendorExtensions.x-returnFreeFormObject}}{{/returnBaseType}}{{/returnContainer}}{{^returnContainer}}{{#returnBaseType}}{{^vendorExtensions.x-returnFreeFormObject}}_as{{/vendorExtensions.x-returnFreeFormObject}}{{/returnBaseType}}{{/returnContainer}} {{#returnType}}{{^vendorExtensions.x-returnFreeFormObject}}({{> of_json}}){{/vendorExtensions.x-returnFreeFormObject}}{{/returnType}} resp body{{/returnType}} {{/operation}} {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/ocaml/support.mustache b/modules/openapi-generator/src/main/resources/ocaml/support.mustache index e0c33b4f58a..09e5b1a922e 100644 --- a/modules/openapi-generator/src/main/resources/ocaml/support.mustache +++ b/modules/openapi-generator/src/main/resources/ocaml/support.mustache @@ -3,8 +3,13 @@ let base_url = "{{{basePath}}}" let default_headers = Cohttp.Header.init_with "Content-Type" "application/json" let build_uri operation_path = Uri.of_string (base_url ^ operation_path) -let write_json_body to_json payload = - to_json payload |> Yojson.Safe.to_string ~std:true |> Cohttp_lwt.Body.of_string + +let write_string_body s = Cohttp_lwt.Body.of_string s + +let write_json_body payload = + Cohttp_lwt.Body.of_string (Yojson.Safe.to_string payload ~std:true) + +let write_as_json_body to_json payload = write_json_body (to_json payload) let handle_response resp on_success_handler = match Cohttp_lwt.Response.status resp with @@ -26,8 +31,11 @@ let read_json_body_as_list resp body = let read_json_body_as_list_of of_json resp body = Lwt.(read_json_body_as_list resp body >|= List.map of_json) +let read_json_body_as_map resp body = + Lwt.(read_json_body resp body >|= Yojson.Safe.Util.to_assoc) + let read_json_body_as_map_of of_json resp body = - Lwt.(read_json_body resp body >|= Yojson.Safe.Util.to_assoc >|= List.map (fun (s, v) -> (s, of_json v))) + Lwt.(read_json_body_as_map resp body >|= List.map (fun (s, v) -> (s, of_json v))) let replace_path_param uri param_name param_value = let regexp = Str.regexp (Str.quote ("{" ^ param_name ^ "}")) in diff --git a/modules/openapi-generator/src/main/resources/ocaml/to_string.mustache b/modules/openapi-generator/src/main/resources/ocaml/to_string.mustache index b7be4f380df..9e5b60af842 100644 --- a/modules/openapi-generator/src/main/resources/ocaml/to_string.mustache +++ b/modules/openapi-generator/src/main/resources/ocaml/to_string.mustache @@ -1 +1 @@ -{{#isContainer}}{{#items}}{{#isEnum}}List.map {{> to_string}}{{/isEnum}}{{#isModel}}List.map {{> to_string}}{{/isModel}}{{/items}}{{/isContainer}}{{^isEnum}}{{#isString}}{{/isString}}{{#isLong}}Int64.to_string {{/isLong}}{{#isInteger}}Int32.to_string {{/isInteger}}{{#isFloat}}string_of_float {{/isFloat}}{{#isNumber}}string_of_float {{/isNumber}}{{#isDouble}}string_of_float {{/isDouble}}{{#isBoolean}}string_of_bool {{/isBoolean}}{{#isByteArray}}Bytes.to_string {{/isByteArray}}{{#isModel}}{{{vendorExtensions.x-modelModule}}}.show {{/isModel}}{{/isEnum}}{{^isModel}}{{^isContainer}}{{#isEnum}}Enums.show_{{{datatypeWithEnum}}} {{/isEnum}}{{/isContainer}}{{/isModel}} \ No newline at end of file +{{#isContainer}}{{#items}}{{#isEnum}}List.map {{> to_string}}{{/isEnum}}{{#isModel}}List.map {{> to_string}}{{/isModel}}{{/items}}{{/isContainer}}{{^isEnum}}{{#isString}}{{/isString}}{{#isLong}}Int64.to_string {{/isLong}}{{#isInteger}}Int32.to_string {{/isInteger}}{{#isFloat}}string_of_float {{/isFloat}}{{#isNumber}}string_of_float {{/isNumber}}{{#isDouble}}string_of_float {{/isDouble}}{{#isBoolean}}string_of_bool {{/isBoolean}}{{#isByteArray}}{{/isByteArray}}{{#isModel}}{{{vendorExtensions.x-modelModule}}}.show {{/isModel}}{{/isEnum}}{{^isModel}}{{^isContainer}}{{#isEnum}}Enums.show_{{{datatypeWithEnum}}} {{/isEnum}}{{/isContainer}}{{/isModel}} \ No newline at end of file diff --git a/samples/client/petstore/ocaml/src/apis/pet_api.ml b/samples/client/petstore/ocaml/src/apis/pet_api.ml index 207503b9061..bb0ebbc55e7 100644 --- a/samples/client/petstore/ocaml/src/apis/pet_api.ml +++ b/samples/client/petstore/ocaml/src/apis/pet_api.ml @@ -9,7 +9,7 @@ let add_pet body = let open Lwt in let uri = Request.build_uri "/pet" in let headers = Request.default_headers in - let body = Request.write_json_body Pet.to_yojson body in + let body = Request.write_as_json_body Pet.to_yojson body in Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> Request.handle_unit_response resp @@ -50,7 +50,7 @@ let update_pet body = let open Lwt in let uri = Request.build_uri "/pet" in let headers = Request.default_headers in - let body = Request.write_json_body Pet.to_yojson body in + let body = Request.write_as_json_body Pet.to_yojson body in Cohttp_lwt_unix.Client.call `PUT uri ~headers ~body >>= fun (resp, body) -> Request.handle_unit_response resp diff --git a/samples/client/petstore/ocaml/src/apis/store_api.ml b/samples/client/petstore/ocaml/src/apis/store_api.ml index cebccabdd85..b9e7f536388 100644 --- a/samples/client/petstore/ocaml/src/apis/store_api.ml +++ b/samples/client/petstore/ocaml/src/apis/store_api.ml @@ -32,7 +32,7 @@ let place_order body = let open Lwt in let uri = Request.build_uri "/store/order" in let headers = Request.default_headers in - let body = Request.write_json_body Order.to_yojson body in + let body = Request.write_as_json_body Order.to_yojson body in Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> Request.read_json_body_as (JsonSupport.unwrap Order.of_yojson) resp body diff --git a/samples/client/petstore/ocaml/src/apis/user_api.ml b/samples/client/petstore/ocaml/src/apis/user_api.ml index d05d71682a3..bf6e7cfc52d 100644 --- a/samples/client/petstore/ocaml/src/apis/user_api.ml +++ b/samples/client/petstore/ocaml/src/apis/user_api.ml @@ -9,7 +9,7 @@ let create_user body = let open Lwt in let uri = Request.build_uri "/user" in let headers = Request.default_headers in - let body = Request.write_json_body User.to_yojson body in + let body = Request.write_as_json_body User.to_yojson body in Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> Request.handle_unit_response resp @@ -17,7 +17,7 @@ let create_users_with_array_input body = let open Lwt in let uri = Request.build_uri "/user/createWithArray" in let headers = Request.default_headers in - let body = Request.write_json_body (JsonSupport.of_list_of User.to_yojson) body in + let body = Request.write_as_json_body (JsonSupport.of_list_of User.to_yojson) body in Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> Request.handle_unit_response resp @@ -25,7 +25,7 @@ let create_users_with_list_input body = let open Lwt in let uri = Request.build_uri "/user/createWithList" in let headers = Request.default_headers in - let body = Request.write_json_body (JsonSupport.of_list_of User.to_yojson) body in + let body = Request.write_as_json_body (JsonSupport.of_list_of User.to_yojson) body in Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> Request.handle_unit_response resp @@ -66,7 +66,7 @@ let update_user username body = let uri = Request.build_uri "/user/{username}" in let headers = Request.default_headers in let uri = Request.replace_path_param uri "username" (username) in - let body = Request.write_json_body User.to_yojson body in + let body = Request.write_as_json_body User.to_yojson body in Cohttp_lwt_unix.Client.call `PUT uri ~headers ~body >>= fun (resp, body) -> Request.handle_unit_response resp diff --git a/samples/client/petstore/ocaml/src/support/request.ml b/samples/client/petstore/ocaml/src/support/request.ml index 21b6f870ed9..3d7fd640e54 100644 --- a/samples/client/petstore/ocaml/src/support/request.ml +++ b/samples/client/petstore/ocaml/src/support/request.ml @@ -3,8 +3,13 @@ let base_url = "http://petstore.swagger.io/v2" let default_headers = Cohttp.Header.init_with "Content-Type" "application/json" let build_uri operation_path = Uri.of_string (base_url ^ operation_path) -let write_json_body to_json payload = - to_json payload |> Yojson.Safe.to_string ~std:true |> Cohttp_lwt.Body.of_string + +let write_string_body s = Cohttp_lwt.Body.of_string s + +let write_json_body payload = + Cohttp_lwt.Body.of_string (Yojson.Safe.to_string payload ~std:true) + +let write_as_json_body to_json payload = write_json_body (to_json payload) let handle_response resp on_success_handler = match Cohttp_lwt.Response.status resp with @@ -26,8 +31,11 @@ let read_json_body_as_list resp body = let read_json_body_as_list_of of_json resp body = Lwt.(read_json_body_as_list resp body >|= List.map of_json) +let read_json_body_as_map resp body = + Lwt.(read_json_body resp body >|= Yojson.Safe.Util.to_assoc) + let read_json_body_as_map_of of_json resp body = - Lwt.(read_json_body resp body >|= Yojson.Safe.Util.to_assoc >|= List.map (fun (s, v) -> (s, of_json v))) + Lwt.(read_json_body_as_map resp body >|= List.map (fun (s, v) -> (s, of_json v))) let replace_path_param uri param_name param_value = let regexp = Str.regexp (Str.quote ("{" ^ param_name ^ "}")) in From d45e3064808a3082066feb4fcbe04bdd4496f6f3 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 2 Aug 2019 21:18:24 +0800 Subject: [PATCH 39/75] Use partial for Ruby HTTP libraries (#3539) * use partial for ruby http libraries * fix isFaraday * add back client side validation switch * remove blank lines --- .../codegen/languages/RubyClientCodegen.java | 4 +- .../ruby-client/configuration.mustache | 50 ++++++------------- ...configuration_tls_faraday_partial.mustache | 29 +++++++++++ ...onfiguration_tls_typhoeus_partial.mustache | 34 +++++++++++++ .../ruby-client/faraday_api_client.mustache | 3 -- .../ruby-faraday/lib/petstore/api_client.rb | 21 ++++---- .../lib/petstore/configuration.rb | 27 ++++------ .../petstore/ruby-faraday/petstore.gemspec | 4 ++ 8 files changed, 105 insertions(+), 67 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/ruby-client/configuration_tls_faraday_partial.mustache create mode 100644 modules/openapi-generator/src/main/resources/ruby-client/configuration_tls_typhoeus_partial.mustache diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java index 2f2af730e38..0b1b59b98df 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java @@ -233,14 +233,14 @@ public class RubyClientCodegen extends AbstractRubyCodegen { supportingFiles.add(new SupportingFile("rubocop.mustache", "", ".rubocop.yml")); supportingFiles.add(new SupportingFile("travis.mustache", "", ".travis.yml")); supportingFiles.add(new SupportingFile("gemspec.mustache", "", gemName + ".gemspec")); + supportingFiles.add(new SupportingFile("configuration.mustache", gemFolder, "configuration.rb")); if (TYPHOEUS.equals(getLibrary())) { supportingFiles.add(new SupportingFile("api_client.mustache", gemFolder, "api_client.rb")); - supportingFiles.add(new SupportingFile("configuration.mustache", gemFolder, "configuration.rb")); supportingFiles.add(new SupportingFile("Gemfile.lock.mustache", "", "Gemfile.lock")); } else if (FARADAY.equals(getLibrary())) { supportingFiles.add(new SupportingFile("faraday_api_client.mustache", gemFolder, "api_client.rb")); - supportingFiles.add(new SupportingFile("faraday_configuration.mustache", gemFolder, "configuration.rb")); + additionalProperties.put("isFaraday", Boolean.TRUE); } else { throw new RuntimeException("Invalid HTTP library " + getLibrary() + ". Only faraday, typhoeus are supported."); } diff --git a/modules/openapi-generator/src/main/resources/ruby-client/configuration.mustache b/modules/openapi-generator/src/main/resources/ruby-client/configuration.mustache index 3c0148fbd4d..72f6fe90e28 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/configuration.mustache @@ -71,41 +71,12 @@ module {{moduleName}} # @return [true, false] attr_accessor :client_side_validation - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl - - ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :verify_ssl_host - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :cert_file - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :key_file - +{{^isFaraday}} +{{> configuration_tls_typhoeus_partial}} +{{/isFaraday}} +{{#isFaraday}} +{{> configuration_tls_faraday_partial}} +{{/isFaraday}} # Set this to customize parameters encoding of array parameter with multi collectionFormat. # Default to nil. # @@ -125,11 +96,20 @@ module {{moduleName}} @api_key_prefix = {} @timeout = 0 @client_side_validation = true + {{#isFaraday}} + @ssl_verify = true + @ssl_verify_mode = nil + @ssl_ca_file = nil + @ssl_client_cert = nil + @ssl_client_key = nil + {{/isFaraday}} + {{^isFaraday}} @verify_ssl = true @verify_ssl_host = true @params_encoding = nil @cert_file = nil @key_file = nil + {{/isFaraday}} @debugging = false @inject_format = false @force_ending_format = false diff --git a/modules/openapi-generator/src/main/resources/ruby-client/configuration_tls_faraday_partial.mustache b/modules/openapi-generator/src/main/resources/ruby-client/configuration_tls_faraday_partial.mustache new file mode 100644 index 00000000000..e5f4085cda2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/ruby-client/configuration_tls_faraday_partial.mustache @@ -0,0 +1,29 @@ + ### TLS/SSL setting + # Set this to false to skip verifying SSL certificate when calling API from https server. + # Default to true. + # + # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. + # + # @return [true, false] + attr_accessor :ssl_verify + + ### TLS/SSL setting + # Any `OpenSSL::SSL::` constant (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html) + # + # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. + # + attr_accessor :ssl_verify_mode + + ### TLS/SSL setting + # Set this to customize the certificate file to verify the peer. + # + # @return [String] the path to the certificate file + attr_accessor :ssl_ca_file + + ### TLS/SSL setting + # Client certificate file (for client certificate) + attr_accessor :ssl_client_cert + + ### TLS/SSL setting + # Client private key file (for client certificate) + attr_accessor :ssl_client_key diff --git a/modules/openapi-generator/src/main/resources/ruby-client/configuration_tls_typhoeus_partial.mustache b/modules/openapi-generator/src/main/resources/ruby-client/configuration_tls_typhoeus_partial.mustache new file mode 100644 index 00000000000..b75954c254a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/ruby-client/configuration_tls_typhoeus_partial.mustache @@ -0,0 +1,34 @@ + ### TLS/SSL setting + # Set this to false to skip verifying SSL certificate when calling API from https server. + # Default to true. + # + # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. + # + # @return [true, false] + attr_accessor :verify_ssl + + ### TLS/SSL setting + # Set this to false to skip verifying SSL host name + # Default to true. + # + # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. + # + # @return [true, false] + attr_accessor :verify_ssl_host + + ### TLS/SSL setting + # Set this to customize the certificate file to verify the peer. + # + # @return [String] the path to the certificate file + # + # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: + # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 + attr_accessor :ssl_ca_cert + + ### TLS/SSL setting + # Client certificate file (for client certificate) + attr_accessor :cert_file + + ### TLS/SSL setting + # Client private key file (for client certificate) + attr_accessor :key_file diff --git a/modules/openapi-generator/src/main/resources/ruby-client/faraday_api_client.mustache b/modules/openapi-generator/src/main/resources/ruby-client/faraday_api_client.mustache index f628ffecf07..14509b18a00 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/faraday_api_client.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/faraday_api_client.mustache @@ -107,8 +107,6 @@ module {{moduleName}} update_params_for_auth! header_params, query_params, opts[:auth_names] - - req_opts = { :method => http_method, :headers => header_params, @@ -118,7 +116,6 @@ module {{moduleName}} :verbose => @config.debugging } - if [:post, :patch, :put, :delete].include?(http_method) req_body = build_request_body(header_params, form_params, opts[:body]) req_opts.update :body => req_body diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_client.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_client.rb index f5167c18671..dba9af066bb 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_client.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_client.rb @@ -46,7 +46,15 @@ module Petstore # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: # the data deserialized from response body (could be nil), response status code and response headers. def call_api(http_method, path, opts = {}) - connection = Faraday.new(:url => config.base_url) do |conn| + ssl_options = { + :ca_file => @config.ssl_ca_file, + :verify => @config.ssl_verify, + :verify => @config.ssl_verify_mode, + :client_cert => @config.ssl_client_cert, + :client_key => @config.ssl_client_key + } + + connection = Faraday.new(:url => config.base_url, :ssl => ssl_options) do |conn| conn.basic_auth(config.username, config.password) if opts[:header_params]["Content-Type"] == "multipart/form-data" conn.request :multipart @@ -54,6 +62,7 @@ module Petstore end conn.adapter(Faraday.default_adapter) end + begin response = connection.public_send(http_method.to_sym.downcase) do |req| build_request(http_method, path, req, opts) @@ -106,25 +115,15 @@ module Petstore update_params_for_auth! header_params, query_params, opts[:auth_names] - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - req_opts = { :method => http_method, :headers => header_params, :params => query_params, :params_encoding => @config.params_encoding, :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, :verbose => @config.debugging } - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - if [:post, :patch, :put, :delete].include?(http_method) req_body = build_request_body(header_params, form_params, opts[:body]) req_opts.update :body => req_body diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/configuration.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/configuration.rb index 73a5712c90d..02264ad9516 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/configuration.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/configuration.rb @@ -86,33 +86,28 @@ module Petstore # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. # # @return [true, false] - attr_accessor :verify_ssl + attr_accessor :ssl_verify ### TLS/SSL setting - # Set this to false to skip verifying SSL host name - # Default to true. + # Any `OpenSSL::SSL::` constant (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html) # # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. # - # @return [true, false] - attr_accessor :verify_ssl_host + attr_accessor :ssl_verify_mode ### TLS/SSL setting # Set this to customize the certificate file to verify the peer. # # @return [String] the path to the certificate file - # - # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code: - # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert + attr_accessor :ssl_ca_file ### TLS/SSL setting # Client certificate file (for client certificate) - attr_accessor :cert_file + attr_accessor :ssl_client_cert ### TLS/SSL setting # Client private key file (for client certificate) - attr_accessor :key_file + attr_accessor :ssl_client_key # Set this to customize parameters encoding of array parameter with multi collectionFormat. # Default to nil. @@ -133,11 +128,11 @@ module Petstore @api_key_prefix = {} @timeout = 0 @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @params_encoding = nil - @cert_file = nil - @key_file = nil + @ssl_verify = true + @ssl_verify_mode = nil + @ssl_ca_file = nil + @ssl_client_cert = nil + @ssl_client_key = nil @debugging = false @inject_format = false @force_ending_format = false diff --git a/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec b/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec index 6cbf88ba127..c414c1806b0 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec +++ b/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec @@ -33,6 +33,10 @@ Gem::Specification.new do |s| s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1' s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3' + s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6' + s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2' + s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16' + s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12' s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } s.test_files = `find spec/*`.split("\n") From ba63aa55a5d73783b1557e8d5904c30198ebd0be Mon Sep 17 00:00:00 2001 From: Dennis Melzer Date: Fri, 2 Aug 2019 15:24:04 +0200 Subject: [PATCH 40/75] Add lowercase lamda (#3501) * Add lowercase lamda #3381 * Add lowercase prefix for spring #3381 * Add lamda prefix * Add lamda lower case to @Value * Add properties for braces #3381 * Add property for braces * Start CI * Revert --- .../codegen/languages/SpringCodegen.java | 7 ++++- .../spring-cloud/clientConfiguration.mustache | 28 +++++++++---------- .../configuration/ClientConfiguration.java | 10 +++---- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index cff6cc3ad75..1629e35d5ce 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -69,6 +69,9 @@ public class SpringCodegen extends AbstractJavaCodegen public static final String RETURN_SUCCESS_CODE = "returnSuccessCode"; public static final String UNHANDLED_EXCEPTION_HANDLING = "unhandledException"; + public static final String OPEN_BRACE = "{"; + public static final String CLOSE_BRACE = "}"; + protected String title = "OpenAPI Spring"; protected String configPackage = "org.openapitools.configuration"; protected String basePackage = "org.openapitools"; @@ -103,7 +106,7 @@ public class SpringCodegen extends AbstractJavaCodegen invokerPackage = "org.openapitools.api"; artifactId = "openapi-spring"; - // clioOptions default redifinition need to be updated + // clioOptions default redefinition need to be updated updateOption(CodegenConstants.INVOKER_PACKAGE, this.getInvokerPackage()); updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId()); updateOption(CodegenConstants.API_PACKAGE, apiPackage); @@ -113,6 +116,8 @@ public class SpringCodegen extends AbstractJavaCodegen // spring uses the jackson lib additionalProperties.put("jackson", "true"); + additionalProperties.put("openbrace", OPEN_BRACE); + additionalProperties.put("closebrace", CLOSE_BRACE); cliOptions.add(new CliOption(TITLE, "server title name or client service name").defaultValue(title)); cliOptions.add(new CliOption(CONFIG_PACKAGE, "configuration package for generated code").defaultValue(this.getConfigPackage())); diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/clientConfiguration.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/clientConfiguration.mustache index 3e86330c91b..99d82b2c7d5 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/clientConfiguration.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/clientConfiguration.mustache @@ -24,25 +24,25 @@ public class ClientConfiguration { {{#authMethods}} {{#isBasic}} - {{=<% %>=}}@Value("${<%title%>.security.<%name%>.username:}")<%={{ }}=%> + @Value("${{openbrace}}{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}.username:{{closebrace}}") private String {{{name}}}Username; - {{=<% %>=}}@Value("${<%title%>.security.<%name%>.password:}")<%={{ }}=%> + @Value("${{openbrace}}{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}.password:{{closebrace}}") private String {{{name}}}Password; @Bean - @ConditionalOnProperty(name = "{{{title}}}.security.{{{name}}}.username") + @ConditionalOnProperty(name = "{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}.username") public BasicAuthRequestInterceptor {{{name}}}RequestInterceptor() { return new BasicAuthRequestInterceptor(this.{{{name}}}Username, this.{{{name}}}Password); } {{/isBasic}} {{#isApiKey}} - {{=<% %>=}}@Value("${<%title%>.security.<%name%>.key:}")<%={{ }}=%> + @Value("${{openbrace}}{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}.key:{{closebrace}}") private String {{{name}}}Key; @Bean - @ConditionalOnProperty(name = "{{{title}}}.security.{{{name}}}.key") + @ConditionalOnProperty(name = "{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}.key") public ApiKeyRequestInterceptor {{{name}}}RequestInterceptor() { return new ApiKeyRequestInterceptor({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{{keyParamName}}}", this.{{{name}}}Key); } @@ -50,15 +50,15 @@ public class ClientConfiguration { {{/isApiKey}} {{#isOAuth}} @Bean - @ConditionalOnProperty("{{{title}}}.security.{{{name}}}.client-id") + @ConditionalOnProperty("{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}.client-id") public OAuth2FeignRequestInterceptor {{{name}}}RequestInterceptor() { return new OAuth2FeignRequestInterceptor(new DefaultOAuth2ClientContext(), {{{name}}}ResourceDetails()); } {{#isCode}} @Bean - @ConditionalOnProperty("{{{title}}}.security.{{{name}}}.client-id") - @ConfigurationProperties("{{{title}}}.security.{{{name}}}") + @ConditionalOnProperty("{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}.client-id") + @ConfigurationProperties("{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}") public AuthorizationCodeResourceDetails {{{name}}}ResourceDetails() { AuthorizationCodeResourceDetails details = new AuthorizationCodeResourceDetails(); details.setAccessTokenUri("{{{tokenUrl}}}"); @@ -69,8 +69,8 @@ public class ClientConfiguration { {{/isCode}} {{#isPassword}} @Bean - @ConditionalOnProperty("{{{title}}}.security.{{{name}}}.client-id") - @ConfigurationProperties("{{{title}}}.security.{{{name}}}") + @ConditionalOnProperty("{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}.client-id") + @ConfigurationProperties("{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}") public ResourceOwnerPasswordResourceDetails {{{name}}}ResourceDetails() { ResourceOwnerPasswordResourceDetails details = new ResourceOwnerPasswordResourceDetails(); details.setAccessTokenUri("{{{tokenUrl}}}"); @@ -80,8 +80,8 @@ public class ClientConfiguration { {{/isPassword}} {{#isApplication}} @Bean - @ConditionalOnProperty("{{{title}}}.security.{{{name}}}.client-id") - @ConfigurationProperties("{{{title}}}.security.{{{name}}}") + @ConditionalOnProperty("{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}.client-id") + @ConfigurationProperties("{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}") public ClientCredentialsResourceDetails {{{name}}}ResourceDetails() { ClientCredentialsResourceDetails details = new ClientCredentialsResourceDetails(); details.setAccessTokenUri("{{{tokenUrl}}}"); @@ -91,8 +91,8 @@ public class ClientConfiguration { {{/isApplication}} {{#isImplicit}} @Bean - @ConditionalOnProperty("{{{title}}}.security.{{{name}}}.client-id") - @ConfigurationProperties("{{{title}}}.security.{{{name}}}") + @ConditionalOnProperty("{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}.client-id") + @ConfigurationProperties("{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}") public ImplicitResourceDetails {{{name}}}ResourceDetails() { ImplicitResourceDetails details = new ImplicitResourceDetails(); details.setUserAuthorizationUri("{{{authorizationUrl}}}"); diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/configuration/ClientConfiguration.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/configuration/ClientConfiguration.java index abf7e746252..3a24985dcd2 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/configuration/ClientConfiguration.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/configuration/ClientConfiguration.java @@ -22,24 +22,24 @@ import org.springframework.security.oauth2.common.exceptions.OAuth2Exception; @EnableConfigurationProperties public class ClientConfiguration { - @Value("${openAPIPetstore.security.apiKey.key:}") + @Value("${openapipetstore.security.apiKey.key:}") private String apiKeyKey; @Bean - @ConditionalOnProperty(name = "openAPIPetstore.security.apiKey.key") + @ConditionalOnProperty(name = "openapipetstore.security.apiKey.key") public ApiKeyRequestInterceptor apiKeyRequestInterceptor() { return new ApiKeyRequestInterceptor("header", "api_key", this.apiKeyKey); } @Bean - @ConditionalOnProperty("openAPIPetstore.security.petstoreAuth.client-id") + @ConditionalOnProperty("openapipetstore.security.petstoreAuth.client-id") public OAuth2FeignRequestInterceptor petstoreAuthRequestInterceptor() { return new OAuth2FeignRequestInterceptor(new DefaultOAuth2ClientContext(), petstoreAuthResourceDetails()); } @Bean - @ConditionalOnProperty("openAPIPetstore.security.petstoreAuth.client-id") - @ConfigurationProperties("openAPIPetstore.security.petstoreAuth") + @ConditionalOnProperty("openapipetstore.security.petstoreAuth.client-id") + @ConfigurationProperties("openapipetstore.security.petstoreAuth") public ImplicitResourceDetails petstoreAuthResourceDetails() { ImplicitResourceDetails details = new ImplicitResourceDetails(); details.setUserAuthorizationUri("http://petstore.swagger.io/api/oauth/dialog"); From 8b44c9dff17a2580d4da5da4c69d92d3bf5417be Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 3 Aug 2019 01:30:49 +0800 Subject: [PATCH 41/75] update spring samples --- .../configuration/ClientConfiguration.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/configuration/ClientConfiguration.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/configuration/ClientConfiguration.java index abf7e746252..3a24985dcd2 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/configuration/ClientConfiguration.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/configuration/ClientConfiguration.java @@ -22,24 +22,24 @@ import org.springframework.security.oauth2.common.exceptions.OAuth2Exception; @EnableConfigurationProperties public class ClientConfiguration { - @Value("${openAPIPetstore.security.apiKey.key:}") + @Value("${openapipetstore.security.apiKey.key:}") private String apiKeyKey; @Bean - @ConditionalOnProperty(name = "openAPIPetstore.security.apiKey.key") + @ConditionalOnProperty(name = "openapipetstore.security.apiKey.key") public ApiKeyRequestInterceptor apiKeyRequestInterceptor() { return new ApiKeyRequestInterceptor("header", "api_key", this.apiKeyKey); } @Bean - @ConditionalOnProperty("openAPIPetstore.security.petstoreAuth.client-id") + @ConditionalOnProperty("openapipetstore.security.petstoreAuth.client-id") public OAuth2FeignRequestInterceptor petstoreAuthRequestInterceptor() { return new OAuth2FeignRequestInterceptor(new DefaultOAuth2ClientContext(), petstoreAuthResourceDetails()); } @Bean - @ConditionalOnProperty("openAPIPetstore.security.petstoreAuth.client-id") - @ConfigurationProperties("openAPIPetstore.security.petstoreAuth") + @ConditionalOnProperty("openapipetstore.security.petstoreAuth.client-id") + @ConfigurationProperties("openapipetstore.security.petstoreAuth") public ImplicitResourceDetails petstoreAuthResourceDetails() { ImplicitResourceDetails details = new ImplicitResourceDetails(); details.setUserAuthorizationUri("http://petstore.swagger.io/api/oauth/dialog"); From 480d6baf3bc18f0b033c869a0e7f0d07da3bb1ae Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 3 Aug 2019 14:54:18 +0800 Subject: [PATCH 42/75] Add @meganemura @dkliban as the template creator of Ruby Faraday client (#3544) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3051212965b..1b7ed36b8c4 100644 --- a/README.md +++ b/README.md @@ -684,6 +684,7 @@ Here is a list of template creators: * PHP (Guzzle): @baartosz * PowerShell: @beatcracker * R: @ramnov + * Ruby (Faraday): @meganemura @dkliban * Rust: @farcaller * Rust (rust-server): @metaswitch * Scala (scalaz & http4s): @tbrown1979 From 86228e99645befad62ccc5879945e331e0c8c5b2 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 3 Aug 2019 16:36:22 +0800 Subject: [PATCH 43/75] [Ruby] remove auto-generated Gemfile.lock (#3541) * remove auto-generated gemlock file * update test file to conform to rubocop format --- .../codegen/languages/RubyClientCodegen.java | 1 - .../ruby-client/Gemfile.lock.mustache | 79 ------------------- .../ruby-faraday/spec/custom/pet_spec.rb | 2 +- .../ruby-faraday/spec/petstore_helper.rb | 2 - 4 files changed, 1 insertion(+), 83 deletions(-) delete mode 100644 modules/openapi-generator/src/main/resources/ruby-client/Gemfile.lock.mustache diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java index 0b1b59b98df..0a771696067 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java @@ -237,7 +237,6 @@ public class RubyClientCodegen extends AbstractRubyCodegen { if (TYPHOEUS.equals(getLibrary())) { supportingFiles.add(new SupportingFile("api_client.mustache", gemFolder, "api_client.rb")); - supportingFiles.add(new SupportingFile("Gemfile.lock.mustache", "", "Gemfile.lock")); } else if (FARADAY.equals(getLibrary())) { supportingFiles.add(new SupportingFile("faraday_api_client.mustache", gemFolder, "api_client.rb")); additionalProperties.put("isFaraday", Boolean.TRUE); diff --git a/modules/openapi-generator/src/main/resources/ruby-client/Gemfile.lock.mustache b/modules/openapi-generator/src/main/resources/ruby-client/Gemfile.lock.mustache deleted file mode 100644 index bf18a06ea83..00000000000 --- a/modules/openapi-generator/src/main/resources/ruby-client/Gemfile.lock.mustache +++ /dev/null @@ -1,79 +0,0 @@ -PATH - remote: . - specs: - {{gemName}}{{^gemName}}{{{appName}}}{{/gemName}} ({{gemVersion}}) - json (~> 2.1, >= 2.1.0) - typhoeus (~> 1.0, >= 1.0.1) - -GEM - remote: https://rubygems.org/ - specs: - ZenTest (4.11.2) - addressable (2.5.2) - public_suffix (>= 2.0.2, < 4.0) - autotest (4.4.6) - ZenTest (>= 4.4.1) - autotest-fsevent (0.2.14) - sys-uname - autotest-growl (0.2.16) - autotest-rails-pure (4.1.2) - byebug (10.0.2) - coderay (1.1.2) - crack (0.4.3) - safe_yaml (~> 1.0.0) - diff-lcs (1.3) - ethon (0.11.0) - ffi (>= 1.3.0) - ffi (1.9.25) - hashdiff (0.3.7) - json (2.1.0) - method_source (0.9.0) - pry (0.11.3) - coderay (~> 1.1.0) - method_source (~> 0.9.0) - pry-byebug (3.6.0) - byebug (~> 10.0) - pry (~> 0.10) - public_suffix (3.0.3) - rake (12.0.0) - rspec (3.8.0) - rspec-core (~> 3.8.0) - rspec-expectations (~> 3.8.0) - rspec-mocks (~> 3.8.0) - rspec-core (3.8.0) - rspec-support (~> 3.8.0) - rspec-expectations (3.8.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-mocks (3.8.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-support (3.8.0) - safe_yaml (1.0.4) - sys-uname (1.0.3) - ffi (>= 1.0.0) - typhoeus (1.3.0) - ethon (>= 0.9.0) - vcr (3.0.3) - webmock (1.24.6) - addressable (>= 2.3.6) - crack (>= 0.3.2) - hashdiff - -PLATFORMS - ruby - -DEPENDENCIES - autotest (~> 4.4, >= 4.4.6) - autotest-fsevent (~> 0.2, >= 0.2.12) - autotest-growl (~> 0.2, >= 0.2.16) - autotest-rails-pure (~> 4.1, >= 4.1.2) - {{gemName}}{{^gemName}}{{{appName}}}{{/gemName}}! - pry-byebug - rake (~> 12.0.0) - rspec (~> 3.6, >= 3.6.0) - vcr (~> 3.0, >= 3.0.1) - webmock (~> 1.24, >= 1.24.3) - -BUNDLED WITH - 1.16.1 diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/custom/pet_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/custom/pet_spec.rb index c56be964a2f..da8ab7aca57 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/custom/pet_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/custom/pet_spec.rb @@ -79,7 +79,7 @@ describe "Pet" do rescue Petstore::ApiError => e expect(e.code).to eq(404) # skip the check as the response contains a timestamp that changes on every reponse - #expect(e.message).to eq("Error message: the server returns an error\nHTTP status code: 404\nResponse headers: {\"Date\"=>\"Tue, 26 Feb 2019 04:35:40 GMT\", \"Access-Control-Allow-Origin\"=>\"*\", \"Access-Control-Allow-Methods\"=>\"GET, POST, DELETE, PUT\", \"Access-Control-Allow-Headers\"=>\"Content-Type, api_key, Authorization\", \"Content-Type\"=>\"application/json\", \"Connection\"=>\"close\", \"Server\"=>\"Jetty(9.2.9.v20150224)\"}\nResponse body: {\"code\":1,\"type\":\"error\",\"message\":\"Pet not found\"}") + # expect(e.message).to eq("Error message: the server returns an error\nHTTP status code: 404\nResponse headers: {\"Date\"=>\"Tue, 26 Feb 2019 04:35:40 GMT\", \"Access-Control-Allow-Origin\"=>\"*\", \"Access-Control-Allow-Methods\"=>\"GET, POST, DELETE, PUT\", \"Access-Control-Allow-Headers\"=>\"Content-Type, api_key, Authorization\", \"Content-Type\"=>\"application/json\", \"Connection\"=>\"close\", \"Server\"=>\"Jetty(9.2.9.v20150224)\"}\nResponse body: {\"code\":1,\"type\":\"error\",\"message\":\"Pet not found\"}") expect(e.response_body).to eq('{"code":1,"type":"error","message":"Pet not found"}') expect(e.response_headers).to include('Content-Type') expect(e.response_headers['Content-Type']).to eq('application/json') diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/petstore_helper.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/petstore_helper.rb index 96b0711cec5..8ce74cf4252 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/petstore_helper.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/petstore_helper.rb @@ -48,5 +48,3 @@ def deserialize_json(s, type) response = double('response', headers: headers, body: s) API_CLIENT.deserialize(response, type) end - - From 6963e5eeb0a441cdeea5d4750903a8ac11861a7f Mon Sep 17 00:00:00 2001 From: Richard Whitehouse Date: Sun, 4 Aug 2019 12:54:24 +0100 Subject: [PATCH 44/75] [Rust Server] Support multipart/form_data request bodies (#2846) [Rust Server] Support multipart/form_data - Support multipart/form_data in the Rust Server - Add a new test API to test the change. - Update the examples to match --- .../codegen/languages/RustServerCodegen.java | 7 +- .../main/resources/rust-server/Cargo.mustache | 4 +- .../resources/rust-server/client-mod.mustache | 145 ++++- .../main/resources/rust-server/lib.mustache | 1 + .../resources/rust-server/server-mod.mustache | 248 ++++++-- .../3_0/rust-server/multipart-v3.yaml | 51 ++ .../resources/3_0/rust-server/openapi-v3.yaml | 17 +- .../output/multipart-v3/.cargo/config | 18 + .../output/multipart-v3/.gitignore | 2 + .../multipart-v3/.openapi-generator-ignore | 23 + .../multipart-v3/.openapi-generator/VERSION | 1 + .../output/multipart-v3/Cargo.toml | 48 ++ .../rust-server/output/multipart-v3/README.md | 128 ++++ .../output/multipart-v3/api/openapi.yaml | 47 ++ .../multipart-v3/docs/MultipartRequest.md | 13 + .../docs/MultipartRequestObjectField.md | 11 + .../output/multipart-v3/docs/default_api.md | 46 ++ .../output/multipart-v3/examples/ca.pem | 17 + .../output/multipart-v3/examples/client.rs | 82 +++ .../multipart-v3/examples/server-chain.pem | 66 +++ .../multipart-v3/examples/server-key.pem | 28 + .../output/multipart-v3/examples/server.rs | 75 +++ .../multipart-v3/examples/server_lib/mod.rs | 37 ++ .../examples/server_lib/server.rs | 38 ++ .../output/multipart-v3/src/client/mod.rs | 417 +++++++++++++ .../output/multipart-v3/src/lib.rs | 101 ++++ .../output/multipart-v3/src/mimetypes.rs | 17 + .../output/multipart-v3/src/models.rs | 63 ++ .../output/multipart-v3/src/server/context.rs | 91 +++ .../output/multipart-v3/src/server/mod.rs | 277 +++++++++ .../rust-server/output/openapi-v3/Cargo.toml | 4 +- .../rust-server/output/openapi-v3/README.md | 2 + .../output/openapi-v3/api/openapi.yaml | 9 + .../output/openapi-v3/docs/default_api.md | 23 + .../output/openapi-v3/examples/client.rs | 7 + .../openapi-v3/examples/server_lib/server.rs | 8 + .../output/openapi-v3/src/client/mod.rs | 120 +++- .../rust-server/output/openapi-v3/src/lib.rs | 18 + .../output/openapi-v3/src/mimetypes.rs | 4 + .../output/openapi-v3/src/server/mod.rs | 151 ++--- .../Cargo.toml | 4 +- .../src/client/mod.rs | 191 +++--- .../src/lib.rs | 1 + .../src/server/mod.rs | 554 +++--------------- .../output/rust-server-test/Cargo.toml | 4 +- .../output/rust-server-test/src/client/mod.rs | 21 +- .../output/rust-server-test/src/lib.rs | 1 + .../output/rust-server-test/src/server/mod.rs | 72 +-- 48 files changed, 2421 insertions(+), 892 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/rust-server/multipart-v3.yaml create mode 100644 samples/server/petstore/rust-server/output/multipart-v3/.cargo/config create mode 100644 samples/server/petstore/rust-server/output/multipart-v3/.gitignore create mode 100644 samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator-ignore create mode 100644 samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION create mode 100644 samples/server/petstore/rust-server/output/multipart-v3/Cargo.toml create mode 100644 samples/server/petstore/rust-server/output/multipart-v3/README.md create mode 100644 samples/server/petstore/rust-server/output/multipart-v3/api/openapi.yaml create mode 100644 samples/server/petstore/rust-server/output/multipart-v3/docs/MultipartRequest.md create mode 100644 samples/server/petstore/rust-server/output/multipart-v3/docs/MultipartRequestObjectField.md create mode 100644 samples/server/petstore/rust-server/output/multipart-v3/docs/default_api.md create mode 100644 samples/server/petstore/rust-server/output/multipart-v3/examples/ca.pem create mode 100644 samples/server/petstore/rust-server/output/multipart-v3/examples/client.rs create mode 100644 samples/server/petstore/rust-server/output/multipart-v3/examples/server-chain.pem create mode 100644 samples/server/petstore/rust-server/output/multipart-v3/examples/server-key.pem create mode 100644 samples/server/petstore/rust-server/output/multipart-v3/examples/server.rs create mode 100644 samples/server/petstore/rust-server/output/multipart-v3/examples/server_lib/mod.rs create mode 100644 samples/server/petstore/rust-server/output/multipart-v3/examples/server_lib/server.rs create mode 100644 samples/server/petstore/rust-server/output/multipart-v3/src/client/mod.rs create mode 100644 samples/server/petstore/rust-server/output/multipart-v3/src/lib.rs create mode 100644 samples/server/petstore/rust-server/output/multipart-v3/src/mimetypes.rs create mode 100644 samples/server/petstore/rust-server/output/multipart-v3/src/models.rs create mode 100644 samples/server/petstore/rust-server/output/multipart-v3/src/server/context.rs create mode 100644 samples/server/petstore/rust-server/output/multipart-v3/src/server/mod.rs diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java index dfbb7eab35d..9f8e61ead37 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java @@ -709,6 +709,9 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { consumesPlainText = true; } else if (isMimetypeWwwFormUrlEncoded(mediaType)) { additionalProperties.put("usesUrlEncodedForm", true); + } else if (isMimetypeMultipartFormData(mediaType)) { + op.vendorExtensions.put("consumesMultipart", true); + additionalProperties.put("apiUsesMultipart", true); } } } @@ -724,8 +727,8 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { } else { op.bodyParam.vendorExtensions.put("consumesJson", true); } - } + for (CodegenParameter param : op.bodyParams) { processParam(param, op); @@ -789,6 +792,8 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig { codegenParameter.isPrimitiveType = false; codegenParameter.isListContainer = false; codegenParameter.isString = false; + codegenParameter.isByteArray = ModelUtils.isByteArraySchema(original_schema); + // This is a model, so should only have an example if explicitly // defined. diff --git a/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache b/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache index bf43a520c29..2bd053e1b69 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/Cargo.mustache @@ -25,8 +25,8 @@ swagger = "2" # lazy_static = "0.2" log = "0.3.0" -mime = "0.3.3" -multipart = {version = "0.13.3", optional = true} +mime = "0.2.6" +multipart = {version = "0.13.3"} native-tls = {version = "0.1.4", optional = true} openssl = {version = "0.9.14", optional = true} percent-encoding = {version = "1.0.0", optional = true} diff --git a/modules/openapi-generator/src/main/resources/rust-server/client-mod.mustache b/modules/openapi-generator/src/main/resources/rust-server/client-mod.mustache index aea03b15c6d..f09a9c09a6e 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/client-mod.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/client-mod.mustache @@ -6,9 +6,16 @@ extern crate openssl; extern crate mime; extern crate chrono; extern crate url; -{{#usesUrlEncodedForm}}extern crate serde_urlencoded;{{/usesUrlEncodedForm}} +{{#usesUrlEncodedForm}} +extern crate serde_urlencoded; +{{/usesUrlEncodedForm}} +{{#apiUsesMultipart}} +extern crate multipart; +{{/apiUsesMultipart}} -{{#apiUsesUuid}}use uuid;{{/apiUsesUuid}} +{{#apiUsesUuid}} +use uuid; +{{/apiUsesUuid}} use hyper; use hyper::header::{Headers, ContentType}; use hyper::Uri; @@ -26,11 +33,16 @@ use std::sync::Arc; use std::str; use std::str::FromStr; use std::string::ToString; - +{{#apiUsesMultipart}} +use hyper::mime::Mime; +use std::io::Cursor; +use client::multipart::client::lazy::Multipart; +{{/apiUsesMultipart}} use mimetypes; - use serde_json; -{{#usesXml}}use serde_xml_rs;{{/usesXml}} +{{#usesXml}} +use serde_xml_rs; +{{/usesXml}} #[allow(unused_imports)] use std::collections::{HashMap, BTreeMap}; @@ -275,15 +287,93 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::{{#vendorExtensions}}{{{HttpMethod}}}{{/vendorExtensions}}, uri); -{{#vendorExtensions}}{{#formParams}}{{#-first}} let params = &[{{/-first}} - ("{{{baseName}}}", {{#vendorExtensions}}{{#required}}Some({{#isString}}param_{{{paramName}}}{{/isString}}{{^isString}}format!("{:?}", param_{{{paramName}}}){{/isString}}){{/required}}{{^required}}{{#isString}}param_{{{paramName}}}{{/isString}}{{^isString}}param_{{{paramName}}}.map(|param| format!("{:?}", param)){{/isString}}{{/required}}),{{/vendorExtensions}}{{#-last}} +{{#vendorExtensions}} + {{#consumesMultipart}} + let mut multipart = Multipart::new(); + + {{#vendorExtensions}} + {{#formParams}} + {{#-first}} + // For each parameter, encode as appropriate and add to the multipart body as a stream. + {{/-first}} + {{^isByteArray}} + {{#jsonSchema}} + + let {{{paramName}}}_str = match serde_json::to_string(¶m_{{{paramName}}}) { + Ok(str) => str, + Err(e) => return Box::new(futures::done(Err(ApiError(format!("Unable to parse {{{paramName}}} to string: {}", e))))), + }; + + let {{{paramName}}}_vec = {{{paramName}}}_str.as_bytes().to_vec(); + + let {{{paramName}}}_mime = mime::Mime::from_str("application/json").expect("impossible to fail to parse"); + + let {{{paramName}}}_cursor = Cursor::new({{{paramName}}}_vec); + + multipart.add_stream("{{{paramName}}}", {{{paramName}}}_cursor, None as Option<&str>, Some({{{paramName}}}_mime)); + + {{/jsonSchema}} + {{/isByteArray}} + {{#isByteArray}} + + let {{{paramName}}}_vec = param_{{{paramName}}}.to_vec(); + + let {{{paramName}}}_mime = match mime::Mime::from_str("application/octet-stream") { + Ok(mime) => mime, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to get mime type: {:?}", err))))), + }; + + let {{{paramName}}}_cursor = Cursor::new({{{paramName}}}_vec); + + let filename = None as Option<&str> ; + multipart.add_stream("{{{paramName}}}", {{{paramName}}}_cursor, filename, Some({{{paramName}}}_mime)); + + {{/isByteArray}} + {{#-last}} + {{/-last}} + {{/formParams}} + {{/vendorExtensions}} + + let mut fields = match multipart.prepare() { + Ok(fields) => fields, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build request: {}", err))))), + }; + + let mut body_string = String::new(); + fields.to_body().read_to_string(&mut body_string).unwrap(); + let boundary = fields.boundary(); + + let multipart_header = match Mime::from_str(&format!("multipart/form-data;boundary={}", boundary)) { + Ok(multipart_header) => multipart_header, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build multipart header: {:?}", err))))), + }; + + request.set_body(body_string.into_bytes()); + request.headers_mut().set(ContentType(multipart_header)); + + {{/consumesMultipart}} +{{/vendorExtensions}} +{{#vendorExtensions}} + {{^consumesMultipart}} + {{#vendorExtensions}} + {{#formParams}} + {{#-first}} + let params = &[ + {{/-first}} + ("{{{baseName}}}", {{#vendorExtensions}}{{#required}}Some({{#isString}}param_{{{paramName}}}{{/isString}}{{^isString}}format!("{:?}", param_{{{paramName}}}){{/isString}}){{/required}}{{^required}}{{#isString}}param_{{{paramName}}}{{/isString}}{{^isString}}param_{{{paramName}}}.map(|param| format!("{:?}", param)){{/isString}}{{/required}}),{{/vendorExtensions}} + {{#-last}} ]; let body = serde_urlencoded::to_string(params).expect("impossible to fail to serialize"); request.headers_mut().set(ContentType(mimetypes::requests::{{#vendorExtensions}}{{{uppercase_operation_id}}}{{/vendorExtensions}}.clone())); - request.set_body(body.into_bytes());{{/-last}}{{/formParams}}{{/vendorExtensions}}{{#bodyParam}}{{#-first}} + request.set_body(body.into_bytes()); + {{/-last}} + {{/formParams}} + {{/vendorExtensions}} + {{#bodyParam}} + {{#-first}} // Body parameter - {{/-first}} + {{/-first}} {{#vendorExtensions}} {{#consumesPlainText}} {{#isByteArray}} @@ -312,34 +402,51 @@ impl Api for Client where }); {{/required}} {{/vendorExtensions}} - {{/bodyParam}} + {{^required}} -{{#bodyParam}}{{^required}}if let Some(body) = body { - {{/required}} request.set_body(body); -{{^required}} }{{/required}} + if let Some(body) = body { +{{/required}} + request.set_body(body); +{{^required}} + } +{{/required}} request.headers_mut().set(ContentType(mimetypes::requests::{{#vendorExtensions}}{{{uppercase_operation_id}}}{{/vendorExtensions}}.clone())); -{{/bodyParam}} + {{/bodyParam}} + {{/consumesMultipart}} +{{/vendorExtensions}} + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); -{{#authMethods}}{{#isBasic}} if let Some(auth_data) = (context as &Has>).get().as_ref() { +{{#authMethods}} + {{#isBasic}} + if let Some(auth_data) = (context as &Has>).get().as_ref() { if let AuthData::Basic(ref basic_header) = *auth_data { request.headers_mut().set(hyper::header::Authorization( basic_header.clone(), )) } - }{{/isBasic}}{{#isApiKey}}{{#isKeyInHeader}} header! { ({{#vendorExtensions}}{{x-apiKeyName}}{{/vendorExtensions}}, "{{keyParamName}}") => [String] } + } + {{/isBasic}} + {{#isApiKey}} + {{#isKeyInHeader}} + header! { ({{#vendorExtensions}}{{x-apiKeyName}}{{/vendorExtensions}}, "{{keyParamName}}") => [String] } if let Some(auth_data) = (context as &Has>).get().as_ref() { if let AuthData::ApiKey(ref api_key) = *auth_data { request.headers_mut().set({{#vendorExtensions}}{{x-apiKeyName}}{{/vendorExtensions}}(api_key.to_string())); } - }{{/isKeyInHeader}}{{/isApiKey}}{{/authMethods}}{{#headerParams}}{{#-first}} + } + {{/isKeyInHeader}} + {{/isApiKey}} +{{/authMethods}} +{{#headerParams}} +{{#-first}} // Header parameters {{/-first}}{{^isMapContainer}} header! { (Request{{vendorExtensions.typeName}}, "{{{baseName}}}") => {{#isListContainer}}({{{baseType}}})*{{/isListContainer}}{{^isListContainer}}[{{{dataType}}}]{{/isListContainer}} } {{#required}} request.headers_mut().set(Request{{vendorExtensions.typeName}}(param_{{{paramName}}}{{#isListContainer}}.clone(){{/isListContainer}})); {{/required}}{{^required}} param_{{{paramName}}}.map(|header| request.headers_mut().set(Request{{vendorExtensions.typeName}}(header{{#isListContainer}}.clone(){{/isListContainer}}))); {{/required}}{{/isMapContainer}}{{#isMapContainer}} let param_{{{paramName}}}: Option<{{{dataType}}}> = None; -{{/isMapContainer}}{{/headerParams}} - +{{/isMapContainer}} +{{/headerParams}} Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { diff --git a/modules/openapi-generator/src/main/resources/rust-server/lib.mustache b/modules/openapi-generator/src/main/resources/rust-server/lib.mustache index c163280799e..b1c055176ff 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/lib.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/lib.mustache @@ -11,6 +11,7 @@ extern crate chrono; extern crate lazy_static; #[macro_use] extern crate log; +extern crate mime; // Logically this should be in the client and server modules, but rust doesn't allow `macro_use` from a module. #[cfg(any(feature = "client", feature = "server"))] diff --git a/modules/openapi-generator/src/main/resources/rust-server/server-mod.mustache b/modules/openapi-generator/src/main/resources/rust-server/server-mod.mustache index 2aea9c00ae8..2c6ea131ba3 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/server-mod.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/server-mod.mustache @@ -5,12 +5,16 @@ extern crate native_tls; extern crate hyper_tls; extern crate openssl; extern crate mime; -{{^apiUsesUuid}}extern crate uuid;{{/apiUsesUuid}} extern crate chrono; extern crate percent_encoding; extern crate url; +{{^apiUsesUuid}} +extern crate uuid; +{{/apiUsesUuid}} +{{#apiUsesMultipart}} +extern crate multipart; +{{/apiUsesMultipart}} -{{#apiUsesUuid}}use uuid;{{/apiUsesUuid}} use std::sync::Arc; use std::marker::PhantomData; use futures::{Future, future, Stream, stream}; @@ -19,9 +23,18 @@ use hyper::{Request, Response, Error, StatusCode}; use hyper::header::{Headers, ContentType}; use self::url::form_urlencoded; use mimetypes; - +{{#apiUsesMultipart}} +use self::multipart::server::Multipart; +use self::multipart::server::save::SaveResult; +use std::fs; +{{/apiUsesMultipart}} use serde_json; -{{#usesXml}}use serde_xml_rs;{{/usesXml}} +{{#usesXml}} +use serde_xml_rs; +{{/usesXml}} +{{#apiUsesUuid}} +use uuid; +{{/apiUsesUuid}} #[allow(unused_imports)] use std::collections::{HashMap, BTreeMap}; @@ -165,8 +178,14 @@ where {{/authMethods}} } {{/hasAuthMethods}} - -{{#vendorExtensions}}{{#hasPathParams}} +{{#vendorExtensions}} + {{#consumesMultipart}} + let boundary = match multipart_boundary(&headers) { + Some(boundary) => boundary.to_string(), + None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body("Couldn't find valid multipart body"))), + }; + {{/consumesMultipart}} + {{#hasPathParams}} // Path parameters let path = uri.path().to_string(); let path_params = @@ -175,7 +194,8 @@ where .unwrap_or_else(|| panic!("Path {} matched RE {{{PATH_ID}}} in set but failed match against \"{}\"", path, paths::REGEX_{{{PATH_ID}}}.as_str()) ); -{{/hasPathParams}}{{/vendorExtensions}} + {{/hasPathParams}} +{{/vendorExtensions}} {{#pathParams}} let param_{{{paramName}}} = match percent_encoding::percent_decode(path_params["{{{baseName}}}"].as_bytes()).decode_utf8() { Ok(param_{{{paramName}}}) => match param_{{{paramName}}}.parse::<{{{dataType}}}>() { @@ -185,36 +205,39 @@ where Err(_) => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't percent-decode path parameter as UTF-8: {}", &path_params["{{{baseName}}}"])))) }; {{/pathParams}} -{{#headerParams}}{{#-first}} +{{#headerParams}} + {{#-first}} // Header parameters -{{/-first}} + {{/-first}} header! { (Request{{vendorExtensions.typeName}}, "{{{baseName}}}") => {{#isListContainer}}({{{baseType}}})*{{/isListContainer}}{{^isListContainer}}[{{{dataType}}}]{{/isListContainer}} } -{{#required}} + {{#required}} let param_{{{paramName}}} = match headers.get::() { Some(param_{{{paramName}}}) => param_{{{paramName}}}.0.clone(), None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body("Missing or invalid required header {{{baseName}}}"))), }; -{{/required}} -{{^required}} + {{/required}} + {{^required}} let param_{{{paramName}}} = headers.get::().map(|header| header.0.clone()); -{{/required}}{{/headerParams}} - -{{#queryParams}}{{#-first}} + {{/required}} +{{/headerParams}} +{{#queryParams}} + {{#-first}} // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = form_urlencoded::parse(uri.query().unwrap_or_default().as_bytes()).collect::>(); -{{/-first}} + {{/-first}} let param_{{{paramName}}} = query_params.iter().filter(|e| e.0 == "{{{baseName}}}").map(|e| e.1.to_owned()) -{{#isListContainer}} + {{#isListContainer}} .filter_map(|param_{{{paramName}}}| param_{{{paramName}}}.parse::<{{{baseType}}}>().ok()) .collect::>(); -{{^required}} + {{^required}} let param_{{{paramName}}} = if !param_{{{paramName}}}.is_empty() { Some(param_{{{paramName}}}) } else { None }; -{{/required}} -{{/isListContainer}}{{^isListContainer}} + {{/required}} +{{/isListContainer}} +{{^isListContainer}} .nth(0); {{#required}} let param_{{{paramName}}} = match param_{{{paramName}}} { @@ -229,8 +252,10 @@ where {{/required}} {{/isListContainer}} {{/queryParams}} - -{{#bodyParams}}{{#-first}} +{{#vendorExtensions}} + {{^consumesMultipart}} + {{#bodyParams}} + {{#-first}} // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -238,53 +263,147 @@ where .then(move |result| -> Box> { match result { Ok(body) => { -{{#vendorExtensions}}{{^consumesPlainText}} + {{#vendorExtensions}} + {{^consumesPlainText}} let mut unused_elements = Vec::new(); -{{/consumesPlainText}} + {{/consumesPlainText}} let param_{{{paramName}}}: Option<{{{dataType}}}> = if !body.is_empty() { -{{#consumesXml}} + {{#consumesXml}} let deserializer = &mut serde_xml_rs::de::Deserializer::new_from_reader(&*body); -{{/consumesXml}}{{#consumesJson}} + {{/consumesXml}} + {{#consumesJson}} let deserializer = &mut serde_json::Deserializer::from_slice(&*body); -{{/consumesJson}}{{^consumesPlainText}} + {{/consumesJson}} + {{^consumesPlainText}} match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); }) { Ok(param_{{{paramName}}}) => param_{{{paramName}}}, -{{#required}} + {{#required}} Err(e) => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't parse body parameter {{{baseName}}} - doesn't match schema: {}", e)))), -{{/required}}{{^required}} + {{/required}} + {{^required}} Err(_) => None, -{{/required}} + {{/required}} } -{{/consumesPlainText}}{{#consumesPlainText}} -{{#isByteArray}} + {{/consumesPlainText}} + {{#consumesPlainText}} + {{#isByteArray}} Some(swagger::ByteArray(body.to_vec())) -{{/isByteArray}} -{{#isString}} + {{/isByteArray}} + {{#isString}} Some(String::from_utf8(body.to_vec()).unwrap()) -{{/isString}} -{{/consumesPlainText}}{{/vendorExtensions}} + {{/isString}} + {{/consumesPlainText}} + {{/vendorExtensions}} } else { None }; -{{#required}} + {{#required}} let param_{{{paramName}}} = match param_{{{paramName}}} { Some(param_{{{paramName}}}) => param_{{{paramName}}}, None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body("Missing required body parameter {{{baseName}}}"))), }; -{{/required}} -{{/-first}}{{/bodyParams}} -{{^bodyParams}}{{#vendorExtensions}} + {{/required}} + {{/-first}} + {{/bodyParams}} + {{/consumesMultipart}} + {{#consumesMultipart}} + {{^bodyParams}} + {{#vendorExtensions}} + // Form Body parameters (note that non-required body parameters will ignore garbage + // values, rather than causing a 400 response). Produce warning header and logs for + // any unused fields. + Box::new(body.concat2() + .then(move |result| -> Box> { + match result { + Ok(body) => { + // Read Form Parameters from body + let mut entries = match Multipart::with_body(&body.to_vec()[..], boundary).save().temp() { + SaveResult::Full(entries) => { + entries + }, + _ => { + return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Unable to process all message parts")))) + }, + }; + {{#formParams}}{{#-first}}{{/-first}} + {{#isByteArray}} + let file_{{{paramName}}} = entries.files.remove("{{{paramName}}}"); + {{#required}} + let param_{{{paramName}}} = match file_{{{paramName}}} { + Some(file) => { + let path = &file[0].path; + let {{{paramName}}}_str = fs::read_to_string(path).unwrap(); + swagger::ByteArray({{{paramName}}}_str.as_bytes().to_vec()) + } + None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Missing required form parameter {{{paramName}}}")))), + }; + {{/required}} + {{^required}} + let param_{{{paramName}}} = match file_{{{paramName}}} { + Some(file) => { + let path = &file[0].path; + let {{{paramName}}}_str = fs::read_to_string(path).unwrap(); + Some(swagger::ByteArray({{{paramName}}}_str.as_bytes().to_vec())) + } + None => None, + }; + {{/required}} + {{/isByteArray}} + {{^isByteArray}}{{#jsonSchema}} + let file_{{{paramName}}} = entries.files.remove("{{{paramName}}}"); + {{#required}} + let param_{{{paramName}}} = match file_{{{paramName}}} { + Some(file) => { + let path = &file[0].path; + let {{{paramName}}}_str = fs::read_to_string(path).expect("Reading saved String should never fail"); + let {{{paramName}}}_model: {{{dataType}}} = match serde_json::from_str(&{{{paramName}}}_str) { + Ok(model) => model, + Err(e) => { + return Box::new(future::ok( + Response::new() + .with_status(StatusCode::BadRequest) + .with_body(format!("{{{paramName}}} data does not match API definition: {}", e)))) + } + }; + {{{paramName}}}_model + } + None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Missing required form parameter {{{paramName}}}")))), + }; + {{/required}} + {{^required}} + let param_{{{paramName}}} = match file_{{{paramName}}} { + Some(file) => { + let path = &file[0].path; + let {{{paramName}}}_str = fs::read_to_string(path).unwrap(); + let {{{paramName}}}_model: {{{dataType}}} = serde_json::from_str(&{{{paramName}}}_str).expect("Impossible to fail to serialise"); + Some({{{paramName}}}_model) + } + None => None, + }; + {{/required}} + {{/jsonSchema}}{{/isByteArray}} + {{/formParams}} + {{/vendorExtensions}} + {{/bodyParams}} + {{/consumesMultipart}} + {{^consumesMultipart}} + {{^bodyParams}} + {{#vendorExtensions}} Box::new({ {{ -{{#formParams}}{{#-first}} + {{#formParams}} + {{#-first}} // Form parameters -{{/-first}} + {{/-first}} let param_{{{paramName}}} = {{^isContainer}}{{#vendorExtensions}}{{{example}}};{{/vendorExtensions}}{{/isContainer}}{{#isListContainer}}{{#required}}Vec::new();{{/required}}{{^required}}None;{{/required}}{{/isListContainer}}{{#isMapContainer}}None;{{/isMapContainer}} -{{/formParams}} -{{/vendorExtensions}}{{/bodyParams}} + {{/formParams}} + {{/vendorExtensions}} + {{/bodyParams}} + {{/consumesMultipart}} +{{/vendorExtensions}} Box::new(api_impl.{{#vendorExtensions}}{{{operation_id}}}{{/vendorExtensions}}({{#allParams}}param_{{{paramName}}}{{#isListContainer}}.as_ref(){{/isListContainer}}, {{/allParams}}&context) .then(move |result| { let mut response = Response::new(); @@ -356,19 +475,36 @@ where future::ok(response) } )) -{{^bodyParams}}{{#vendorExtensions}} +{{#vendorExtensions}} + {{^consumesMultipart}} + {{^bodyParams}} }} }) as Box> -{{/vendorExtensions}}{{/bodyParams}} -{{#bodyParams}}{{#-first}} + {{/bodyParams}} + {{/consumesMultipart}} +{{/vendorExtensions}} +{{#bodyParams}} + {{#-first}} }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter {{{baseName}}}: {}", e)))), } }) ) as Box> -{{/-first}}{{/bodyParams}} + {{/-first}} +{{/bodyParams}} +{{#vendorExtensions}} + {{#consumesMultipart}} + {{^bodyParams}} + as Box> + }, + Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read multipart body")))), + } + }) + ) + {{/bodyParams}} + {{/consumesMultipart}} +{{/vendorExtensions}} }, - {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} _ => Box::new(future::ok(Response::new().with_status(StatusCode::NotFound))) as Box>, } @@ -385,6 +521,20 @@ impl Clone for Service } } +{{#apiUsesMultipart}} +/// Utility function to get the multipart boundary marker (if any) from the Headers. +fn multipart_boundary<'a>(headers: &'a Headers) -> Option<&'a str> { + headers.get::().and_then(|content_type| { + let ContentType(ref mime) = *content_type; + if mime.type_() == hyper::mime::MULTIPART && mime.subtype() == hyper::mime::FORM_DATA { + mime.get_param(hyper::mime::BOUNDARY).map(|x| x.as_str()) + } else { + None + } + }) +} +{{/apiUsesMultipart}} + /// Request parser for `Api`. pub struct ApiRequestParser; impl RequestParser for ApiRequestParser { diff --git a/modules/openapi-generator/src/test/resources/3_0/rust-server/multipart-v3.yaml b/modules/openapi-generator/src/test/resources/3_0/rust-server/multipart-v3.yaml new file mode 100644 index 00000000000..70c4e5d4602 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/rust-server/multipart-v3.yaml @@ -0,0 +1,51 @@ +# Test the multipart function of the OpenAPI specification +# +# Specifically, these tests include +# - multipart/form data including +# - binary data +# - string data +# - objects + +openapi: 3.0.1 +info: + title: Multipart OpenAPI V3 Rust Server Test + description: API under test + version: 1.0.7 +paths: + /multipart_request: + post: + requestBody: + required: true + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/multipart_request' + responses: + '201': + description: 'OK' +components: + schemas: + multipart_request: + type: object + required: + - string_field + - binary_field + properties: + string_field: + type: string + optional_string_field: + type: string + object_field: + type: object + required: + - field_a + properties: + field_a: + type: string + field_b: + type: array + items: + type: string + binary_field: + type: string + format: byte diff --git a/modules/openapi-generator/src/test/resources/3_0/rust-server/openapi-v3.yaml b/modules/openapi-generator/src/test/resources/3_0/rust-server/openapi-v3.yaml index 677a439f041..cef3e746ba0 100644 --- a/modules/openapi-generator/src/test/resources/3_0/rust-server/openapi-v3.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/rust-server/openapi-v3.yaml @@ -1,5 +1,7 @@ -# Test the mainline function of the XML part of the OpenAPI specification, -# as found here : https://swagger.io/docs/specification/data-models/representing-xml/ +# Test the mainline function of OpenAPI v3 specification. +# +# This includes the XML part of the OpenAPI specification, as found at +# https://swagger.io/docs/specification/data-models/representing-xml/ # # Specifically, these tests are intended to include: # - namespaces @@ -9,6 +11,8 @@ # - wrapping and renaming to and from camelCase and snake_case # - objects # - renaming to and from camelCase and snake_case +# - UUIDs +# - Octet Streams openapi: 3.0.1 info: @@ -76,6 +80,15 @@ paths: description: 'OK' '400': description: Bad Request + /uuid: + get: + responses: + 200: + description: Duplicate Response long text. One. + content: + application/json: + schema: + $ref: "#/components/schemas/UuidObject" /required_octet_stream: put: requestBody: diff --git a/samples/server/petstore/rust-server/output/multipart-v3/.cargo/config b/samples/server/petstore/rust-server/output/multipart-v3/.cargo/config new file mode 100644 index 00000000000..b8acc9c00c8 --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/.cargo/config @@ -0,0 +1,18 @@ +[build] +rustflags = [ + "-W", "missing_docs", # detects missing documentation for public members + + "-W", "trivial_casts", # detects trivial casts which could be removed + + "-W", "trivial_numeric_casts", # detects trivial casts of numeric types which could be removed + + "-W", "unsafe_code", # usage of `unsafe` code + + "-W", "unused_qualifications", # detects unnecessarily qualified names + + "-W", "unused_extern_crates", # extern crates that are never used + + "-W", "unused_import_braces", # unnecessary braces around an imported item + + "-D", "warnings", # all warnings should be denied +] diff --git a/samples/server/petstore/rust-server/output/multipart-v3/.gitignore b/samples/server/petstore/rust-server/output/multipart-v3/.gitignore new file mode 100644 index 00000000000..a9d37c560c6 --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/.gitignore @@ -0,0 +1,2 @@ +target +Cargo.lock diff --git a/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator-ignore b/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION new file mode 100644 index 00000000000..83a328a9227 --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/multipart-v3/Cargo.toml b/samples/server/petstore/rust-server/output/multipart-v3/Cargo.toml new file mode 100644 index 00000000000..8f4afb08ae7 --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/Cargo.toml @@ -0,0 +1,48 @@ +[package] +name = "multipart-v3" +version = "1.0.7" +authors = [] +description = "API under test" +license = "Unlicense" + +[features] +default = ["client", "server"] +client = ["serde_json", "serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "url", "uuid"] +server = ["serde_json", "serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "tokio-proto", "tokio-tls", "regex", "percent-encoding", "url", "uuid"] + +[dependencies] +# Required by example server. +# +chrono = { version = "0.4", features = ["serde"] } +futures = "0.1" +hyper = {version = "0.11", optional = true} +hyper-tls = {version = "0.1.2", optional = true} +swagger = "2" + +# Not required by example server. +# +lazy_static = "0.2" +log = "0.3.0" +mime = "0.2.6" +multipart = {version = "0.13.3"} +native-tls = {version = "0.1.4", optional = true} +openssl = {version = "0.9.14", optional = true} +percent-encoding = {version = "1.0.0", optional = true} +regex = {version = "0.2", optional = true} +serde = "1.0" +serde_derive = "1.0" +serde_ignored = {version = "0.0.4", optional = true} +serde_json = {version = "1.0", optional = true} +serde_urlencoded = {version = "0.5.1", optional = true} +tokio-core = {version = "0.1.6", optional = true} +tokio-proto = {version = "0.1.1", optional = true} +tokio-tls = {version = "0.1.3", optional = true, features = ["tokio-proto"]} +url = {version = "1.5", optional = true} +uuid = {version = "0.5", optional = true, features = ["serde", "v4"]} +# ToDo: this should be updated to point at the official crate once +# https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream + + +[dev-dependencies] +clap = "2.25" +error-chain = "0.12" diff --git a/samples/server/petstore/rust-server/output/multipart-v3/README.md b/samples/server/petstore/rust-server/output/multipart-v3/README.md new file mode 100644 index 00000000000..d9a4abd69a5 --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/README.md @@ -0,0 +1,128 @@ +# Rust API for multipart-v3 + +API under test + +## Overview +This client/server was generated by the [openapi-generator] +(https://openapi-generator.tech) project. +By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. +- + +To see how to make this your own, look here: + +[README]((https://openapi-generator.tech)) + +- API version: 1.0.7 + +This autogenerated project defines an API crate `multipart-v3` which contains: +* An `Api` trait defining the API in Rust. +* Data types representing the underlying data model. +* A `Client` type which implements `Api` and issues HTTP requests for each operation. +* A router which accepts HTTP requests and invokes the appropriate `Api` method for each operation. + +It also contains an example server and client which make use of `multipart-v3`: +* The example server starts up a web server using the `multipart-v3` router, + and supplies a trivial implementation of `Api` which returns failure for every operation. +* The example client provides a CLI which lets you invoke any single operation on the + `multipart-v3` client by passing appropriate arguments on the command line. + +You can use the example server and client as a basis for your own code. +See below for [more detail on implementing a server](#writing-a-server). + + +## Examples + +Run examples with: + +``` +cargo run --example +``` + +To pass in arguments to the examples, put them after `--`, for example: + +``` +cargo run --example client -- --help +``` + +### Running the server +To run the server, follow these simple steps: + +``` +cargo run --example server +``` + +### Running a client +To run a client, follow one of the following simple steps: + +``` +cargo run --example client MultipartRequestPost +``` + +### HTTPS +The examples can be run in HTTPS mode by passing in the flag `--https`, for example: + +``` +cargo run --example server -- --https +``` + +This will use the keys/certificates from the examples directory. Note that the server chain is signed with +`CN=localhost`. + + +## Writing a server + +The server example is designed to form the basis for implementing your own server. Simply follow these steps. + +* Set up a new Rust project, e.g., with `cargo init --bin`. +* Insert `multipart-v3` into the `members` array under [workspace] in the root `Cargo.toml`, e.g., `members = [ "multipart-v3" ]`. +* Add `multipart-v3 = {version = "1.0.7", path = "multipart-v3"}` under `[dependencies]` in the root `Cargo.toml`. +* Copy the `[dependencies]` and `[dev-dependencies]` from `multipart-v3/Cargo.toml` into the root `Cargo.toml`'s `[dependencies]` section. + * Copy all of the `[dev-dependencies]`, but only the `[dependencies]` that are required by the example server. These should be clearly indicated by comments. + * Remove `"optional = true"` from each of these lines if present. + +Each autogenerated API will contain an implementation stub and main entry point, which should be copied into your project the first time: +``` +cp multipart-v3/examples/server.rs src/main.rs +cp multipart-v3/examples/server_lib/mod.rs src/lib.rs +cp multipart-v3/examples/server_lib/server.rs src/server.rs +``` + +Now + +* From `src/main.rs`, remove the `mod server_lib;` line, and uncomment and fill in the `extern crate` line with the name of this server crate. +* Move the block of imports "required by the service library" from `src/main.rs` to `src/lib.rs` and uncomment. +* Change the `let server = server::Server {};` line to `let server = SERVICE_NAME::server().unwrap();` where `SERVICE_NAME` is the name of the server crate. +* Run `cargo build` to check it builds. +* Run `cargo fmt` to reformat the code. +* Commit the result before making any further changes (lest format changes get confused with your own updates). + +Now replace the implementations in `src/server.rs` with your own code as required. + +## Updating your server to track API changes + +Later, if the API changes, you can copy new sections from the autogenerated API stub into your implementation. +Alternatively, implement the now-missing methods based on the compiler's error messages. + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[****](docs/default_api.md#) | **POST** /multipart_request | + + +## Documentation For Models + + - [MultipartRequest](docs/MultipartRequest.md) + - [MultipartRequestObjectField](docs/MultipartRequestObjectField.md) + + +## Documentation For Authorization + Endpoints do not require authorization. + + +## Author + + + diff --git a/samples/server/petstore/rust-server/output/multipart-v3/api/openapi.yaml b/samples/server/petstore/rust-server/output/multipart-v3/api/openapi.yaml new file mode 100644 index 00000000000..654962a5eba --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/api/openapi.yaml @@ -0,0 +1,47 @@ +openapi: 3.0.1 +info: + description: API under test + title: Multipart OpenAPI V3 Rust Server Test + version: 1.0.7 +servers: +- url: / +paths: + /multipart_request: + post: + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/multipart_request' + required: true + responses: + 201: + description: OK +components: + schemas: + multipart_request: + properties: + string_field: + type: string + optional_string_field: + type: string + object_field: + $ref: '#/components/schemas/multipart_request_object_field' + binary_field: + format: byte + type: string + required: + - binary_field + - string_field + type: object + multipart_request_object_field: + properties: + field_a: + type: string + field_b: + items: + type: string + type: array + required: + - field_a + diff --git a/samples/server/petstore/rust-server/output/multipart-v3/docs/MultipartRequest.md b/samples/server/petstore/rust-server/output/multipart-v3/docs/MultipartRequest.md new file mode 100644 index 00000000000..dc52f53832a --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/docs/MultipartRequest.md @@ -0,0 +1,13 @@ +# MultipartRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string_field** | **String** | | +**optional_string_field** | **String** | | [optional] [default to None] +**object_field** | [***models::MultipartRequestObjectField**](multipart_request_object_field.md) | | [optional] [default to None] +**binary_field** | [***swagger::ByteArray**](ByteArray.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/server/petstore/rust-server/output/multipart-v3/docs/MultipartRequestObjectField.md b/samples/server/petstore/rust-server/output/multipart-v3/docs/MultipartRequestObjectField.md new file mode 100644 index 00000000000..bfbf176ad75 --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/docs/MultipartRequestObjectField.md @@ -0,0 +1,11 @@ +# MultipartRequestObjectField + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**field_a** | **String** | | +**field_b** | **Vec** | | [optional] [default to None] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/server/petstore/rust-server/output/multipart-v3/docs/default_api.md b/samples/server/petstore/rust-server/output/multipart-v3/docs/default_api.md new file mode 100644 index 00000000000..b88fe084c35 --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/docs/default_api.md @@ -0,0 +1,46 @@ +# default_api + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +****](default_api.md#) | **POST** /multipart_request | + + +# **** +> (string_field, binary_field, optional) + + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **string_field** | **String**| | + **binary_field** | **swagger::ByteArray**| | + **optional** | **map[string]interface{}** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a map[string]interface{}. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **string_field** | **String**| | + **binary_field** | **swagger::ByteArray**| | + **optional_string_field** | **String**| | + **object_field** | [**multipart_request_object_field**](multipart_request_object_field.md)| | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/server/petstore/rust-server/output/multipart-v3/examples/ca.pem b/samples/server/petstore/rust-server/output/multipart-v3/examples/ca.pem new file mode 100644 index 00000000000..d2317fb5db7 --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/examples/ca.pem @@ -0,0 +1,17 @@ +-----BEGIN CERTIFICATE----- +MIICtjCCAZ4CCQDpKecRERZ0xDANBgkqhkiG9w0BAQsFADAdMQswCQYDVQQGEwJV +UzEOMAwGA1UEAxMFTXkgQ0EwHhcNMTcwNTIzMTYwMDIzWhcNMTcwNjIyMTYwMDIz +WjAdMQswCQYDVQQGEwJVUzEOMAwGA1UEAxMFTXkgQ0EwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQCt66py3x7sCSASRF2D05L5wkNDxAUjQKYx23W8Gbwv +GMGykk89BIdU5LX1JB1cKiUOkoIxfwAYuWc2V/wzTvVV7+11besnk3uX1c9KiqUF +LIX7kn/z5hzS4aelhKvH+MJlSZCSlp1ytpZbwo5GB5Pi2SGH56jDBiBoDRNBVdWL +z4wH7TdrQjqWwNxIZumD5OGMtcfJyuX08iPiEOaslOeoMqzObhvjc9aUgjVjhqyA +FkJGTXsi0oaD7oml+NE+mTNfEeZvEJQpLSjBY0OvQHzuHkyGBShBnfu/9x7/NRwd +WaqsLiF7/re9KDGYdJwP7Cu6uxYfKAyWarp6h2mG/GIdAgMBAAEwDQYJKoZIhvcN +AQELBQADggEBAGIl/VVIafeq/AJOQ9r7TzzB2ABJYr7NZa6bTu5O1jSp1Fonac15 +SZ8gvRxODgH22ZYSqghPG4xzq4J3hkytlQqm57ZEt2I2M3OqIp17Ndcc1xDYzpLl +tA0FrVn6crQTM8vQkTDtGesaCWX+7Fir5dK7HnYWzfpSmsOpST07PfbNisEXKOxG +Dj4lBL1OnhTjsJeymVS1pFvkKkrcEJO+IxFiHL3CDsWjcXB0Z+E1zBtPoYyYsNsO +rBrjUxcZewF4xqWZhpW90Mt61fY2nRgU0uUwHcvDQUqvmzKcsqYa4mPKzfBI5mxo +01Ta96cDD6pS5Y1hOflZ0g84f2g/7xBLLDA= +-----END CERTIFICATE----- diff --git a/samples/server/petstore/rust-server/output/multipart-v3/examples/client.rs b/samples/server/petstore/rust-server/output/multipart-v3/examples/client.rs new file mode 100644 index 00000000000..0421908af77 --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/examples/client.rs @@ -0,0 +1,82 @@ +#![allow(missing_docs, unused_variables, trivial_casts)] + +extern crate multipart_v3; +#[allow(unused_extern_crates)] +extern crate futures; +#[allow(unused_extern_crates)] +#[macro_use] +extern crate swagger; +#[allow(unused_extern_crates)] +extern crate uuid; +extern crate clap; +extern crate tokio_core; + +use swagger::{ContextBuilder, EmptyContext, XSpanIdString, Has, Push, AuthData}; + +#[allow(unused_imports)] +use futures::{Future, future, Stream, stream}; +use tokio_core::reactor; +#[allow(unused_imports)] +use multipart_v3::{ApiNoContext, ContextWrapperExt, + ApiError, + MultipartRequestPostResponse + }; +use clap::{App, Arg}; + +fn main() { + let matches = App::new("client") + .arg(Arg::with_name("operation") + .help("Sets the operation to run") + .possible_values(&[ + "MultipartRequestPost", +]) + .required(true) + .index(1)) + .arg(Arg::with_name("https") + .long("https") + .help("Whether to use HTTPS or not")) + .arg(Arg::with_name("host") + .long("host") + .takes_value(true) + .default_value("localhost") + .help("Hostname to contact")) + .arg(Arg::with_name("port") + .long("port") + .takes_value(true) + .default_value("80") + .help("Port to contact")) + .get_matches(); + + let mut core = reactor::Core::new().unwrap(); + let is_https = matches.is_present("https"); + let base_url = format!("{}://{}:{}", + if is_https { "https" } else { "http" }, + matches.value_of("host").unwrap(), + matches.value_of("port").unwrap()); + let client = if matches.is_present("https") { + // Using Simple HTTPS + multipart_v3::Client::try_new_https(core.handle(), &base_url, "examples/ca.pem") + .expect("Failed to create HTTPS client") + } else { + // Using HTTP + multipart_v3::Client::try_new_http(core.handle(), &base_url) + .expect("Failed to create HTTP client") + }; + + let context: make_context_ty!(ContextBuilder, EmptyContext, Option, XSpanIdString) = + make_context!(ContextBuilder, EmptyContext, None as Option, XSpanIdString(self::uuid::Uuid::new_v4().to_string())); + let client = client.with_context(context); + + match matches.value_of("operation") { + + Some("MultipartRequestPost") => { + let result = core.run(client.multipart_request_post("string_field_example".to_string(), swagger::ByteArray(Vec::from("BYTE_ARRAY_DATA_HERE")), Some("optional_string_field_example".to_string()), None)); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + _ => { + panic!("Invalid operation provided") + } + } +} + diff --git a/samples/server/petstore/rust-server/output/multipart-v3/examples/server-chain.pem b/samples/server/petstore/rust-server/output/multipart-v3/examples/server-chain.pem new file mode 100644 index 00000000000..47d7e201404 --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/examples/server-chain.pem @@ -0,0 +1,66 @@ +Certificate: + Data: + Version: 1 (0x0) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha256WithRSAEncryption + Issuer: C=US, CN=My CA + Validity + Not Before: May 23 16:00:23 2017 GMT + Not After : Apr 29 16:00:23 2117 GMT + Subject: CN=localhost, C=US + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (2048 bit) + Modulus: + 00:c9:d4:43:60:50:fc:d6:0f:38:4d:5d:5e:aa:7c: + c0:5e:a9:ec:d9:93:78:d3:93:72:28:41:f5:08:a5: + ea:ac:67:07:d7:1f:f7:7d:74:69:7e:46:89:20:4b: + 7a:2d:9b:02:08:e7:6f:0f:1d:0c:0f:c7:60:69:19: + 4b:df:7e:ca:75:94:0b:49:71:e3:6d:f2:e8:79:fd: + ed:0a:94:67:55:f3:ca:6b:61:ba:58:b7:2e:dd:7b: + ca:b9:02:9f:24:36:ac:26:8f:04:8f:81:c8:35:10: + f4:aa:33:b2:24:16:f8:f7:1e:ea:f7:16:fe:fa:34: + c3:dd:bb:2c:ba:7a:df:4d:e2:da:1e:e5:d2:28:44: + 6e:c8:96:e0:fd:09:0c:14:0c:31:dc:e0:ca:c1:a7: + 9b:bf:16:8c:f7:36:3f:1b:2e:dd:90:eb:45:78:51: + bf:59:22:1e:c6:8c:0a:69:88:e5:03:5e:73:b7:fc: + 93:7f:1b:46:1b:97:68:c5:c0:8b:35:1f:bb:1e:67: + 7f:55:b7:3b:55:3f:ea:f2:ca:db:cc:52:cd:16:89: + db:15:47:bd:f2:cd:6c:7a:d7:b4:1a:ac:c8:15:6c: + 6a:fb:77:c4:e9:f2:30:e0:14:24:66:65:6f:2a:e5: + 2d:cc:f6:81:ae:57:c8:d1:9b:38:90:dc:60:93:02: + 5e:cb + Exponent: 65537 (0x10001) + Signature Algorithm: sha256WithRSAEncryption + 1c:7c:39:e8:3d:49:b2:09:1e:68:5a:2f:74:18:f4:63:b5:8c: + f6:e6:a1:e3:4d:95:90:99:ef:32:5c:34:40:e8:55:13:0e:e0: + 1c:be:cd:ab:3f:64:38:99:5e:2b:c1:81:53:a0:18:a8:f6:ee: + 6a:33:73:6c:9a:73:9d:86:08:5d:c7:11:38:46:4c:cd:a0:47: + 37:8f:fe:a6:50:a9:02:21:99:42:86:5e:47:fe:65:56:60:1d: + 16:53:86:bd:e4:63:c5:69:cf:fa:30:51:ab:a1:c3:50:53:cc: + 66:1c:4c:ff:3f:2a:39:4d:a2:8f:9d:d1:a7:8b:22:e4:78:69: + 24:06:83:4d:cc:0a:c0:87:69:9b:bc:80:a9:d2:b7:a5:23:84: + 7e:a2:32:26:7c:78:0e:bd:db:cd:3b:69:18:33:b8:44:ef:96: + b4:99:86:ee:06:bd:51:1c:c7:a1:a4:0c:c4:4c:51:a0:df:ac: + 14:07:88:8e:d7:39:45:fe:52:e0:a3:4c:db:5d:7a:ab:4d:e4: + ca:06:e8:bd:74:6f:46:e7:93:4a:4f:1b:67:e7:a5:9f:ef:9c: + 02:49:d1:f2:d5:e9:53:ee:09:21:ac:08:c8:15:f7:af:35:b9: + 4f:11:0f:43:ae:46:8e:fd:5b:8d:a3:4e:a7:2c:b7:25:ed:e4: + e5:94:1d:e3 +-----BEGIN CERTIFICATE----- +MIICtTCCAZ0CAhAAMA0GCSqGSIb3DQEBCwUAMB0xCzAJBgNVBAYTAlVTMQ4wDAYD +VQQDEwVNeSBDQTAgFw0xNzA1MjMxNjAwMjNaGA8yMTE3MDQyOTE2MDAyM1owITES +MBAGA1UEAxMJbG9jYWxob3N0MQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEB +BQADggEPADCCAQoCggEBAMnUQ2BQ/NYPOE1dXqp8wF6p7NmTeNOTcihB9Qil6qxn +B9cf9310aX5GiSBLei2bAgjnbw8dDA/HYGkZS99+ynWUC0lx423y6Hn97QqUZ1Xz +ymthuli3Lt17yrkCnyQ2rCaPBI+ByDUQ9KozsiQW+Pce6vcW/vo0w927LLp6303i +2h7l0ihEbsiW4P0JDBQMMdzgysGnm78WjPc2Pxsu3ZDrRXhRv1kiHsaMCmmI5QNe +c7f8k38bRhuXaMXAizUfux5nf1W3O1U/6vLK28xSzRaJ2xVHvfLNbHrXtBqsyBVs +avt3xOnyMOAUJGZlbyrlLcz2ga5XyNGbOJDcYJMCXssCAwEAATANBgkqhkiG9w0B +AQsFAAOCAQEAHHw56D1JsgkeaFovdBj0Y7WM9uah402VkJnvMlw0QOhVEw7gHL7N +qz9kOJleK8GBU6AYqPbuajNzbJpznYYIXccROEZMzaBHN4/+plCpAiGZQoZeR/5l +VmAdFlOGveRjxWnP+jBRq6HDUFPMZhxM/z8qOU2ij53Rp4si5HhpJAaDTcwKwIdp +m7yAqdK3pSOEfqIyJnx4Dr3bzTtpGDO4RO+WtJmG7ga9URzHoaQMxExRoN+sFAeI +jtc5Rf5S4KNM2116q03kygbovXRvRueTSk8bZ+eln++cAknR8tXpU+4JIawIyBX3 +rzW5TxEPQ65Gjv1bjaNOpyy3Je3k5ZQd4w== +-----END CERTIFICATE----- diff --git a/samples/server/petstore/rust-server/output/multipart-v3/examples/server-key.pem b/samples/server/petstore/rust-server/output/multipart-v3/examples/server-key.pem new file mode 100644 index 00000000000..29c00682922 --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/examples/server-key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDJ1ENgUPzWDzhN +XV6qfMBeqezZk3jTk3IoQfUIpeqsZwfXH/d9dGl+RokgS3otmwII528PHQwPx2Bp +GUvffsp1lAtJceNt8uh5/e0KlGdV88prYbpYty7de8q5Ap8kNqwmjwSPgcg1EPSq +M7IkFvj3Hur3Fv76NMPduyy6et9N4toe5dIoRG7IluD9CQwUDDHc4MrBp5u/Foz3 +Nj8bLt2Q60V4Ub9ZIh7GjAppiOUDXnO3/JN/G0Ybl2jFwIs1H7seZ39VtztVP+ry +ytvMUs0WidsVR73yzWx617QarMgVbGr7d8Tp8jDgFCRmZW8q5S3M9oGuV8jRmziQ +3GCTAl7LAgMBAAECggEBAKEd1q9j14KWYc64s6KLthGbutyxsinMMbxbct11fdIk +6YhdF3fJ35ETg9IJDr6rWEN9ZRX+jStncNpVfFEs6ThVd3Eo/nI+EEGaaIkikR93 +X2a7fEPn7/yVHu70XdBN6L1bPDvHUeiy4W2hmRrgT90OjGm1rNRWHOm7yugOwIZu +HclzbR9Ca7EInFnotUiDQm9sw9VKHbJHqWx6OORdZrxR2ytYs0Qkq0XpGMvti2HW +7WAmKTg5QM8myXW7+/4iqb/u68wVBR2BBalShKmIf7lim9O3W2a1RjDdsvm/wNe9 +I+D+Iq825vpqkKXcrxYlpVg7hYiaQaW/MNsEb7lQRjECgYEA/RJYby0POW+/k0Jn +jO8UmJVEMiuGa8WIUu/JJWMOmzRCukjSRNQOkt7niQrZPJYE8W6clM6RJTolWf9L +IL6mIb+mRaoudUk8SHGDq7ho1iMg9GK8lhYxvKh1Q6uv8EyVSkgLknAEY0NANKC1 +zNdU5Dhven9aRX2gq9vP4XwMz2MCgYEAzCogQ7IFk+gkp3k491dOZnrGRoRCfuzo +4CJtyKFgOSd7BjmpcKkj0IPfVBjw6GjMIxfQRMTQmxAjjWevH45vG8l0Iiwz/gSp +81b5nsDEX5uv2Olcmcz5zxRFy36jOZ9ihMWinxcIlT2oDbyCdbruDKZq9ieJ9S8g +4qGx0OkwE3kCgYEA7CmAiU89U9YqqttfEq/RQoqY91CSwmO10d+ej9seuEtOsdRf +FIfnibulycdr7hP5TOxyBpO1802NqayJiWcgVYIpQf2MGTtcnCYCP+95NcvWZvj1 +EAJqK6nwtFO1fcOZ1ZXh5qfOEGujsPkAbsXLnKXlsiTCMvMHSxl3pu5Cbg0CgYBf +JjbZNctRrjv+7Qj2hPLd4dQsIxGWc7ToWENP4J2mpVa5hQAJqFovoHXhjKohtk2F +AWEn243Y5oGbMjo0e74edhmwn2cvuF64MM2vBem/ISCn98IXT6cQskMA3qkVfsl8 +VVs/x41ReGWs2TD3y0GMFbb9t1mdMfSiincDhNnKCQKBgGfeT4jKyYeCoCw4OLI1 +G75Gd0METt/IkppwODPpNwj3Rp9I5jctWZFA/3wCX/zk0HgBeou5AFNS4nQZ/X/L +L9axbSdR7UJTGkT1r4gu3rLkPV4Tk+8XM03/JT2cofMlzQBuhvl1Pn4SgKowz7hl +lS76ECw4Av3T0S34VW9Z5oye +-----END PRIVATE KEY----- diff --git a/samples/server/petstore/rust-server/output/multipart-v3/examples/server.rs b/samples/server/petstore/rust-server/output/multipart-v3/examples/server.rs new file mode 100644 index 00000000000..2bd095f7a96 --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/examples/server.rs @@ -0,0 +1,75 @@ +//! Main binary entry point for multipart_v3 implementation. + +#![allow(missing_docs)] + +// Imports required by this file. +// extern crate ; +extern crate multipart_v3; +extern crate swagger; +extern crate hyper; +extern crate openssl; +extern crate native_tls; +extern crate tokio_proto; +extern crate tokio_tls; +extern crate clap; + +// Imports required by server library. +// extern crate multipart_v3; +// extern crate swagger; +extern crate futures; +extern crate chrono; +#[macro_use] +extern crate error_chain; + + +use openssl::x509::X509_FILETYPE_PEM; +use openssl::ssl::{SslAcceptorBuilder, SslMethod}; +use openssl::error::ErrorStack; +use hyper::server::Http; +use tokio_proto::TcpServer; +use clap::{App, Arg}; +use swagger::auth::AllowAllAuthenticator; +use swagger::EmptyContext; + +mod server_lib; + +// Builds an SSL implementation for Simple HTTPS from some hard-coded file names +fn ssl() -> Result { + let mut ssl = SslAcceptorBuilder::mozilla_intermediate_raw(SslMethod::tls())?; + + // Server authentication + ssl.set_private_key_file("examples/server-key.pem", X509_FILETYPE_PEM)?; + ssl.set_certificate_chain_file("examples/server-chain.pem")?; + ssl.check_private_key()?; + + Ok(ssl) +} + +/// Create custom server, wire it to the autogenerated router, +/// and pass it to the web server. +fn main() { + let matches = App::new("server") + .arg(Arg::with_name("https") + .long("https") + .help("Whether to use HTTPS or not")) + .get_matches(); + + let service_fn = + multipart_v3::server::context::NewAddContext::<_, EmptyContext>::new( + AllowAllAuthenticator::new( + server_lib::NewService::new(), + "cosmo" + ) + ); + + let addr = "127.0.0.1:80".parse().expect("Failed to parse bind address"); + if matches.is_present("https") { + let ssl = ssl().expect("Failed to load SSL keys"); + let builder: native_tls::TlsAcceptorBuilder = native_tls::backend::openssl::TlsAcceptorBuilderExt::from_openssl(ssl); + let tls_acceptor = builder.build().expect("Failed to build TLS acceptor"); + TcpServer::new(tokio_tls::proto::Server::new(Http::new(), tls_acceptor), addr).serve(service_fn); + } else { + // Using HTTP + TcpServer::new(Http::new(), addr).serve(service_fn); + } +} diff --git a/samples/server/petstore/rust-server/output/multipart-v3/examples/server_lib/mod.rs b/samples/server/petstore/rust-server/output/multipart-v3/examples/server_lib/mod.rs new file mode 100644 index 00000000000..ae07201663c --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/examples/server_lib/mod.rs @@ -0,0 +1,37 @@ +//! Main library entry point for multipart_v3 implementation. + +mod server; + +mod errors { + error_chain!{} +} + +pub use self::errors::*; +use std::io; +use std::clone::Clone; +use std::marker::PhantomData; +use hyper; +use multipart_v3; +use swagger::{Has, XSpanIdString}; + +pub struct NewService{ + marker: PhantomData +} + +impl NewService{ + pub fn new() -> Self { + NewService{marker:PhantomData} + } +} + +impl hyper::server::NewService for NewService where C: Has + Clone + 'static { + type Request = (hyper::Request, C); + type Response = hyper::Response; + type Error = hyper::Error; + type Instance = multipart_v3::server::Service, C>; + + /// Instantiate a new server. + fn new_service(&self) -> io::Result { + Ok(multipart_v3::server::Service::new(server::Server::new())) + } +} diff --git a/samples/server/petstore/rust-server/output/multipart-v3/examples/server_lib/server.rs b/samples/server/petstore/rust-server/output/multipart-v3/examples/server_lib/server.rs new file mode 100644 index 00000000000..b9488562ed3 --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/examples/server_lib/server.rs @@ -0,0 +1,38 @@ +//! Server implementation of multipart_v3. + +#![allow(unused_imports)] + +use futures::{self, Future}; +use chrono; +use std::collections::HashMap; +use std::marker::PhantomData; + +use swagger; +use swagger::{Has, XSpanIdString}; + +use multipart_v3::{Api, ApiError, + MultipartRequestPostResponse +}; +use multipart_v3::models; + +#[derive(Copy, Clone)] +pub struct Server { + marker: PhantomData, +} + +impl Server { + pub fn new() -> Self { + Server{marker: PhantomData} + } +} + +impl Api for Server where C: Has{ + + + fn multipart_request_post(&self, string_field: String, binary_field: swagger::ByteArray, optional_string_field: Option, object_field: Option, context: &C) -> Box> { + let context = context.clone(); + println!("multipart_request_post(\"{}\", {:?}, {:?}, {:?}) - X-Span-ID: {:?}", string_field, binary_field, optional_string_field, object_field, context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + +} diff --git a/samples/server/petstore/rust-server/output/multipart-v3/src/client/mod.rs b/samples/server/petstore/rust-server/output/multipart-v3/src/client/mod.rs new file mode 100644 index 00000000000..42e60bdf200 --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/src/client/mod.rs @@ -0,0 +1,417 @@ +#![allow(unused_extern_crates)] +extern crate tokio_core; +extern crate native_tls; +extern crate hyper_tls; +extern crate openssl; +extern crate mime; +extern crate chrono; +extern crate url; +extern crate multipart; + +use hyper; +use hyper::header::{Headers, ContentType}; +use hyper::Uri; +use self::url::percent_encoding::{utf8_percent_encode, PATH_SEGMENT_ENCODE_SET, QUERY_ENCODE_SET}; +use futures; +use futures::{Future, Stream}; +use futures::{future, stream}; +use self::tokio_core::reactor::Handle; +use std::borrow::Cow; +use std::io::{Read, Error, ErrorKind}; +use std::error; +use std::fmt; +use std::path::Path; +use std::sync::Arc; +use std::str; +use std::str::FromStr; +use std::string::ToString; +use hyper::mime::Mime; +use std::io::Cursor; +use client::multipart::client::lazy::Multipart; +use mimetypes; +use serde_json; + +#[allow(unused_imports)] +use std::collections::{HashMap, BTreeMap}; +#[allow(unused_imports)] +use swagger; + +use swagger::{ApiError, XSpanId, XSpanIdString, Has, AuthData}; + +use {Api, + MultipartRequestPostResponse + }; +use models; + +define_encode_set! { + /// This encode set is used for object IDs + /// + /// Aside from the special characters defined in the `PATH_SEGMENT_ENCODE_SET`, + /// the vertical bar (|) is encoded. + pub ID_ENCODE_SET = [PATH_SEGMENT_ENCODE_SET] | {'|'} +} + +/// Convert input into a base path, e.g. "http://example:123". Also checks the scheme as it goes. +fn into_base_path(input: &str, correct_scheme: Option<&'static str>) -> Result { + // First convert to Uri, since a base path is a subset of Uri. + let uri = Uri::from_str(input)?; + + let scheme = uri.scheme().ok_or(ClientInitError::InvalidScheme)?; + + // Check the scheme if necessary + if let Some(correct_scheme) = correct_scheme { + if scheme != correct_scheme { + return Err(ClientInitError::InvalidScheme); + } + } + + let host = uri.host().ok_or_else(|| ClientInitError::MissingHost)?; + let port = uri.port().map(|x| format!(":{}", x)).unwrap_or_default(); + Ok(format!("{}://{}{}", scheme, host, port)) +} + +/// A client that implements the API by making HTTP calls out to a server. +pub struct Client where + F: Future + 'static { + client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, + base_path: String, +} + +impl fmt::Debug for Client where + F: Future + 'static { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "Client {{ base_path: {} }}", self.base_path) + } +} + +impl Clone for Client where + F: Future + 'static { + fn clone(&self) -> Self { + Client { + client_service: self.client_service.clone(), + base_path: self.base_path.clone() + } + } +} + +impl Client { + + /// Create an HTTP client. + /// + /// # Arguments + /// * `handle` - tokio reactor handle to use for execution + /// * `base_path` - base path of the client API, i.e. "www.my-api-implementation.com" + pub fn try_new_http(handle: Handle, base_path: &str) -> Result, ClientInitError> { + let http_connector = swagger::http_connector(); + Self::try_new_with_connector::( + handle, + base_path, + Some("http"), + http_connector, + ) + } + + /// Create a client with a TLS connection to the server. + /// + /// # Arguments + /// * `handle` - tokio reactor handle to use for execution + /// * `base_path` - base path of the client API, i.e. "www.my-api-implementation.com" + /// * `ca_certificate` - Path to CA certificate used to authenticate the server + pub fn try_new_https( + handle: Handle, + base_path: &str, + ca_certificate: CA, + ) -> Result, ClientInitError> + where + CA: AsRef, + { + let https_connector = swagger::https_connector(ca_certificate); + Self::try_new_with_connector::>( + handle, + base_path, + Some("https"), + https_connector, + ) + } + + /// Create a client with a mutually authenticated TLS connection to the server. + /// + /// # Arguments + /// * `handle` - tokio reactor handle to use for execution + /// * `base_path` - base path of the client API, i.e. "www.my-api-implementation.com" + /// * `ca_certificate` - Path to CA certificate used to authenticate the server + /// * `client_key` - Path to the client private key + /// * `client_certificate` - Path to the client's public certificate associated with the private key + pub fn try_new_https_mutual( + handle: Handle, + base_path: &str, + ca_certificate: CA, + client_key: K, + client_certificate: C, + ) -> Result, ClientInitError> + where + CA: AsRef, + K: AsRef, + C: AsRef, + { + let https_connector = + swagger::https_mutual_connector(ca_certificate, client_key, client_certificate); + Self::try_new_with_connector::>( + handle, + base_path, + Some("https"), + https_connector, + ) + } + + /// Create a client with a custom implementation of hyper::client::Connect. + /// + /// Intended for use with custom implementations of connect for e.g. protocol logging + /// or similar functionality which requires wrapping the transport layer. When wrapping a TCP connection, + /// this function should be used in conjunction with + /// `swagger::{http_connector, https_connector, https_mutual_connector}`. + /// + /// For ordinary tcp connections, prefer the use of `try_new_http`, `try_new_https` + /// and `try_new_https_mutual`, to avoid introducing a dependency on the underlying transport layer. + /// + /// # Arguments + /// + /// * `handle` - tokio reactor handle to use for execution + /// * `base_path` - base path of the client API, i.e. "www.my-api-implementation.com" + /// * `protocol` - Which protocol to use when constructing the request url, e.g. `Some("http")` + /// * `connector_fn` - Function which returns an implementation of `hyper::client::Connect` + pub fn try_new_with_connector( + handle: Handle, + base_path: &str, + protocol: Option<&'static str>, + connector_fn: Box C + Send + Sync>, + ) -> Result, ClientInitError> + where + C: hyper::client::Connect + hyper::client::Service, + { + let connector = connector_fn(&handle); + let client_service = Box::new(hyper::Client::configure().connector(connector).build( + &handle, + )); + + Ok(Client { + client_service: Arc::new(client_service), + base_path: into_base_path(base_path, protocol)?, + }) + } + + /// Constructor for creating a `Client` by passing in a pre-made `hyper` client. + /// + /// One should avoid relying on this function if possible, since it adds a dependency on the underlying transport + /// implementation, which it would be better to abstract away. Therefore, using this function may lead to a loss of + /// code generality, which may make it harder to move the application to a serverless environment, for example. + /// + /// The reason for this function's existence is to support legacy test code, which did mocking at the hyper layer. + /// This is not a recommended way to write new tests. If other reasons are found for using this function, they + /// should be mentioned here. + #[deprecated(note="Use try_new_with_client_service instead")] + pub fn try_new_with_hyper_client( + hyper_client: Arc, Response=hyper::Response, Error=hyper::Error, Future=hyper::client::FutureResponse>>>, + handle: Handle, + base_path: &str + ) -> Result, ClientInitError> + { + Ok(Client { + client_service: hyper_client, + base_path: into_base_path(base_path, None)?, + }) + } +} + +impl Client where + F: Future + 'static +{ + /// Constructor for creating a `Client` by passing in a pre-made `hyper` client Service. + /// + /// This allows adding custom wrappers around the underlying transport, for example for logging. + pub fn try_new_with_client_service(client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, + handle: Handle, + base_path: &str) + -> Result, ClientInitError> + { + Ok(Client { + client_service: client_service, + base_path: into_base_path(base_path, None)?, + }) + } +} + +impl Api for Client where + F: Future + 'static, + C: Has { + + fn multipart_request_post(&self, param_string_field: String, param_binary_field: swagger::ByteArray, param_optional_string_field: Option, param_object_field: Option, context: &C) -> Box> { + let mut uri = format!( + "{}/multipart_request", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Post, uri); + + let mut multipart = Multipart::new(); + + // For each parameter, encode as appropriate and add to the multipart body as a stream. + + let string_field_str = match serde_json::to_string(¶m_string_field) { + Ok(str) => str, + Err(e) => return Box::new(futures::done(Err(ApiError(format!("Unable to parse string_field to string: {}", e))))), + }; + + let string_field_vec = string_field_str.as_bytes().to_vec(); + + let string_field_mime = mime::Mime::from_str("application/json").expect("impossible to fail to parse"); + + let string_field_cursor = Cursor::new(string_field_vec); + + multipart.add_stream("string_field", string_field_cursor, None as Option<&str>, Some(string_field_mime)); + + + let optional_string_field_str = match serde_json::to_string(¶m_optional_string_field) { + Ok(str) => str, + Err(e) => return Box::new(futures::done(Err(ApiError(format!("Unable to parse optional_string_field to string: {}", e))))), + }; + + let optional_string_field_vec = optional_string_field_str.as_bytes().to_vec(); + + let optional_string_field_mime = mime::Mime::from_str("application/json").expect("impossible to fail to parse"); + + let optional_string_field_cursor = Cursor::new(optional_string_field_vec); + + multipart.add_stream("optional_string_field", optional_string_field_cursor, None as Option<&str>, Some(optional_string_field_mime)); + + + let object_field_str = match serde_json::to_string(¶m_object_field) { + Ok(str) => str, + Err(e) => return Box::new(futures::done(Err(ApiError(format!("Unable to parse object_field to string: {}", e))))), + }; + + let object_field_vec = object_field_str.as_bytes().to_vec(); + + let object_field_mime = mime::Mime::from_str("application/json").expect("impossible to fail to parse"); + + let object_field_cursor = Cursor::new(object_field_vec); + + multipart.add_stream("object_field", object_field_cursor, None as Option<&str>, Some(object_field_mime)); + + + let binary_field_vec = param_binary_field.to_vec(); + + let binary_field_mime = match mime::Mime::from_str("application/octet-stream") { + Ok(mime) => mime, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to get mime type: {:?}", err))))), + }; + + let binary_field_cursor = Cursor::new(binary_field_vec); + + let filename = None as Option<&str> ; + multipart.add_stream("binary_field", binary_field_cursor, filename, Some(binary_field_mime)); + + + let mut fields = match multipart.prepare() { + Ok(fields) => fields, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build request: {}", err))))), + }; + + let mut body_string = String::new(); + fields.to_body().read_to_string(&mut body_string).unwrap(); + let boundary = fields.boundary(); + + let multipart_header = match Mime::from_str(&format!("multipart/form-data;boundary={}", boundary)) { + Ok(multipart_header) => multipart_header, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build multipart header: {:?}", err))))), + }; + + request.set_body(body_string.into_bytes()); + request.headers_mut().set(ContentType(multipart_header)); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 201 => { + let body = response.body(); + Box::new( + + future::ok( + MultipartRequestPostResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + +} + +#[derive(Debug)] +pub enum ClientInitError { + InvalidScheme, + InvalidUri(hyper::error::UriError), + MissingHost, + SslError(openssl::error::ErrorStack) +} + +impl From for ClientInitError { + fn from(err: hyper::error::UriError) -> ClientInitError { + ClientInitError::InvalidUri(err) + } +} + +impl From for ClientInitError { + fn from(err: openssl::error::ErrorStack) -> ClientInitError { + ClientInitError::SslError(err) + } +} + +impl fmt::Display for ClientInitError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + (self as &fmt::Debug).fmt(f) + } +} + +impl error::Error for ClientInitError { + fn description(&self) -> &str { + "Failed to produce a hyper client." + } +} diff --git a/samples/server/petstore/rust-server/output/multipart-v3/src/lib.rs b/samples/server/petstore/rust-server/output/multipart-v3/src/lib.rs new file mode 100644 index 00000000000..8d553034d0c --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/src/lib.rs @@ -0,0 +1,101 @@ +#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] +extern crate serde; +#[macro_use] +extern crate serde_derive; +extern crate serde_json; + + +extern crate futures; +extern crate chrono; +#[macro_use] +extern crate lazy_static; +#[macro_use] +extern crate log; +extern crate mime; + +// Logically this should be in the client and server modules, but rust doesn't allow `macro_use` from a module. +#[cfg(any(feature = "client", feature = "server"))] +#[macro_use] +extern crate hyper; + +extern crate swagger; + +#[macro_use] +extern crate url; + +use futures::Stream; +use std::io::Error; + +#[allow(unused_imports)] +use std::collections::HashMap; + +pub use futures::Future; + +#[cfg(any(feature = "client", feature = "server"))] +mod mimetypes; + +pub use swagger::{ApiError, ContextWrapper}; + +pub const BASE_PATH: &'static str = ""; +pub const API_VERSION: &'static str = "1.0.7"; + + +#[derive(Debug, PartialEq)] +pub enum MultipartRequestPostResponse { + /// OK + OK , +} + + +/// API +pub trait Api { + + + fn multipart_request_post(&self, string_field: String, binary_field: swagger::ByteArray, optional_string_field: Option, object_field: Option, context: &C) -> Box>; + +} + +/// API without a `Context` +pub trait ApiNoContext { + + + fn multipart_request_post(&self, string_field: String, binary_field: swagger::ByteArray, optional_string_field: Option, object_field: Option) -> Box>; + +} + +/// Trait to extend an API to make it easy to bind it to a context. +pub trait ContextWrapperExt<'a, C> where Self: Sized { + /// Binds this API to a context. + fn with_context(self: &'a Self, context: C) -> ContextWrapper<'a, Self, C>; +} + +impl<'a, T: Api + Sized, C> ContextWrapperExt<'a, C> for T { + fn with_context(self: &'a T, context: C) -> ContextWrapper<'a, T, C> { + ContextWrapper::::new(self, context) + } +} + +impl<'a, T: Api, C> ApiNoContext for ContextWrapper<'a, T, C> { + + + fn multipart_request_post(&self, string_field: String, binary_field: swagger::ByteArray, optional_string_field: Option, object_field: Option) -> Box> { + self.api().multipart_request_post(string_field, binary_field, optional_string_field, object_field, &self.context()) + } + +} + +#[cfg(feature = "client")] +pub mod client; + +// Re-export Client as a top-level name +#[cfg(feature = "client")] +pub use self::client::Client; + +#[cfg(feature = "server")] +pub mod server; + +// Re-export router() as a top-level name +#[cfg(feature = "server")] +pub use self::server::Service; + +pub mod models; diff --git a/samples/server/petstore/rust-server/output/multipart-v3/src/mimetypes.rs b/samples/server/petstore/rust-server/output/multipart-v3/src/mimetypes.rs new file mode 100644 index 00000000000..45d98f894cd --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/src/mimetypes.rs @@ -0,0 +1,17 @@ +/// mime types for requests and responses + +pub mod responses { + use hyper::mime::*; + + // The macro is called per-operation to beat the recursion limit + +} + +pub mod requests { + use hyper::mime::*; + /// Create Mime objects for the request content types for MultipartRequestPost + lazy_static! { + pub static ref MULTIPART_REQUEST_POST: Mime = "multipart/form-data".parse().unwrap(); + } + +} diff --git a/samples/server/petstore/rust-server/output/multipart-v3/src/models.rs b/samples/server/petstore/rust-server/output/multipart-v3/src/models.rs new file mode 100644 index 00000000000..a1821ae32d1 --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/src/models.rs @@ -0,0 +1,63 @@ +#![allow(unused_imports, unused_qualifications, unused_extern_crates)] +extern crate chrono; +extern crate uuid; + +use serde::ser::Serializer; + +use std::collections::HashMap; +use models; +use swagger; +use std::string::ParseError; + + + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct MultipartRequest { + #[serde(rename = "string_field")] + pub string_field: String, + + #[serde(rename = "optional_string_field")] + #[serde(skip_serializing_if="Option::is_none")] + pub optional_string_field: Option, + + #[serde(rename = "object_field")] + #[serde(skip_serializing_if="Option::is_none")] + pub object_field: Option, + + #[serde(rename = "binary_field")] + pub binary_field: swagger::ByteArray, + +} + +impl MultipartRequest { + pub fn new(string_field: String, binary_field: swagger::ByteArray, ) -> MultipartRequest { + MultipartRequest { + string_field: string_field, + optional_string_field: None, + object_field: None, + binary_field: binary_field, + } + } +} + + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct MultipartRequestObjectField { + #[serde(rename = "field_a")] + pub field_a: String, + + #[serde(rename = "field_b")] + #[serde(skip_serializing_if="Option::is_none")] + pub field_b: Option>, + +} + +impl MultipartRequestObjectField { + pub fn new(field_a: String, ) -> MultipartRequestObjectField { + MultipartRequestObjectField { + field_a: field_a, + field_b: None, + } + } +} + diff --git a/samples/server/petstore/rust-server/output/multipart-v3/src/server/context.rs b/samples/server/petstore/rust-server/output/multipart-v3/src/server/context.rs new file mode 100644 index 00000000000..6f2900b3d70 --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/src/server/context.rs @@ -0,0 +1,91 @@ +use std::io; +use std::marker::PhantomData; +use std::default::Default; +use hyper; +use hyper::{Request, Response, Error, StatusCode}; +use server::url::form_urlencoded; +use swagger::auth::{Authorization, AuthData, Scopes}; +use swagger::{Has, Pop, Push, XSpanIdString}; +use Api; + +pub struct NewAddContext +{ + inner: T, + marker: PhantomData, +} + +impl NewAddContext + where + A: Default + Push, + B: Push, Result=C>, + C: Push, Result=D>, + T: hyper::server::NewService + 'static, +{ + pub fn new(inner: T) -> NewAddContext { + NewAddContext { + inner, + marker: PhantomData, + } + } +} + +impl hyper::server::NewService for NewAddContext + where + A: Default + Push, + B: Push, Result=C>, + C: Push, Result=D>, + T: hyper::server::NewService + 'static, +{ + type Request = Request; + type Response = Response; + type Error = Error; + type Instance = AddContext; + + fn new_service(&self) -> Result { + self.inner.new_service().map(|s| AddContext::new(s)) + } +} + +/// Middleware to extract authentication data from request +pub struct AddContext +{ + inner: T, + marker: PhantomData, +} + +impl AddContext + where + A: Default + Push, + B: Push, Result=C>, + C: Push, Result=D>, + T: hyper::server::Service, +{ + pub fn new(inner: T) -> AddContext { + AddContext { + inner, + marker: PhantomData, + } + } +} + +impl hyper::server::Service for AddContext + where + A: Default + Push, + B: Push, Result=C>, + C: Push, Result=D>, + T: hyper::server::Service, +{ + type Request = Request; + type Response = Response; + type Error = Error; + type Future = T::Future; + + fn call(&self, req: Self::Request) -> Self::Future { + let context = A::default().push(XSpanIdString::get_or_generate(&req)); + + + let context = context.push(None::); + let context = context.push(None::); + return self.inner.call((req, context)); + } +} diff --git a/samples/server/petstore/rust-server/output/multipart-v3/src/server/mod.rs b/samples/server/petstore/rust-server/output/multipart-v3/src/server/mod.rs new file mode 100644 index 00000000000..67e139f9b24 --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/src/server/mod.rs @@ -0,0 +1,277 @@ +#![allow(unused_extern_crates)] +extern crate serde_ignored; +extern crate tokio_core; +extern crate native_tls; +extern crate hyper_tls; +extern crate openssl; +extern crate mime; +extern crate chrono; +extern crate percent_encoding; +extern crate url; +extern crate uuid; +extern crate multipart; + +use std::sync::Arc; +use std::marker::PhantomData; +use futures::{Future, future, Stream, stream}; +use hyper; +use hyper::{Request, Response, Error, StatusCode}; +use hyper::header::{Headers, ContentType}; +use self::url::form_urlencoded; +use mimetypes; +use self::multipart::server::Multipart; +use self::multipart::server::save::SaveResult; +use std::fs; +use serde_json; + +#[allow(unused_imports)] +use std::collections::{HashMap, BTreeMap}; +#[allow(unused_imports)] +use swagger; +use std::io; + +#[allow(unused_imports)] +use std::collections::BTreeSet; + +pub use swagger::auth::Authorization; +use swagger::{ApiError, XSpanId, XSpanIdString, Has, RequestParser}; +use swagger::auth::Scopes; + +use {Api, + MultipartRequestPostResponse + }; +#[allow(unused_imports)] +use models; + +pub mod context; + +header! { (Warning, "Warning") => [String] } + +mod paths { + extern crate regex; + + lazy_static! { + pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(&[ + r"^/multipart_request$" + ]).unwrap(); + } + pub static ID_MULTIPART_REQUEST: usize = 0; +} + +pub struct NewService { + api_impl: Arc, + marker: PhantomData, +} + +impl NewService +where + T: Api + Clone + 'static, + C: Has + 'static +{ + pub fn new>>(api_impl: U) -> NewService { + NewService{api_impl: api_impl.into(), marker: PhantomData} + } +} + +impl hyper::server::NewService for NewService +where + T: Api + Clone + 'static, + C: Has + 'static +{ + type Request = (Request, C); + type Response = Response; + type Error = Error; + type Instance = Service; + + fn new_service(&self) -> Result { + Ok(Service::new(self.api_impl.clone())) + } +} + +pub struct Service { + api_impl: Arc, + marker: PhantomData, +} + +impl Service +where + T: Api + Clone + 'static, + C: Has + 'static { + pub fn new>>(api_impl: U) -> Service { + Service{api_impl: api_impl.into(), marker: PhantomData} + } +} + +impl hyper::server::Service for Service +where + T: Api + Clone + 'static, + C: Has + 'static +{ + type Request = (Request, C); + type Response = Response; + type Error = Error; + type Future = Box>; + + fn call(&self, (req, mut context): Self::Request) -> Self::Future { + let api_impl = self.api_impl.clone(); + let (method, uri, _, headers, body) = req.deconstruct(); + let path = paths::GLOBAL_REGEX_SET.matches(uri.path()); + + // This match statement is duplicated below in `parse_operation_id()`. + // Please update both places if changing how this code is autogenerated. + match &method { + + // MultipartRequestPost - POST /multipart_request + &hyper::Method::Post if path.matched(paths::ID_MULTIPART_REQUEST) => { + let boundary = match multipart_boundary(&headers) { + Some(boundary) => boundary.to_string(), + None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body("Couldn't find valid multipart body"))), + }; + // Form Body parameters (note that non-required body parameters will ignore garbage + // values, rather than causing a 400 response). Produce warning header and logs for + // any unused fields. + Box::new(body.concat2() + .then(move |result| -> Box> { + match result { + Ok(body) => { + // Read Form Parameters from body + let mut entries = match Multipart::with_body(&body.to_vec()[..], boundary).save().temp() { + SaveResult::Full(entries) => { + entries + }, + _ => { + return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Unable to process all message parts")))) + }, + }; + + + let file_string_field = entries.files.remove("string_field"); + let param_string_field = match file_string_field { + Some(file) => { + let path = &file[0].path; + let string_field_str = fs::read_to_string(path).expect("Reading saved String should never fail"); + let string_field_model: String = match serde_json::from_str(&string_field_str) { + Ok(model) => model, + Err(e) => { + return Box::new(future::ok( + Response::new() + .with_status(StatusCode::BadRequest) + .with_body(format!("string_field data does not match API definition: {}", e)))) + } + }; + string_field_model + } + None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Missing required form parameter string_field")))), + }; + + + + let file_optional_string_field = entries.files.remove("optional_string_field"); + let param_optional_string_field = match file_optional_string_field { + Some(file) => { + let path = &file[0].path; + let optional_string_field_str = fs::read_to_string(path).unwrap(); + let optional_string_field_model: String = serde_json::from_str(&optional_string_field_str).expect("Impossible to fail to serialise"); + Some(optional_string_field_model) + } + None => None, + }; + + + + let file_object_field = entries.files.remove("object_field"); + let param_object_field = match file_object_field { + Some(file) => { + let path = &file[0].path; + let object_field_str = fs::read_to_string(path).unwrap(); + let object_field_model: models::MultipartRequestObjectField = serde_json::from_str(&object_field_str).expect("Impossible to fail to serialise"); + Some(object_field_model) + } + None => None, + }; + + + let file_binary_field = entries.files.remove("binary_field"); + let param_binary_field = match file_binary_field { + Some(file) => { + let path = &file[0].path; + let binary_field_str = fs::read_to_string(path).unwrap(); + swagger::ByteArray(binary_field_str.as_bytes().to_vec()) + } + None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Missing required form parameter binary_field")))), + }; + + Box::new(api_impl.multipart_request_post(param_string_field, param_binary_field, param_optional_string_field, param_object_field, &context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + MultipartRequestPostResponse::OK + + + => { + response.set_status(StatusCode::try_from(201).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + as Box> + }, + Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read multipart body")))), + } + }) + ) + }, + + _ => Box::new(future::ok(Response::new().with_status(StatusCode::NotFound))) as Box>, + } + } +} + +impl Clone for Service +{ + fn clone(&self) -> Self { + Service { + api_impl: self.api_impl.clone(), + marker: self.marker.clone(), + } + } +} + +/// Utility function to get the multipart boundary marker (if any) from the Headers. +fn multipart_boundary<'a>(headers: &'a Headers) -> Option<&'a str> { + headers.get::().and_then(|content_type| { + let ContentType(ref mime) = *content_type; + if mime.type_() == hyper::mime::MULTIPART && mime.subtype() == hyper::mime::FORM_DATA { + mime.get_param(hyper::mime::BOUNDARY).map(|x| x.as_str()) + } else { + None + } + }) +} + +/// Request parser for `Api`. +pub struct ApiRequestParser; +impl RequestParser for ApiRequestParser { + fn parse_operation_id(request: &Request) -> Result<&'static str, ()> { + let path = paths::GLOBAL_REGEX_SET.matches(request.uri().path()); + match request.method() { + + // MultipartRequestPost - POST /multipart_request + &hyper::Method::Post if path.matched(paths::ID_MULTIPART_REQUEST) => Ok("MultipartRequestPost"), + _ => Err(()), + } + } +} diff --git a/samples/server/petstore/rust-server/output/openapi-v3/Cargo.toml b/samples/server/petstore/rust-server/output/openapi-v3/Cargo.toml index b2edca9c74b..3b00d15503a 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/Cargo.toml +++ b/samples/server/petstore/rust-server/output/openapi-v3/Cargo.toml @@ -23,8 +23,8 @@ swagger = "2" # lazy_static = "0.2" log = "0.3.0" -mime = "0.3.3" -multipart = {version = "0.13.3", optional = true} +mime = "0.2.6" +multipart = {version = "0.13.3"} native-tls = {version = "0.1.4", optional = true} openssl = {version = "0.9.14", optional = true} percent-encoding = {version = "1.0.0", optional = true} diff --git a/samples/server/petstore/rust-server/output/openapi-v3/README.md b/samples/server/petstore/rust-server/output/openapi-v3/README.md index 706821945d8..9ae32692382 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/README.md +++ b/samples/server/petstore/rust-server/output/openapi-v3/README.md @@ -56,6 +56,7 @@ To run a client, follow one of the following simple steps: ``` cargo run --example client RequiredOctetStreamPut +cargo run --example client UuidGet cargo run --example client XmlExtraPost cargo run --example client XmlOtherPost cargo run --example client XmlOtherPut @@ -115,6 +116,7 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- [****](docs/default_api.md#) | **PUT** /required_octet_stream | +[****](docs/default_api.md#) | **GET** /uuid | [****](docs/default_api.md#) | **POST** /xml_extra | [****](docs/default_api.md#) | **POST** /xml_other | [****](docs/default_api.md#) | **PUT** /xml_other | diff --git a/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml b/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml index f9282ee3115..1c250b1c94c 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml +++ b/samples/server/petstore/rust-server/output/openapi-v3/api/openapi.yaml @@ -65,6 +65,15 @@ paths: description: OK 400: description: Bad Request + /uuid: + get: + responses: + 200: + content: + application/json: + schema: + $ref: '#/components/schemas/UuidObject' + description: Duplicate Response long text. One. /required_octet_stream: put: requestBody: diff --git a/samples/server/petstore/rust-server/output/openapi-v3/docs/default_api.md b/samples/server/petstore/rust-server/output/openapi-v3/docs/default_api.md index b8652374c9d..b0bf1222fa4 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/docs/default_api.md +++ b/samples/server/petstore/rust-server/output/openapi-v3/docs/default_api.md @@ -5,6 +5,7 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- ****](default_api.md#) | **PUT** /required_octet_stream | +****](default_api.md#) | **GET** /uuid | ****](default_api.md#) | **POST** /xml_extra | ****](default_api.md#) | **POST** /xml_other | ****](default_api.md#) | **PUT** /xml_other | @@ -37,6 +38,28 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **** +> uuid::Uuid () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + +[**uuid::Uuid**](UUID.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **** > (optional) diff --git a/samples/server/petstore/rust-server/output/openapi-v3/examples/client.rs b/samples/server/petstore/rust-server/output/openapi-v3/examples/client.rs index b94f7347967..35aec947f48 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/examples/client.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/examples/client.rs @@ -20,6 +20,7 @@ use tokio_core::reactor; use openapi_v3::{ApiNoContext, ContextWrapperExt, ApiError, RequiredOctetStreamPutResponse, + UuidGetResponse, XmlExtraPostResponse, XmlOtherPostResponse, XmlOtherPutResponse, @@ -34,6 +35,7 @@ fn main() { .help("Sets the operation to run") .possible_values(&[ "RequiredOctetStreamPut", + "UuidGet", "XmlExtraPost", "XmlOtherPost", "XmlOtherPut", @@ -84,6 +86,11 @@ fn main() { println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); }, + Some("UuidGet") => { + let result = core.run(client.uuid_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + Some("XmlExtraPost") => { let result = core.run(client.xml_extra_post(None)); println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); diff --git a/samples/server/petstore/rust-server/output/openapi-v3/examples/server_lib/server.rs b/samples/server/petstore/rust-server/output/openapi-v3/examples/server_lib/server.rs index 9e28fb179ab..ed9633e9c03 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/examples/server_lib/server.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/examples/server_lib/server.rs @@ -12,6 +12,7 @@ use swagger::{Has, XSpanIdString}; use openapi_v3::{Api, ApiError, RequiredOctetStreamPutResponse, + UuidGetResponse, XmlExtraPostResponse, XmlOtherPostResponse, XmlOtherPutResponse, @@ -41,6 +42,13 @@ impl Api for Server where C: Has{ } + fn uuid_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("uuid_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + fn xml_extra_post(&self, duplicate_xml_object: Option, context: &C) -> Box> { let context = context.clone(); println!("xml_extra_post({:?}) - X-Span-ID: {:?}", duplicate_xml_object, context.get().0.clone()); diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/client/mod.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/client/mod.rs index 855f89cfce3..55d94240ebf 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/client/mod.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/client/mod.rs @@ -7,8 +7,6 @@ extern crate mime; extern crate chrono; extern crate url; - - use hyper; use hyper::header::{Headers, ContentType}; use hyper::Uri; @@ -26,9 +24,7 @@ use std::sync::Arc; use std::str; use std::str::FromStr; use std::string::ToString; - use mimetypes; - use serde_json; use serde_xml_rs; @@ -41,6 +37,7 @@ use swagger::{ApiError, XSpanId, XSpanIdString, Has, AuthData}; use {Api, RequiredOctetStreamPutResponse, + UuidGetResponse, XmlExtraPostResponse, XmlOtherPostResponse, XmlOtherPutResponse, @@ -273,17 +270,13 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Put, uri); - // Body parameter let body = param_body.0; - request.set_body(body); - request.headers_mut().set(ContentType(mimetypes::requests::REQUIRED_OCTET_STREAM_PUT.clone())); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -321,6 +314,80 @@ impl Api for Client where } + fn uuid_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/uuid", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + body + .concat2() + .map_err(|e| ApiError(format!("Failed to read response: {}", e))) + .and_then(|body| + + str::from_utf8(&body) + .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) + .and_then(|body| + + serde_json::from_str::(body) + .map_err(|e| e.into()) + ) + + ) + .map(move |body| { + UuidGetResponse::DuplicateResponseLongText(body) + }) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + fn xml_extra_post(&self, param_duplicate_xml_object: Option, context: &C) -> Box> { let mut uri = format!( "{}/xml_extra", @@ -347,14 +414,13 @@ impl Api for Client where body.to_xml() }); -if let Some(body) = body { - request.set_body(body); + if let Some(body) = body { + request.set_body(body); } request.headers_mut().set(ContentType(mimetypes::requests::XML_EXTRA_POST.clone())); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -427,14 +493,13 @@ if let Some(body) = body { body.to_xml() }); -if let Some(body) = body { - request.set_body(body); + if let Some(body) = body { + request.set_body(body); } request.headers_mut().set(ContentType(mimetypes::requests::XML_OTHER_POST.clone())); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -507,14 +572,13 @@ if let Some(body) = body { body.to_xml() }); -if let Some(body) = body { - request.set_body(body); + if let Some(body) = body { + request.set_body(body); } request.headers_mut().set(ContentType(mimetypes::requests::XML_OTHER_PUT.clone())); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -587,14 +651,13 @@ if let Some(body) = body { body.to_xml() }); -if let Some(body) = body { - request.set_body(body); + if let Some(body) = body { + request.set_body(body); } request.headers_mut().set(ContentType(mimetypes::requests::XML_POST.clone())); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -667,14 +730,13 @@ if let Some(body) = body { body.to_xml() }); -if let Some(body) = body { - request.set_body(body); + if let Some(body) = body { + request.set_body(body); } request.headers_mut().set(ContentType(mimetypes::requests::XML_PUT.clone())); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs index 45731e516ac..8b28ecdfc73 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/lib.rs @@ -11,6 +11,7 @@ extern crate chrono; extern crate lazy_static; #[macro_use] extern crate log; +extern crate mime; // Logically this should be in the client and server modules, but rust doesn't allow `macro_use` from a module. #[cfg(any(feature = "client", feature = "server"))] @@ -45,6 +46,12 @@ pub enum RequiredOctetStreamPutResponse { OK , } +#[derive(Debug, PartialEq)] +pub enum UuidGetResponse { + /// Duplicate Response long text. One. + DuplicateResponseLongText ( uuid::Uuid ) , +} + #[derive(Debug, PartialEq)] pub enum XmlExtraPostResponse { /// OK @@ -93,6 +100,9 @@ pub trait Api { fn required_octet_stream_put(&self, body: swagger::ByteArray, context: &C) -> Box>; + fn uuid_get(&self, context: &C) -> Box>; + + fn xml_extra_post(&self, duplicate_xml_object: Option, context: &C) -> Box>; @@ -116,6 +126,9 @@ pub trait ApiNoContext { fn required_octet_stream_put(&self, body: swagger::ByteArray) -> Box>; + fn uuid_get(&self) -> Box>; + + fn xml_extra_post(&self, duplicate_xml_object: Option) -> Box>; @@ -152,6 +165,11 @@ impl<'a, T: Api, C> ApiNoContext for ContextWrapper<'a, T, C> { } + fn uuid_get(&self) -> Box> { + self.api().uuid_get(&self.context()) + } + + fn xml_extra_post(&self, duplicate_xml_object: Option) -> Box> { self.api().xml_extra_post(duplicate_xml_object, &self.context()) } diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/mimetypes.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/mimetypes.rs index 83396a3fa0c..13936792a1f 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/mimetypes.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/mimetypes.rs @@ -4,6 +4,10 @@ pub mod responses { use hyper::mime::*; // The macro is called per-operation to beat the recursion limit + /// Create Mime objects for the response content types for UuidGet + lazy_static! { + pub static ref UUID_GET_DUPLICATE_RESPONSE_LONG_TEXT: Mime = "application/json".parse().unwrap(); + } } diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs index f96ba0a9c5d..66d4e219ac1 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs @@ -5,11 +5,10 @@ extern crate native_tls; extern crate hyper_tls; extern crate openssl; extern crate mime; -extern crate uuid; extern crate chrono; extern crate percent_encoding; extern crate url; - +extern crate uuid; use std::sync::Arc; use std::marker::PhantomData; @@ -19,7 +18,6 @@ use hyper::{Request, Response, Error, StatusCode}; use hyper::header::{Headers, ContentType}; use self::url::form_urlencoded; use mimetypes; - use serde_json; use serde_xml_rs; @@ -38,6 +36,7 @@ use swagger::auth::Scopes; use {Api, RequiredOctetStreamPutResponse, + UuidGetResponse, XmlExtraPostResponse, XmlOtherPostResponse, XmlOtherPutResponse, @@ -57,15 +56,17 @@ mod paths { lazy_static! { pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(&[ r"^/required_octet_stream$", + r"^/uuid$", r"^/xml$", r"^/xml_extra$", r"^/xml_other$" ]).unwrap(); } pub static ID_REQUIRED_OCTET_STREAM: usize = 0; - pub static ID_XML: usize = 1; - pub static ID_XML_EXTRA: usize = 2; - pub static ID_XML_OTHER: usize = 3; + pub static ID_UUID: usize = 1; + pub static ID_XML: usize = 2; + pub static ID_XML_EXTRA: usize = 3; + pub static ID_XML_OTHER: usize = 4; } pub struct NewService { @@ -133,12 +134,6 @@ where // RequiredOctetStreamPut - PUT /required_octet_stream &hyper::Method::Put if path.matched(paths::ID_REQUIRED_OCTET_STREAM) => { - - - - - - // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -147,9 +142,7 @@ where match result { Ok(body) => { let param_body: Option = if !body.is_empty() { - Some(swagger::ByteArray(body.to_vec())) - } else { None }; @@ -157,8 +150,6 @@ where Some(param_body) => param_body, None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body("Missing required body parameter body"))), }; - - Box::new(api_impl.required_octet_stream_put(param_body, &context) .then(move |result| { let mut response = Response::new(); @@ -185,25 +176,57 @@ where future::ok(response) } )) - - }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) ) as Box> - }, + // UuidGet - GET /uuid + &hyper::Method::Get if path.matched(paths::ID_UUID) => { + Box::new({ + {{ + Box::new(api_impl.uuid_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + UuidGetResponse::DuplicateResponseLongText + + (body) + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + response.headers_mut().set(ContentType(mimetypes::responses::UUID_GET_DUPLICATE_RESPONSE_LONG_TEXT.clone())); + + + let body = serde_json::to_string(&body).expect("impossible to fail to serialize"); + + response.set_body(body); + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + }} + }) as Box> + }, // XmlExtraPost - POST /xml_extra &hyper::Method::Post if path.matched(paths::ID_XML_EXTRA) => { - - - - - - // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -211,25 +234,19 @@ where .then(move |result| -> Box> { match result { Ok(body) => { - let mut unused_elements = Vec::new(); let param_duplicate_xml_object: Option = if !body.is_empty() { let deserializer = &mut serde_xml_rs::de::Deserializer::new_from_reader(&*body); - match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); }) { Ok(param_duplicate_xml_object) => param_duplicate_xml_object, - Err(_) => None, } - } else { None }; - - Box::new(api_impl.xml_extra_post(param_duplicate_xml_object, &context) .then(move |result| { let mut response = Response::new(); @@ -267,25 +284,15 @@ where future::ok(response) } )) - - }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter DuplicateXmlObject: {}", e)))), } }) ) as Box> - }, - // XmlOtherPost - POST /xml_other &hyper::Method::Post if path.matched(paths::ID_XML_OTHER) => { - - - - - - // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -293,25 +300,19 @@ where .then(move |result| -> Box> { match result { Ok(body) => { - let mut unused_elements = Vec::new(); let param_another_xml_object: Option = if !body.is_empty() { let deserializer = &mut serde_xml_rs::de::Deserializer::new_from_reader(&*body); - match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); }) { Ok(param_another_xml_object) => param_another_xml_object, - Err(_) => None, } - } else { None }; - - Box::new(api_impl.xml_other_post(param_another_xml_object, &context) .then(move |result| { let mut response = Response::new(); @@ -349,25 +350,15 @@ where future::ok(response) } )) - - }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter AnotherXmlObject: {}", e)))), } }) ) as Box> - }, - // XmlOtherPut - PUT /xml_other &hyper::Method::Put if path.matched(paths::ID_XML_OTHER) => { - - - - - - // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -375,25 +366,19 @@ where .then(move |result| -> Box> { match result { Ok(body) => { - let mut unused_elements = Vec::new(); let param_string: Option = if !body.is_empty() { let deserializer = &mut serde_xml_rs::de::Deserializer::new_from_reader(&*body); - match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); }) { Ok(param_string) => param_string, - Err(_) => None, } - } else { None }; - - Box::new(api_impl.xml_other_put(param_string, &context) .then(move |result| { let mut response = Response::new(); @@ -431,25 +416,15 @@ where future::ok(response) } )) - - }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter string: {}", e)))), } }) ) as Box> - }, - // XmlPost - POST /xml &hyper::Method::Post if path.matched(paths::ID_XML) => { - - - - - - // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -457,25 +432,19 @@ where .then(move |result| -> Box> { match result { Ok(body) => { - let mut unused_elements = Vec::new(); let param_string: Option = if !body.is_empty() { let deserializer = &mut serde_xml_rs::de::Deserializer::new_from_reader(&*body); - match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); }) { Ok(param_string) => param_string, - Err(_) => None, } - } else { None }; - - Box::new(api_impl.xml_post(param_string, &context) .then(move |result| { let mut response = Response::new(); @@ -513,25 +482,15 @@ where future::ok(response) } )) - - }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter string: {}", e)))), } }) ) as Box> - }, - // XmlPut - PUT /xml &hyper::Method::Put if path.matched(paths::ID_XML) => { - - - - - - // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -539,25 +498,19 @@ where .then(move |result| -> Box> { match result { Ok(body) => { - let mut unused_elements = Vec::new(); let param_xml_object: Option = if !body.is_empty() { let deserializer = &mut serde_xml_rs::de::Deserializer::new_from_reader(&*body); - match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); }) { Ok(param_xml_object) => param_xml_object, - Err(_) => None, } - } else { None }; - - Box::new(api_impl.xml_put(param_xml_object, &context) .then(move |result| { let mut response = Response::new(); @@ -595,17 +548,13 @@ where future::ok(response) } )) - - }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter XmlObject: {}", e)))), } }) ) as Box> - }, - _ => Box::new(future::ok(Response::new().with_status(StatusCode::NotFound))) as Box>, } } @@ -621,6 +570,7 @@ impl Clone for Service } } + /// Request parser for `Api`. pub struct ApiRequestParser; impl RequestParser for ApiRequestParser { @@ -631,6 +581,9 @@ impl RequestParser for ApiRequestParser { // RequiredOctetStreamPut - PUT /required_octet_stream &hyper::Method::Put if path.matched(paths::ID_REQUIRED_OCTET_STREAM) => Ok("RequiredOctetStreamPut"), + // UuidGet - GET /uuid + &hyper::Method::Get if path.matched(paths::ID_UUID) => Ok("UuidGet"), + // XmlExtraPost - POST /xml_extra &hyper::Method::Post if path.matched(paths::ID_XML_EXTRA) => Ok("XmlExtraPost"), diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml index 59a86117f93..ced1aff2460 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/Cargo.toml @@ -23,8 +23,8 @@ swagger = "2" # lazy_static = "0.2" log = "0.3.0" -mime = "0.3.3" -multipart = {version = "0.13.3", optional = true} +mime = "0.2.6" +multipart = {version = "0.13.3"} native-tls = {version = "0.1.4", optional = true} openssl = {version = "0.9.14", optional = true} percent-encoding = {version = "1.0.0", optional = true} diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/client/mod.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/client/mod.rs index 2ef91fd174c..1f8c143d76a 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/client/mod.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/client/mod.rs @@ -7,7 +7,7 @@ extern crate mime; extern crate chrono; extern crate url; extern crate serde_urlencoded; - +extern crate multipart; use hyper; use hyper::header::{Headers, ContentType}; @@ -26,9 +26,10 @@ use std::sync::Arc; use std::str; use std::str::FromStr; use std::string::ToString; - +use hyper::mime::Mime; +use std::io::Cursor; +use client::multipart::client::lazy::Multipart; use mimetypes; - use serde_json; use serde_xml_rs; @@ -299,17 +300,13 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Patch, uri); - // Body parameter let body = serde_json::to_string(¶m_body).expect("impossible to fail to serialize"); - request.set_body(body); - request.headers_mut().set(ContentType(mimetypes::requests::TEST_SPECIAL_TAGS.clone())); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -382,20 +379,18 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Post, uri); - // Body parameter let body = param_body.map(|ref body| { serde_json::to_string(body).expect("impossible to fail to serialize") }); -if let Some(body) = body { - request.set_body(body); + if let Some(body) = body { + request.set_body(body); } request.headers_mut().set(ContentType(mimetypes::requests::FAKE_OUTER_BOOLEAN_SERIALIZE.clone())); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -472,14 +467,13 @@ if let Some(body) = body { serde_json::to_string(body).expect("impossible to fail to serialize") }); -if let Some(body) = body { - request.set_body(body); + if let Some(body) = body { + request.set_body(body); } request.headers_mut().set(ContentType(mimetypes::requests::FAKE_OUTER_COMPOSITE_SERIALIZE.clone())); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -556,14 +550,13 @@ if let Some(body) = body { serde_json::to_string(body).expect("impossible to fail to serialize") }); -if let Some(body) = body { - request.set_body(body); + if let Some(body) = body { + request.set_body(body); } request.headers_mut().set(ContentType(mimetypes::requests::FAKE_OUTER_NUMBER_SERIALIZE.clone())); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -640,14 +633,13 @@ if let Some(body) = body { serde_json::to_string(body).expect("impossible to fail to serialize") }); -if let Some(body) = body { - request.set_body(body); + if let Some(body) = body { + request.set_body(body); } request.headers_mut().set(ContentType(mimetypes::requests::FAKE_OUTER_STRING_SERIALIZE.clone())); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -722,14 +714,11 @@ if let Some(body) = body { let mut request = hyper::Request::new(hyper::Method::Put, uri); let body = serde_json::to_string(¶m_body).expect("impossible to fail to serialize"); - request.set_body(body); - request.headers_mut().set(ContentType(mimetypes::requests::TEST_BODY_WITH_QUERY_PARAMS.clone())); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -790,14 +779,11 @@ if let Some(body) = body { let mut request = hyper::Request::new(hyper::Method::Patch, uri); let body = serde_json::to_string(¶m_body).expect("impossible to fail to serialize"); - request.set_body(body); - request.headers_mut().set(ContentType(mimetypes::requests::TEST_CLIENT_MODEL.clone())); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -890,6 +876,7 @@ if let Some(body) = body { request.headers_mut().set(ContentType(mimetypes::requests::TEST_ENDPOINT_PARAMETERS.clone())); request.set_body(body.into_bytes()); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); if let Some(auth_data) = (context as &Has>).get().as_ref() { if let AuthData::Basic(ref basic_header) = *auth_data { @@ -898,7 +885,6 @@ if let Some(body) = body { )) } } - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -986,15 +972,13 @@ if let Some(body) = body { request.headers_mut().set(ContentType(mimetypes::requests::TEST_ENUM_PARAMETERS.clone())); request.set_body(body.into_bytes()); - request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); // Header parameters header! { (RequestEnumHeaderStringArray, "enum_header_string_array") => (String)* } param_enum_header_string_array.map(|header| request.headers_mut().set(RequestEnumHeaderStringArray(header.clone()))); header! { (RequestEnumHeaderString, "enum_header_string") => [String] } param_enum_header_string.map(|header| request.headers_mut().set(RequestEnumHeaderString(header))); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1064,14 +1048,11 @@ if let Some(body) = body { let mut request = hyper::Request::new(hyper::Method::Post, uri); let body = serde_json::to_string(¶m_param).expect("impossible to fail to serialize"); - request.set_body(body); - request.headers_mut().set(ContentType(mimetypes::requests::TEST_INLINE_ADDITIONAL_PROPERTIES.clone())); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1139,9 +1120,8 @@ if let Some(body) = body { request.headers_mut().set(ContentType(mimetypes::requests::TEST_JSON_FORM_DATA.clone())); request.set_body(body.into_bytes()); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1205,17 +1185,13 @@ if let Some(body) = body { let mut request = hyper::Request::new(hyper::Method::Patch, uri); - // Body parameter let body = serde_json::to_string(¶m_body).expect("impossible to fail to serialize"); - request.set_body(body); - request.headers_mut().set(ContentType(mimetypes::requests::TEST_CLASSNAME.clone())); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1288,17 +1264,13 @@ if let Some(body) = body { let mut request = hyper::Request::new(hyper::Method::Post, uri); - // Body parameter let body = param_body.to_xml(); - request.set_body(body); - request.headers_mut().set(ContentType(mimetypes::requests::ADD_PET.clone())); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1360,12 +1332,9 @@ if let Some(body) = body { request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - // Header parameters header! { (RequestApiKey, "api_key") => [String] } param_api_key.map(|header| request.headers_mut().set(RequestApiKey(header))); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1428,8 +1397,6 @@ if let Some(body) = body { request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1515,8 +1482,6 @@ if let Some(body) = body { request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1607,7 +1572,6 @@ if let Some(body) = body { request.headers_mut().set(ApiKey(api_key.to_string())); } } - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1700,14 +1664,11 @@ if let Some(body) = body { let mut request = hyper::Request::new(hyper::Method::Put, uri); let body = param_body.to_xml(); - request.set_body(body); - request.headers_mut().set(ContentType(mimetypes::requests::UPDATE_PET.clone())); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1793,9 +1754,8 @@ if let Some(body) = body { request.headers_mut().set(ContentType(mimetypes::requests::UPDATE_PET_WITH_FORM.clone())); request.set_body(body.into_bytes()); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1855,17 +1815,57 @@ if let Some(body) = body { let mut request = hyper::Request::new(hyper::Method::Post, uri); - let params = &[ - ("additionalMetadata", param_additional_metadata), - ("file", param_file.map(|param| format!("{:?}", param))), - ]; - let body = serde_urlencoded::to_string(params).expect("impossible to fail to serialize"); + let mut multipart = Multipart::new(); + + // For each parameter, encode as appropriate and add to the multipart body as a stream. + + let additional_metadata_str = match serde_json::to_string(¶m_additional_metadata) { + Ok(str) => str, + Err(e) => return Box::new(futures::done(Err(ApiError(format!("Unable to parse additional_metadata to string: {}", e))))), + }; + + let additional_metadata_vec = additional_metadata_str.as_bytes().to_vec(); + + let additional_metadata_mime = mime::Mime::from_str("application/json").expect("impossible to fail to parse"); + + let additional_metadata_cursor = Cursor::new(additional_metadata_vec); + + multipart.add_stream("additional_metadata", additional_metadata_cursor, None as Option<&str>, Some(additional_metadata_mime)); + + + let file_str = match serde_json::to_string(¶m_file) { + Ok(str) => str, + Err(e) => return Box::new(futures::done(Err(ApiError(format!("Unable to parse file to string: {}", e))))), + }; + + let file_vec = file_str.as_bytes().to_vec(); + + let file_mime = mime::Mime::from_str("application/json").expect("impossible to fail to parse"); + + let file_cursor = Cursor::new(file_vec); + + multipart.add_stream("file", file_cursor, None as Option<&str>, Some(file_mime)); + + + let mut fields = match multipart.prepare() { + Ok(fields) => fields, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build request: {}", err))))), + }; + + let mut body_string = String::new(); + fields.to_body().read_to_string(&mut body_string).unwrap(); + let boundary = fields.boundary(); + + let multipart_header = match Mime::from_str(&format!("multipart/form-data;boundary={}", boundary)) { + Ok(multipart_header) => multipart_header, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build multipart header: {:?}", err))))), + }; + + request.set_body(body_string.into_bytes()); + request.headers_mut().set(ContentType(multipart_header)); + - request.headers_mut().set(ContentType(mimetypes::requests::UPLOAD_FILE.clone())); - request.set_body(body.into_bytes()); request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1940,8 +1940,6 @@ if let Some(body) = body { request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2018,7 +2016,6 @@ if let Some(body) = body { request.headers_mut().set(ApiKey(api_key.to_string())); } } - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2093,8 +2090,6 @@ if let Some(body) = body { request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2187,14 +2182,11 @@ if let Some(body) = body { let mut request = hyper::Request::new(hyper::Method::Post, uri); let body = serde_json::to_string(¶m_body).expect("impossible to fail to serialize"); - request.set_body(body); - request.headers_mut().set(ContentType(mimetypes::requests::PLACE_ORDER.clone())); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2277,17 +2269,13 @@ if let Some(body) = body { let mut request = hyper::Request::new(hyper::Method::Post, uri); - // Body parameter let body = serde_json::to_string(¶m_body).expect("impossible to fail to serialize"); - request.set_body(body); - request.headers_mut().set(ContentType(mimetypes::requests::CREATE_USER.clone())); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2348,14 +2336,11 @@ if let Some(body) = body { let mut request = hyper::Request::new(hyper::Method::Post, uri); let body = serde_json::to_string(¶m_body).expect("impossible to fail to serialize"); - request.set_body(body); - request.headers_mut().set(ContentType(mimetypes::requests::CREATE_USERS_WITH_ARRAY_INPUT.clone())); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2416,14 +2401,11 @@ if let Some(body) = body { let mut request = hyper::Request::new(hyper::Method::Post, uri); let body = serde_json::to_string(¶m_body).expect("impossible to fail to serialize"); - request.set_body(body); - request.headers_mut().set(ContentType(mimetypes::requests::CREATE_USERS_WITH_LIST_INPUT.clone())); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2485,8 +2467,6 @@ if let Some(body) = body { request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2557,8 +2537,6 @@ if let Some(body) = body { request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2654,8 +2632,6 @@ if let Some(body) = body { request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2750,8 +2726,6 @@ if let Some(body) = body { request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2812,14 +2786,11 @@ if let Some(body) = body { let mut request = hyper::Request::new(hyper::Method::Put, uri); let body = serde_json::to_string(¶m_body).expect("impossible to fail to serialize"); - request.set_body(body); - request.headers_mut().set(ContentType(mimetypes::requests::UPDATE_USER.clone())); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs index 026ca6ef5de..479be7ad652 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs @@ -11,6 +11,7 @@ extern crate chrono; extern crate lazy_static; #[macro_use] extern crate log; +extern crate mime; // Logically this should be in the client and server modules, but rust doesn't allow `macro_use` from a module. #[cfg(any(feature = "client", feature = "server"))] diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs index 898516f3f25..c2976549005 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs @@ -5,11 +5,11 @@ extern crate native_tls; extern crate hyper_tls; extern crate openssl; extern crate mime; -extern crate uuid; extern crate chrono; extern crate percent_encoding; extern crate url; - +extern crate uuid; +extern crate multipart; use std::sync::Arc; use std::marker::PhantomData; @@ -19,7 +19,9 @@ use hyper::{Request, Response, Error, StatusCode}; use hyper::header::{Headers, ContentType}; use self::url::form_urlencoded; use mimetypes; - +use self::multipart::server::Multipart; +use self::multipart::server::save::SaveResult; +use std::fs; use serde_json; use serde_xml_rs; @@ -211,12 +213,6 @@ where // TestSpecialTags - PATCH /another-fake/dummy &hyper::Method::Patch if path.matched(paths::ID_ANOTHER_FAKE_DUMMY) => { - - - - - - // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -224,12 +220,9 @@ where .then(move |result| -> Box> { match result { Ok(body) => { - let mut unused_elements = Vec::new(); let param_body: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); - match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -237,7 +230,6 @@ where Ok(param_body) => param_body, Err(e) => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't parse body parameter body - doesn't match schema: {}", e)))), } - } else { None }; @@ -245,8 +237,6 @@ where Some(param_body) => param_body, None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body("Missing required body parameter body"))), }; - - Box::new(api_impl.test_special_tags(param_body, &context) .then(move |result| { let mut response = Response::new(); @@ -285,25 +275,15 @@ where future::ok(response) } )) - - }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) ) as Box> - }, - // FakeOuterBooleanSerialize - POST /fake/outer/boolean &hyper::Method::Post if path.matched(paths::ID_FAKE_OUTER_BOOLEAN) => { - - - - - - // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -311,26 +291,19 @@ where .then(move |result| -> Box> { match result { Ok(body) => { - let mut unused_elements = Vec::new(); let param_body: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); - match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); }) { Ok(param_body) => param_body, - Err(_) => None, } - } else { None }; - - Box::new(api_impl.fake_outer_boolean_serialize(param_body, &context) .then(move |result| { let mut response = Response::new(); @@ -369,25 +342,15 @@ where future::ok(response) } )) - - }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) ) as Box> - }, - // FakeOuterCompositeSerialize - POST /fake/outer/composite &hyper::Method::Post if path.matched(paths::ID_FAKE_OUTER_COMPOSITE) => { - - - - - - // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -395,26 +358,19 @@ where .then(move |result| -> Box> { match result { Ok(body) => { - let mut unused_elements = Vec::new(); let param_body: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); - match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); }) { Ok(param_body) => param_body, - Err(_) => None, } - } else { None }; - - Box::new(api_impl.fake_outer_composite_serialize(param_body, &context) .then(move |result| { let mut response = Response::new(); @@ -453,25 +409,15 @@ where future::ok(response) } )) - - }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) ) as Box> - }, - // FakeOuterNumberSerialize - POST /fake/outer/number &hyper::Method::Post if path.matched(paths::ID_FAKE_OUTER_NUMBER) => { - - - - - - // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -479,26 +425,19 @@ where .then(move |result| -> Box> { match result { Ok(body) => { - let mut unused_elements = Vec::new(); let param_body: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); - match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); }) { Ok(param_body) => param_body, - Err(_) => None, } - } else { None }; - - Box::new(api_impl.fake_outer_number_serialize(param_body, &context) .then(move |result| { let mut response = Response::new(); @@ -537,25 +476,15 @@ where future::ok(response) } )) - - }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) ) as Box> - }, - // FakeOuterStringSerialize - POST /fake/outer/string &hyper::Method::Post if path.matched(paths::ID_FAKE_OUTER_STRING) => { - - - - - - // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -563,26 +492,19 @@ where .then(move |result| -> Box> { match result { Ok(body) => { - let mut unused_elements = Vec::new(); let param_body: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); - match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); }) { Ok(param_body) => param_body, - Err(_) => None, } - } else { None }; - - Box::new(api_impl.fake_outer_string_serialize(param_body, &context) .then(move |result| { let mut response = Response::new(); @@ -621,28 +543,18 @@ where future::ok(response) } )) - - }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) ) as Box> - }, - // TestBodyWithQueryParams - PUT /fake/body-with-query-params &hyper::Method::Put if path.matched(paths::ID_FAKE_BODY_WITH_QUERY_PARAMS) => { - - - - - // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = form_urlencoded::parse(uri.query().unwrap_or_default().as_bytes()).collect::>(); let param_query = query_params.iter().filter(|e| e.0 == "query").map(|e| e.1.to_owned()) - .nth(0); let param_query = match param_query { Some(param_query) => match param_query.parse::() { @@ -651,8 +563,6 @@ where }, None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body("Missing required query parameter query"))), }; - - // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -660,12 +570,9 @@ where .then(move |result| -> Box> { match result { Ok(body) => { - let mut unused_elements = Vec::new(); let param_body: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); - match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -673,7 +580,6 @@ where Ok(param_body) => param_body, Err(e) => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't parse body parameter body - doesn't match schema: {}", e)))), } - } else { None }; @@ -681,8 +587,6 @@ where Some(param_body) => param_body, None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body("Missing required body parameter body"))), }; - - Box::new(api_impl.test_body_with_query_params(param_query, param_body, &context) .then(move |result| { let mut response = Response::new(); @@ -713,25 +617,15 @@ where future::ok(response) } )) - - }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) ) as Box> - }, - // TestClientModel - PATCH /fake &hyper::Method::Patch if path.matched(paths::ID_FAKE) => { - - - - - - // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -739,12 +633,9 @@ where .then(move |result| -> Box> { match result { Ok(body) => { - let mut unused_elements = Vec::new(); let param_body: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); - match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -752,7 +643,6 @@ where Ok(param_body) => param_body, Err(e) => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't parse body parameter body - doesn't match schema: {}", e)))), } - } else { None }; @@ -760,8 +650,6 @@ where Some(param_body) => param_body, None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body("Missing required body parameter body"))), }; - - Box::new(api_impl.test_client_model(param_body, &context) .then(move |result| { let mut response = Response::new(); @@ -800,17 +688,13 @@ where future::ok(response) } )) - - }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) ) as Box> - }, - // TestEndpointParameters - POST /fake &hyper::Method::Post if path.matched(paths::ID_FAKE) => { { @@ -822,16 +706,8 @@ where }; } - - - - - - - Box::new({ {{ - // Form parameters let param_integer = Some(56); let param_int32 = Some(56); @@ -847,7 +723,6 @@ where let param_date_time = None; let param_password = Some("password_example".to_string()); let param_callback = Some("callback_example".to_string()); - Box::new(api_impl.test_endpoint_parameters(param_number, param_double, param_pattern_without_delimiter, param_byte, param_integer, param_int32, param_int64, param_float, param_string, param_binary, param_date, param_date_time, param_password, param_callback, &context) .then(move |result| { let mut response = Response::new(); @@ -881,27 +756,17 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // TestEnumParameters - GET /fake &hyper::Method::Get if path.matched(paths::ID_FAKE) => { - - - // Header parameters header! { (RequestEnumHeaderStringArray, "enum_header_string_array") => (String)* } let param_enum_header_string_array = headers.get::().map(|header| header.0.clone()); header! { (RequestEnumHeaderString, "enum_header_string") => [String] } let param_enum_header_string = headers.get::().map(|header| header.0.clone()); - - - // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = form_urlencoded::parse(uri.query().unwrap_or_default().as_bytes()).collect::>(); let param_enum_query_string_array = query_params.iter().filter(|e| e.0 == "enum_query_string_array").map(|e| e.1.to_owned()) @@ -913,29 +778,21 @@ where None }; let param_enum_query_string = query_params.iter().filter(|e| e.0 == "enum_query_string").map(|e| e.1.to_owned()) - .nth(0); let param_enum_query_string = param_enum_query_string.and_then(|param_enum_query_string| param_enum_query_string.parse::<>().ok()); let param_enum_query_integer = query_params.iter().filter(|e| e.0 == "enum_query_integer").map(|e| e.1.to_owned()) - .nth(0); let param_enum_query_integer = param_enum_query_integer.and_then(|param_enum_query_integer| param_enum_query_integer.parse::<>().ok()); let param_enum_query_double = query_params.iter().filter(|e| e.0 == "enum_query_double").map(|e| e.1.to_owned()) - .nth(0); let param_enum_query_double = param_enum_query_double.and_then(|param_enum_query_double| param_enum_query_double.parse::<>().ok()); - - - Box::new({ {{ - // Form parameters let param_enum_form_string = Some("enum_form_string_example".to_string()); - Box::new(api_impl.test_enum_parameters(param_enum_header_string_array.as_ref(), param_enum_header_string, param_enum_query_string_array.as_ref(), param_enum_query_string, param_enum_query_integer, param_enum_query_double, param_enum_form_string, &context) .then(move |result| { let mut response = Response::new(); @@ -969,22 +826,12 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // TestInlineAdditionalProperties - POST /fake/inline-additionalProperties &hyper::Method::Post if path.matched(paths::ID_FAKE_INLINE_ADDITIONALPROPERTIES) => { - - - - - - // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -992,12 +839,9 @@ where .then(move |result| -> Box> { match result { Ok(body) => { - let mut unused_elements = Vec::new(); let param_param: Option> = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); - match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -1005,7 +849,6 @@ where Ok(param_param) => param_param, Err(e) => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't parse body parameter param - doesn't match schema: {}", e)))), } - } else { None }; @@ -1013,8 +856,6 @@ where Some(param_param) => param_param, None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body("Missing required body parameter param"))), }; - - Box::new(api_impl.test_inline_additional_properties(param_param, &context) .then(move |result| { let mut response = Response::new(); @@ -1045,33 +886,20 @@ where future::ok(response) } )) - - }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter param: {}", e)))), } }) ) as Box> - }, - // TestJsonFormData - GET /fake/jsonFormData &hyper::Method::Get if path.matched(paths::ID_FAKE_JSONFORMDATA) => { - - - - - - - Box::new({ {{ - // Form parameters let param_param = "param_example".to_string(); let param_param2 = "param2_example".to_string(); - Box::new(api_impl.test_json_form_data(param_param, param_param2, &context) .then(move |result| { let mut response = Response::new(); @@ -1098,14 +926,10 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // TestClassname - PATCH /fake_classname_test &hyper::Method::Patch if path.matched(paths::ID_FAKE_CLASSNAME_TEST) => { { @@ -1117,12 +941,6 @@ where }; } - - - - - - // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -1130,12 +948,9 @@ where .then(move |result| -> Box> { match result { Ok(body) => { - let mut unused_elements = Vec::new(); let param_body: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); - match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -1143,7 +958,6 @@ where Ok(param_body) => param_body, Err(e) => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't parse body parameter body - doesn't match schema: {}", e)))), } - } else { None }; @@ -1151,8 +965,6 @@ where Some(param_body) => param_body, None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body("Missing required body parameter body"))), }; - - Box::new(api_impl.test_classname(param_body, &context) .then(move |result| { let mut response = Response::new(); @@ -1191,17 +1003,13 @@ where future::ok(response) } )) - - }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) ) as Box> - }, - // AddPet - POST /pet &hyper::Method::Post if path.matched(paths::ID_PET) => { { @@ -1231,12 +1039,6 @@ where } } } - - - - - - // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -1244,11 +1046,9 @@ where .then(move |result| -> Box> { match result { Ok(body) => { - let mut unused_elements = Vec::new(); let param_body: Option = if !body.is_empty() { let deserializer = &mut serde_xml_rs::de::Deserializer::new_from_reader(&*body); - match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -1256,7 +1056,6 @@ where Ok(param_body) => param_body, Err(e) => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't parse body parameter body - doesn't match schema: {}", e)))), } - } else { None }; @@ -1264,8 +1063,6 @@ where Some(param_body) => param_body, None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body("Missing required body parameter body"))), }; - - Box::new(api_impl.add_pet(param_body, &context) .then(move |result| { let mut response = Response::new(); @@ -1296,17 +1093,13 @@ where future::ok(response) } )) - - }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) ) as Box> - }, - // DeletePet - DELETE /pet/{petId} &hyper::Method::Delete if path.matched(paths::ID_PET_PETID) => { { @@ -1336,8 +1129,6 @@ where } } } - - // Path parameters let path = uri.path().to_string(); let path_params = @@ -1346,7 +1137,6 @@ where .unwrap_or_else(|| panic!("Path {} matched RE PET_PETID in set but failed match against \"{}\"", path, paths::REGEX_PET_PETID.as_str()) ); - let param_pet_id = match percent_encoding::percent_decode(path_params["petId"].as_bytes()).decode_utf8() { Ok(param_pet_id) => match param_pet_id.parse::() { Ok(param_pet_id) => param_pet_id, @@ -1354,18 +1144,11 @@ where }, Err(_) => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't percent-decode path parameter as UTF-8: {}", &path_params["petId"])))) }; - // Header parameters header! { (RequestApiKey, "api_key") => [String] } let param_api_key = headers.get::().map(|header| header.0.clone()); - - - - - Box::new({ {{ - Box::new(api_impl.delete_pet(param_pet_id, param_api_key, &context) .then(move |result| { let mut response = Response::new(); @@ -1392,14 +1175,10 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // FindPetsByStatus - GET /pet/findByStatus &hyper::Method::Get if path.matched(paths::ID_PET_FINDBYSTATUS) => { { @@ -1429,22 +1208,13 @@ where } } } - - - - - // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = form_urlencoded::parse(uri.query().unwrap_or_default().as_bytes()).collect::>(); let param_status = query_params.iter().filter(|e| e.0 == "status").map(|e| e.1.to_owned()) .filter_map(|param_status| param_status.parse::().ok()) .collect::>(); - - - Box::new({ {{ - Box::new(api_impl.find_pets_by_status(param_status.as_ref(), &context) .then(move |result| { let mut response = Response::new(); @@ -1486,14 +1256,10 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // FindPetsByTags - GET /pet/findByTags &hyper::Method::Get if path.matched(paths::ID_PET_FINDBYTAGS) => { { @@ -1523,22 +1289,13 @@ where } } } - - - - - // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = form_urlencoded::parse(uri.query().unwrap_or_default().as_bytes()).collect::>(); let param_tags = query_params.iter().filter(|e| e.0 == "tags").map(|e| e.1.to_owned()) .filter_map(|param_tags| param_tags.parse::().ok()) .collect::>(); - - - Box::new({ {{ - Box::new(api_impl.find_pets_by_tags(param_tags.as_ref(), &context) .then(move |result| { let mut response = Response::new(); @@ -1580,14 +1337,10 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // GetPetById - GET /pet/{petId} &hyper::Method::Get if path.matched(paths::ID_PET_PETID) => { { @@ -1599,8 +1352,6 @@ where }; } - - // Path parameters let path = uri.path().to_string(); let path_params = @@ -1609,7 +1360,6 @@ where .unwrap_or_else(|| panic!("Path {} matched RE PET_PETID in set but failed match against \"{}\"", path, paths::REGEX_PET_PETID.as_str()) ); - let param_pet_id = match percent_encoding::percent_decode(path_params["petId"].as_bytes()).decode_utf8() { Ok(param_pet_id) => match param_pet_id.parse::() { Ok(param_pet_id) => param_pet_id, @@ -1617,14 +1367,8 @@ where }, Err(_) => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't percent-decode path parameter as UTF-8: {}", &path_params["petId"])))) }; - - - - - Box::new({ {{ - Box::new(api_impl.get_pet_by_id(param_pet_id, &context) .then(move |result| { let mut response = Response::new(); @@ -1673,14 +1417,10 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // UpdatePet - PUT /pet &hyper::Method::Put if path.matched(paths::ID_PET) => { { @@ -1710,12 +1450,6 @@ where } } } - - - - - - // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -1723,11 +1457,9 @@ where .then(move |result| -> Box> { match result { Ok(body) => { - let mut unused_elements = Vec::new(); let param_body: Option = if !body.is_empty() { let deserializer = &mut serde_xml_rs::de::Deserializer::new_from_reader(&*body); - match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -1735,7 +1467,6 @@ where Ok(param_body) => param_body, Err(e) => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't parse body parameter body - doesn't match schema: {}", e)))), } - } else { None }; @@ -1743,8 +1474,6 @@ where Some(param_body) => param_body, None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body("Missing required body parameter body"))), }; - - Box::new(api_impl.update_pet(param_body, &context) .then(move |result| { let mut response = Response::new(); @@ -1789,17 +1518,13 @@ where future::ok(response) } )) - - }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) ) as Box> - }, - // UpdatePetWithForm - POST /pet/{petId} &hyper::Method::Post if path.matched(paths::ID_PET_PETID) => { { @@ -1829,8 +1554,6 @@ where } } } - - // Path parameters let path = uri.path().to_string(); let path_params = @@ -1839,7 +1562,6 @@ where .unwrap_or_else(|| panic!("Path {} matched RE PET_PETID in set but failed match against \"{}\"", path, paths::REGEX_PET_PETID.as_str()) ); - let param_pet_id = match percent_encoding::percent_decode(path_params["petId"].as_bytes()).decode_utf8() { Ok(param_pet_id) => match param_pet_id.parse::() { Ok(param_pet_id) => param_pet_id, @@ -1847,18 +1569,11 @@ where }, Err(_) => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't percent-decode path parameter as UTF-8: {}", &path_params["petId"])))) }; - - - - - Box::new({ {{ - // Form parameters let param_name = Some("name_example".to_string()); let param_status = Some("status_example".to_string()); - Box::new(api_impl.update_pet_with_form(param_pet_id, param_name, param_status, &context) .then(move |result| { let mut response = Response::new(); @@ -1885,14 +1600,10 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // UploadFile - POST /pet/{petId}/uploadImage &hyper::Method::Post if path.matched(paths::ID_PET_PETID_UPLOADIMAGE) => { { @@ -1922,8 +1633,10 @@ where } } } - - + let boundary = match multipart_boundary(&headers) { + Some(boundary) => boundary.to_string(), + None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body("Couldn't find valid multipart body"))), + }; // Path parameters let path = uri.path().to_string(); let path_params = @@ -1932,7 +1645,6 @@ where .unwrap_or_else(|| panic!("Path {} matched RE PET_PETID_UPLOADIMAGE in set but failed match against \"{}\"", path, paths::REGEX_PET_PETID_UPLOADIMAGE.as_str()) ); - let param_pet_id = match percent_encoding::percent_decode(path_params["petId"].as_bytes()).decode_utf8() { Ok(param_pet_id) => match param_pet_id.parse::() { Ok(param_pet_id) => param_pet_id, @@ -1940,18 +1652,48 @@ where }, Err(_) => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't percent-decode path parameter as UTF-8: {}", &path_params["petId"])))) }; + // Form Body parameters (note that non-required body parameters will ignore garbage + // values, rather than causing a 400 response). Produce warning header and logs for + // any unused fields. + Box::new(body.concat2() + .then(move |result| -> Box> { + match result { + Ok(body) => { + // Read Form Parameters from body + let mut entries = match Multipart::with_body(&body.to_vec()[..], boundary).save().temp() { + SaveResult::Full(entries) => { + entries + }, + _ => { + return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Unable to process all message parts")))) + }, + }; + + + let file_additional_metadata = entries.files.remove("additional_metadata"); + let param_additional_metadata = match file_additional_metadata { + Some(file) => { + let path = &file[0].path; + let additional_metadata_str = fs::read_to_string(path).unwrap(); + let additional_metadata_model: String = serde_json::from_str(&additional_metadata_str).expect("Impossible to fail to serialise"); + Some(additional_metadata_model) + } + None => None, + }; + - - - - - Box::new({ - {{ - - // Form parameters - let param_additional_metadata = Some("additional_metadata_example".to_string()); - let param_file = Some(swagger::ByteArray(Vec::from("BINARY_DATA_HERE"))); - + + let file_file = entries.files.remove("file"); + let param_file = match file_file { + Some(file) => { + let path = &file[0].path; + let file_str = fs::read_to_string(path).unwrap(); + let file_model: swagger::ByteArray = serde_json::from_str(&file_str).expect("Impossible to fail to serialise"); + Some(file_model) + } + None => None, + }; + Box::new(api_impl.upload_file(param_pet_id, param_additional_metadata, param_file, &context) .then(move |result| { let mut response = Response::new(); @@ -1986,18 +1728,16 @@ where future::ok(response) } )) - - }} - }) as Box> - - + as Box> + }, + Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read multipart body")))), + } + }) + ) }, - // DeleteOrder - DELETE /store/order/{order_id} &hyper::Method::Delete if path.matched(paths::ID_STORE_ORDER_ORDER_ID) => { - - // Path parameters let path = uri.path().to_string(); let path_params = @@ -2006,7 +1746,6 @@ where .unwrap_or_else(|| panic!("Path {} matched RE STORE_ORDER_ORDER_ID in set but failed match against \"{}\"", path, paths::REGEX_STORE_ORDER_ORDER_ID.as_str()) ); - let param_order_id = match percent_encoding::percent_decode(path_params["order_id"].as_bytes()).decode_utf8() { Ok(param_order_id) => match param_order_id.parse::() { Ok(param_order_id) => param_order_id, @@ -2014,14 +1753,8 @@ where }, Err(_) => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't percent-decode path parameter as UTF-8: {}", &path_params["order_id"])))) }; - - - - - Box::new({ {{ - Box::new(api_impl.delete_order(param_order_id, &context) .then(move |result| { let mut response = Response::new(); @@ -2055,14 +1788,10 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // GetInventory - GET /store/inventory &hyper::Method::Get if path.matched(paths::ID_STORE_INVENTORY) => { { @@ -2074,16 +1803,8 @@ where }; } - - - - - - - Box::new({ {{ - Box::new(api_impl.get_inventory(&context) .then(move |result| { let mut response = Response::new(); @@ -2118,18 +1839,12 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // GetOrderById - GET /store/order/{order_id} &hyper::Method::Get if path.matched(paths::ID_STORE_ORDER_ORDER_ID) => { - - // Path parameters let path = uri.path().to_string(); let path_params = @@ -2138,7 +1853,6 @@ where .unwrap_or_else(|| panic!("Path {} matched RE STORE_ORDER_ORDER_ID in set but failed match against \"{}\"", path, paths::REGEX_STORE_ORDER_ORDER_ID.as_str()) ); - let param_order_id = match percent_encoding::percent_decode(path_params["order_id"].as_bytes()).decode_utf8() { Ok(param_order_id) => match param_order_id.parse::() { Ok(param_order_id) => param_order_id, @@ -2146,14 +1860,8 @@ where }, Err(_) => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't percent-decode path parameter as UTF-8: {}", &path_params["order_id"])))) }; - - - - - Box::new({ {{ - Box::new(api_impl.get_order_by_id(param_order_id, &context) .then(move |result| { let mut response = Response::new(); @@ -2202,22 +1910,12 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // PlaceOrder - POST /store/order &hyper::Method::Post if path.matched(paths::ID_STORE_ORDER) => { - - - - - - // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -2225,12 +1923,9 @@ where .then(move |result| -> Box> { match result { Ok(body) => { - let mut unused_elements = Vec::new(); let param_body: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); - match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -2238,7 +1933,6 @@ where Ok(param_body) => param_body, Err(e) => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't parse body parameter body - doesn't match schema: {}", e)))), } - } else { None }; @@ -2246,8 +1940,6 @@ where Some(param_body) => param_body, None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body("Missing required body parameter body"))), }; - - Box::new(api_impl.place_order(param_body, &context) .then(move |result| { let mut response = Response::new(); @@ -2293,25 +1985,15 @@ where future::ok(response) } )) - - }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) ) as Box> - }, - // CreateUser - POST /user &hyper::Method::Post if path.matched(paths::ID_USER) => { - - - - - - // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -2319,12 +2001,9 @@ where .then(move |result| -> Box> { match result { Ok(body) => { - let mut unused_elements = Vec::new(); let param_body: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); - match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -2332,7 +2011,6 @@ where Ok(param_body) => param_body, Err(e) => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't parse body parameter body - doesn't match schema: {}", e)))), } - } else { None }; @@ -2340,8 +2018,6 @@ where Some(param_body) => param_body, None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body("Missing required body parameter body"))), }; - - Box::new(api_impl.create_user(param_body, &context) .then(move |result| { let mut response = Response::new(); @@ -2372,25 +2048,15 @@ where future::ok(response) } )) - - }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) ) as Box> - }, - // CreateUsersWithArrayInput - POST /user/createWithArray &hyper::Method::Post if path.matched(paths::ID_USER_CREATEWITHARRAY) => { - - - - - - // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -2398,12 +2064,9 @@ where .then(move |result| -> Box> { match result { Ok(body) => { - let mut unused_elements = Vec::new(); let param_body: Option> = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); - match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -2411,7 +2074,6 @@ where Ok(param_body) => param_body, Err(e) => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't parse body parameter body - doesn't match schema: {}", e)))), } - } else { None }; @@ -2419,8 +2081,6 @@ where Some(param_body) => param_body, None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body("Missing required body parameter body"))), }; - - Box::new(api_impl.create_users_with_array_input(param_body.as_ref(), &context) .then(move |result| { let mut response = Response::new(); @@ -2451,25 +2111,15 @@ where future::ok(response) } )) - - }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) ) as Box> - }, - // CreateUsersWithListInput - POST /user/createWithList &hyper::Method::Post if path.matched(paths::ID_USER_CREATEWITHLIST) => { - - - - - - // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -2477,12 +2127,9 @@ where .then(move |result| -> Box> { match result { Ok(body) => { - let mut unused_elements = Vec::new(); let param_body: Option> = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); - match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -2490,7 +2137,6 @@ where Ok(param_body) => param_body, Err(e) => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't parse body parameter body - doesn't match schema: {}", e)))), } - } else { None }; @@ -2498,8 +2144,6 @@ where Some(param_body) => param_body, None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body("Missing required body parameter body"))), }; - - Box::new(api_impl.create_users_with_list_input(param_body.as_ref(), &context) .then(move |result| { let mut response = Response::new(); @@ -2530,21 +2174,15 @@ where future::ok(response) } )) - - }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) ) as Box> - }, - // DeleteUser - DELETE /user/{username} &hyper::Method::Delete if path.matched(paths::ID_USER_USERNAME) => { - - // Path parameters let path = uri.path().to_string(); let path_params = @@ -2553,7 +2191,6 @@ where .unwrap_or_else(|| panic!("Path {} matched RE USER_USERNAME in set but failed match against \"{}\"", path, paths::REGEX_USER_USERNAME.as_str()) ); - let param_username = match percent_encoding::percent_decode(path_params["username"].as_bytes()).decode_utf8() { Ok(param_username) => match param_username.parse::() { Ok(param_username) => param_username, @@ -2561,14 +2198,8 @@ where }, Err(_) => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't percent-decode path parameter as UTF-8: {}", &path_params["username"])))) }; - - - - - Box::new({ {{ - Box::new(api_impl.delete_user(param_username, &context) .then(move |result| { let mut response = Response::new(); @@ -2602,18 +2233,12 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // GetUserByName - GET /user/{username} &hyper::Method::Get if path.matched(paths::ID_USER_USERNAME) => { - - // Path parameters let path = uri.path().to_string(); let path_params = @@ -2622,7 +2247,6 @@ where .unwrap_or_else(|| panic!("Path {} matched RE USER_USERNAME in set but failed match against \"{}\"", path, paths::REGEX_USER_USERNAME.as_str()) ); - let param_username = match percent_encoding::percent_decode(path_params["username"].as_bytes()).decode_utf8() { Ok(param_username) => match param_username.parse::() { Ok(param_username) => param_username, @@ -2630,14 +2254,8 @@ where }, Err(_) => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't percent-decode path parameter as UTF-8: {}", &path_params["username"])))) }; - - - - - Box::new({ {{ - Box::new(api_impl.get_user_by_name(param_username, &context) .then(move |result| { let mut response = Response::new(); @@ -2686,25 +2304,15 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // LoginUser - GET /user/login &hyper::Method::Get if path.matched(paths::ID_USER_LOGIN) => { - - - - - // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) let query_params = form_urlencoded::parse(uri.query().unwrap_or_default().as_bytes()).collect::>(); let param_username = query_params.iter().filter(|e| e.0 == "username").map(|e| e.1.to_owned()) - .nth(0); let param_username = match param_username { Some(param_username) => match param_username.parse::() { @@ -2714,7 +2322,6 @@ where None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body("Missing required query parameter username"))), }; let param_password = query_params.iter().filter(|e| e.0 == "password").map(|e| e.1.to_owned()) - .nth(0); let param_password = match param_password { Some(param_password) => match param_password.parse::() { @@ -2723,12 +2330,8 @@ where }, None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body("Missing required query parameter password"))), }; - - - Box::new({ {{ - Box::new(api_impl.login_user(param_username, param_password, &context) .then(move |result| { let mut response = Response::new(); @@ -2779,26 +2382,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // LogoutUser - GET /user/logout &hyper::Method::Get if path.matched(paths::ID_USER_LOGOUT) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.logout_user(&context) .then(move |result| { let mut response = Response::new(); @@ -2825,18 +2416,12 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // UpdateUser - PUT /user/{username} &hyper::Method::Put if path.matched(paths::ID_USER_USERNAME) => { - - // Path parameters let path = uri.path().to_string(); let path_params = @@ -2845,7 +2430,6 @@ where .unwrap_or_else(|| panic!("Path {} matched RE USER_USERNAME in set but failed match against \"{}\"", path, paths::REGEX_USER_USERNAME.as_str()) ); - let param_username = match percent_encoding::percent_decode(path_params["username"].as_bytes()).decode_utf8() { Ok(param_username) => match param_username.parse::() { Ok(param_username) => param_username, @@ -2853,10 +2437,6 @@ where }, Err(_) => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't percent-decode path parameter as UTF-8: {}", &path_params["username"])))) }; - - - - // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -2864,12 +2444,9 @@ where .then(move |result| -> Box> { match result { Ok(body) => { - let mut unused_elements = Vec::new(); let param_body: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); - match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -2877,7 +2454,6 @@ where Ok(param_body) => param_body, Err(e) => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't parse body parameter body - doesn't match schema: {}", e)))), } - } else { None }; @@ -2885,8 +2461,6 @@ where Some(param_body) => param_body, None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body("Missing required body parameter body"))), }; - - Box::new(api_impl.update_user(param_username, param_body, &context) .then(move |result| { let mut response = Response::new(); @@ -2924,17 +2498,13 @@ where future::ok(response) } )) - - }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) ) as Box> - }, - _ => Box::new(future::ok(Response::new().with_status(StatusCode::NotFound))) as Box>, } } @@ -2950,6 +2520,18 @@ impl Clone for Service } } +/// Utility function to get the multipart boundary marker (if any) from the Headers. +fn multipart_boundary<'a>(headers: &'a Headers) -> Option<&'a str> { + headers.get::().and_then(|content_type| { + let ContentType(ref mime) = *content_type; + if mime.type_() == hyper::mime::MULTIPART && mime.subtype() == hyper::mime::FORM_DATA { + mime.get_param(hyper::mime::BOUNDARY).map(|x| x.as_str()) + } else { + None + } + }) +} + /// Request parser for `Api`. pub struct ApiRequestParser; impl RequestParser for ApiRequestParser { diff --git a/samples/server/petstore/rust-server/output/rust-server-test/Cargo.toml b/samples/server/petstore/rust-server/output/rust-server-test/Cargo.toml index 3a837e477ea..bfae24310b9 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/Cargo.toml +++ b/samples/server/petstore/rust-server/output/rust-server-test/Cargo.toml @@ -23,8 +23,8 @@ swagger = "2" # lazy_static = "0.2" log = "0.3.0" -mime = "0.3.3" -multipart = {version = "0.13.3", optional = true} +mime = "0.2.6" +multipart = {version = "0.13.3"} native-tls = {version = "0.1.4", optional = true} openssl = {version = "0.9.14", optional = true} percent-encoding = {version = "1.0.0", optional = true} diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/client/mod.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/client/mod.rs index 0835b2a79c3..64b47aa5f24 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/src/client/mod.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/client/mod.rs @@ -7,8 +7,6 @@ extern crate mime; extern crate chrono; extern crate url; - - use hyper; use hyper::header::{Headers, ContentType}; use hyper::Uri; @@ -26,12 +24,9 @@ use std::sync::Arc; use std::str; use std::str::FromStr; use std::string::ToString; - use mimetypes; - use serde_json; - #[allow(unused_imports)] use std::collections::{HashMap, BTreeMap}; #[allow(unused_imports)] @@ -274,8 +269,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -336,14 +329,11 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Put, uri); let body = serde_json::to_string(¶m_nested_response).expect("impossible to fail to serialize"); - request.set_body(body); - request.headers_mut().set(ContentType(mimetypes::requests::DUMMY_PUT.clone())); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -405,8 +395,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -480,14 +468,11 @@ impl Api for Client where let mut request = hyper::Request::new(hyper::Method::Post, uri); let body = param_body; - request.set_body(body); - request.headers_mut().set(ContentType(mimetypes::requests::HTML_POST.clone())); + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -562,8 +547,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/lib.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/lib.rs index 5f9e44062b0..b8d7ed225b3 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/src/lib.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/lib.rs @@ -11,6 +11,7 @@ extern crate chrono; extern crate lazy_static; #[macro_use] extern crate log; +extern crate mime; // Logically this should be in the client and server modules, but rust doesn't allow `macro_use` from a module. #[cfg(any(feature = "client", feature = "server"))] diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs index 1312c9d0183..f3dfff3a1d1 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs @@ -5,11 +5,10 @@ extern crate native_tls; extern crate hyper_tls; extern crate openssl; extern crate mime; -extern crate uuid; extern crate chrono; extern crate percent_encoding; extern crate url; - +extern crate uuid; use std::sync::Arc; use std::marker::PhantomData; @@ -19,10 +18,8 @@ use hyper::{Request, Response, Error, StatusCode}; use hyper::header::{Headers, ContentType}; use self::url::form_urlencoded; use mimetypes; - use serde_json; - #[allow(unused_imports)] use std::collections::{HashMap, BTreeMap}; #[allow(unused_imports)] @@ -132,16 +129,8 @@ where // DummyGet - GET /dummy &hyper::Method::Get if path.matched(paths::ID_DUMMY) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.dummy_get(&context) .then(move |result| { let mut response = Response::new(); @@ -168,22 +157,12 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // DummyPut - PUT /dummy &hyper::Method::Put if path.matched(paths::ID_DUMMY) => { - - - - - - // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -191,12 +170,9 @@ where .then(move |result| -> Box> { match result { Ok(body) => { - let mut unused_elements = Vec::new(); let param_nested_response: Option = if !body.is_empty() { - let deserializer = &mut serde_json::Deserializer::from_slice(&*body); - match serde_ignored::deserialize(deserializer, |path| { warn!("Ignoring unknown field in body: {}", path); unused_elements.push(path.to_string()); @@ -204,7 +180,6 @@ where Ok(param_nested_response) => param_nested_response, Err(e) => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't parse body parameter nested_response - doesn't match schema: {}", e)))), } - } else { None }; @@ -212,8 +187,6 @@ where Some(param_nested_response) => param_nested_response, None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body("Missing required body parameter nested_response"))), }; - - Box::new(api_impl.dummy_put(param_nested_response, &context) .then(move |result| { let mut response = Response::new(); @@ -244,29 +217,17 @@ where future::ok(response) } )) - - }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter nested_response: {}", e)))), } }) ) as Box> - }, - // FileResponseGet - GET /file_response &hyper::Method::Get if path.matched(paths::ID_FILE_RESPONSE) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.file_response_get(&context) .then(move |result| { let mut response = Response::new(); @@ -301,22 +262,12 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // HtmlPost - POST /html &hyper::Method::Post if path.matched(paths::ID_HTML) => { - - - - - - // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -325,9 +276,7 @@ where match result { Ok(body) => { let param_body: Option = if !body.is_empty() { - Some(String::from_utf8(body.to_vec()).unwrap()) - } else { None }; @@ -335,8 +284,6 @@ where Some(param_body) => param_body, None => return Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body("Missing required body parameter body"))), }; - - Box::new(api_impl.html_post(param_body, &context) .then(move |result| { let mut response = Response::new(); @@ -371,29 +318,17 @@ where future::ok(response) } )) - - }, Err(e) => Box::new(future::ok(Response::new().with_status(StatusCode::BadRequest).with_body(format!("Couldn't read body parameter body: {}", e)))), } }) ) as Box> - }, - // RawJsonGet - GET /raw_json &hyper::Method::Get if path.matched(paths::ID_RAW_JSON) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.raw_json_get(&context) .then(move |result| { let mut response = Response::new(); @@ -428,14 +363,10 @@ where future::ok(response) } )) - }} }) as Box> - - }, - _ => Box::new(future::ok(Response::new().with_status(StatusCode::NotFound))) as Box>, } } @@ -451,6 +382,7 @@ impl Clone for Service } } + /// Request parser for `Api`. pub struct ApiRequestParser; impl RequestParser for ApiRequestParser { From 83f17941b9496f22e3985f070d6692986e5ff318 Mon Sep 17 00:00:00 2001 From: Richard Whitehouse Date: Sun, 4 Aug 2019 12:55:33 +0100 Subject: [PATCH 45/75] [Rust Server] Allow more than 32 configured paths (#3494) --- .../resources/rust-server/server-mod.mustache | 2 +- .../resources/3_0/rust-server/ops-v3.yaml | 192 ++ .../output/openapi-v3/src/server/mod.rs | 2 +- .../rust-server/output/ops-v3/.cargo/config | 18 + .../rust-server/output/ops-v3/.gitignore | 2 + .../output/ops-v3/.openapi-generator-ignore | 23 + .../output/ops-v3/.openapi-generator/VERSION | 1 + .../rust-server/output/ops-v3/Cargo.toml | 48 + .../rust-server/output/ops-v3/README.md | 198 ++ .../output/ops-v3/api/openapi.yaml | 195 ++ .../output/ops-v3/docs/default_api.md | 859 ++++++ .../rust-server/output/ops-v3/examples/ca.pem | 17 + .../output/ops-v3/examples/client.rs | 334 +++ .../output/ops-v3/examples/server-chain.pem | 66 + .../output/ops-v3/examples/server-key.pem | 28 + .../output/ops-v3/examples/server.rs | 75 + .../output/ops-v3/examples/server_lib/mod.rs | 37 + .../ops-v3/examples/server_lib/server.rs | 326 ++ .../output/ops-v3/src/client/mod.rs | 2648 +++++++++++++++++ .../rust-server/output/ops-v3/src/lib.rs | 712 +++++ .../output/ops-v3/src/mimetypes.rs | 13 + .../rust-server/output/ops-v3/src/models.rs | 12 + .../output/ops-v3/src/server/context.rs | 91 + .../output/ops-v3/src/server/mod.rs | 2068 +++++++++++++ .../src/server/mod.rs | 2 +- .../output/rust-server-test/src/server/mod.rs | 2 +- 26 files changed, 7967 insertions(+), 4 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/rust-server/ops-v3.yaml create mode 100644 samples/server/petstore/rust-server/output/ops-v3/.cargo/config create mode 100644 samples/server/petstore/rust-server/output/ops-v3/.gitignore create mode 100644 samples/server/petstore/rust-server/output/ops-v3/.openapi-generator-ignore create mode 100644 samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION create mode 100644 samples/server/petstore/rust-server/output/ops-v3/Cargo.toml create mode 100644 samples/server/petstore/rust-server/output/ops-v3/README.md create mode 100644 samples/server/petstore/rust-server/output/ops-v3/api/openapi.yaml create mode 100644 samples/server/petstore/rust-server/output/ops-v3/docs/default_api.md create mode 100644 samples/server/petstore/rust-server/output/ops-v3/examples/ca.pem create mode 100644 samples/server/petstore/rust-server/output/ops-v3/examples/client.rs create mode 100644 samples/server/petstore/rust-server/output/ops-v3/examples/server-chain.pem create mode 100644 samples/server/petstore/rust-server/output/ops-v3/examples/server-key.pem create mode 100644 samples/server/petstore/rust-server/output/ops-v3/examples/server.rs create mode 100644 samples/server/petstore/rust-server/output/ops-v3/examples/server_lib/mod.rs create mode 100644 samples/server/petstore/rust-server/output/ops-v3/examples/server_lib/server.rs create mode 100644 samples/server/petstore/rust-server/output/ops-v3/src/client/mod.rs create mode 100644 samples/server/petstore/rust-server/output/ops-v3/src/lib.rs create mode 100644 samples/server/petstore/rust-server/output/ops-v3/src/mimetypes.rs create mode 100644 samples/server/petstore/rust-server/output/ops-v3/src/models.rs create mode 100644 samples/server/petstore/rust-server/output/ops-v3/src/server/context.rs create mode 100644 samples/server/petstore/rust-server/output/ops-v3/src/server/mod.rs diff --git a/modules/openapi-generator/src/main/resources/rust-server/server-mod.mustache b/modules/openapi-generator/src/main/resources/rust-server/server-mod.mustache index 2c6ea131ba3..afe2744e04d 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/server-mod.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/server-mod.mustache @@ -63,7 +63,7 @@ mod paths { extern crate regex; lazy_static! { - pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(&[ + pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(vec![ {{#pathSet}} r"^{{{basePathWithoutHost}}}{{{pathRegEx}}}"{{^-last}},{{/-last}} {{/pathSet}} diff --git a/modules/openapi-generator/src/test/resources/3_0/rust-server/ops-v3.yaml b/modules/openapi-generator/src/test/resources/3_0/rust-server/ops-v3.yaml new file mode 100644 index 00000000000..bd2addb34e9 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/rust-server/ops-v3.yaml @@ -0,0 +1,192 @@ +# Test large number of configured operations + +openapi: 3.0.1 +info: + title: Regression test for large number of operations + version: 0.0.1 +paths: + /op1: + get: + responses: + '200': + description: 'OK' + /op2: + get: + responses: + '200': + description: 'OK' + /op3: + get: + responses: + '200': + description: 'OK' + /op4: + get: + responses: + '200': + description: 'OK' + /op5: + get: + responses: + '200': + description: 'OK' + /op6: + get: + responses: + '200': + description: 'OK' + /op7: + get: + responses: + '200': + description: 'OK' + /op8: + get: + responses: + '200': + description: 'OK' + /op9: + get: + responses: + '200': + description: 'OK' + /op10: + get: + responses: + '200': + description: 'OK' + /op11: + get: + responses: + '200': + description: 'OK' + /op12: + get: + responses: + '200': + description: 'OK' + /op13: + get: + responses: + '200': + description: 'OK' + /op14: + get: + responses: + '200': + description: 'OK' + /op15: + get: + responses: + '200': + description: 'OK' + /op16: + get: + responses: + '200': + description: 'OK' + /op17: + get: + responses: + '200': + description: 'OK' + /op18: + get: + responses: + '200': + description: 'OK' + /op19: + get: + responses: + '200': + description: 'OK' + /op20: + get: + responses: + '200': + description: 'OK' + /op21: + get: + responses: + '200': + description: 'OK' + /op22: + get: + responses: + '200': + description: 'OK' + /op23: + get: + responses: + '200': + description: 'OK' + /op24: + get: + responses: + '200': + description: 'OK' + /op25: + get: + responses: + '200': + description: 'OK' + /op26: + get: + responses: + '200': + description: 'OK' + /op27: + get: + responses: + '200': + description: 'OK' + /op28: + get: + responses: + '200': + description: 'OK' + /op29: + get: + responses: + '200': + description: 'OK' + /op30: + get: + responses: + '200': + description: 'OK' + /op31: + get: + responses: + '200': + description: 'OK' + /op32: + get: + responses: + '200': + description: 'OK' + /op33: + get: + responses: + '200': + description: 'OK' + /op34: + get: + responses: + '200': + description: 'OK' + /op35: + get: + responses: + '200': + description: 'OK' + /op36: + get: + responses: + '200': + description: 'OK' + /op37: + get: + responses: + '200': + description: 'OK' diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs index 66d4e219ac1..8a49d9bcaf2 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/server/mod.rs @@ -54,7 +54,7 @@ mod paths { extern crate regex; lazy_static! { - pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(&[ + pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(vec![ r"^/required_octet_stream$", r"^/uuid$", r"^/xml$", diff --git a/samples/server/petstore/rust-server/output/ops-v3/.cargo/config b/samples/server/petstore/rust-server/output/ops-v3/.cargo/config new file mode 100644 index 00000000000..b8acc9c00c8 --- /dev/null +++ b/samples/server/petstore/rust-server/output/ops-v3/.cargo/config @@ -0,0 +1,18 @@ +[build] +rustflags = [ + "-W", "missing_docs", # detects missing documentation for public members + + "-W", "trivial_casts", # detects trivial casts which could be removed + + "-W", "trivial_numeric_casts", # detects trivial casts of numeric types which could be removed + + "-W", "unsafe_code", # usage of `unsafe` code + + "-W", "unused_qualifications", # detects unnecessarily qualified names + + "-W", "unused_extern_crates", # extern crates that are never used + + "-W", "unused_import_braces", # unnecessary braces around an imported item + + "-D", "warnings", # all warnings should be denied +] diff --git a/samples/server/petstore/rust-server/output/ops-v3/.gitignore b/samples/server/petstore/rust-server/output/ops-v3/.gitignore new file mode 100644 index 00000000000..a9d37c560c6 --- /dev/null +++ b/samples/server/petstore/rust-server/output/ops-v3/.gitignore @@ -0,0 +1,2 @@ +target +Cargo.lock diff --git a/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator-ignore b/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION new file mode 100644 index 00000000000..83a328a9227 --- /dev/null +++ b/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/ops-v3/Cargo.toml b/samples/server/petstore/rust-server/output/ops-v3/Cargo.toml new file mode 100644 index 00000000000..a5bf71f3b96 --- /dev/null +++ b/samples/server/petstore/rust-server/output/ops-v3/Cargo.toml @@ -0,0 +1,48 @@ +[package] +name = "ops-v3" +version = "0.0.1" +authors = [] +description = "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)" +license = "Unlicense" + +[features] +default = ["client", "server"] +client = ["serde_json", "serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "url", "uuid"] +server = ["serde_json", "serde_ignored", "hyper", "hyper-tls", "native-tls", "openssl", "tokio-core", "tokio-proto", "tokio-tls", "regex", "percent-encoding", "url", "uuid"] + +[dependencies] +# Required by example server. +# +chrono = { version = "0.4", features = ["serde"] } +futures = "0.1" +hyper = {version = "0.11", optional = true} +hyper-tls = {version = "0.1.2", optional = true} +swagger = "2" + +# Not required by example server. +# +lazy_static = "0.2" +log = "0.3.0" +mime = "0.3.3" +multipart = {version = "0.13.3", optional = true} +native-tls = {version = "0.1.4", optional = true} +openssl = {version = "0.9.14", optional = true} +percent-encoding = {version = "1.0.0", optional = true} +regex = {version = "0.2", optional = true} +serde = "1.0" +serde_derive = "1.0" +serde_ignored = {version = "0.0.4", optional = true} +serde_json = {version = "1.0", optional = true} +serde_urlencoded = {version = "0.5.1", optional = true} +tokio-core = {version = "0.1.6", optional = true} +tokio-proto = {version = "0.1.1", optional = true} +tokio-tls = {version = "0.1.3", optional = true, features = ["tokio-proto"]} +url = {version = "1.5", optional = true} +uuid = {version = "0.5", optional = true, features = ["serde", "v4"]} +# ToDo: this should be updated to point at the official crate once +# https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream + + +[dev-dependencies] +clap = "2.25" +error-chain = "0.12" diff --git a/samples/server/petstore/rust-server/output/ops-v3/README.md b/samples/server/petstore/rust-server/output/ops-v3/README.md new file mode 100644 index 00000000000..68b5984c610 --- /dev/null +++ b/samples/server/petstore/rust-server/output/ops-v3/README.md @@ -0,0 +1,198 @@ +# Rust API for ops-v3 + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +## Overview +This client/server was generated by the [openapi-generator] +(https://openapi-generator.tech) project. +By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. +- + +To see how to make this your own, look here: + +[README]((https://openapi-generator.tech)) + +- API version: 0.0.1 + +This autogenerated project defines an API crate `ops-v3` which contains: +* An `Api` trait defining the API in Rust. +* Data types representing the underlying data model. +* A `Client` type which implements `Api` and issues HTTP requests for each operation. +* A router which accepts HTTP requests and invokes the appropriate `Api` method for each operation. + +It also contains an example server and client which make use of `ops-v3`: +* The example server starts up a web server using the `ops-v3` router, + and supplies a trivial implementation of `Api` which returns failure for every operation. +* The example client provides a CLI which lets you invoke any single operation on the + `ops-v3` client by passing appropriate arguments on the command line. + +You can use the example server and client as a basis for your own code. +See below for [more detail on implementing a server](#writing-a-server). + + +## Examples + +Run examples with: + +``` +cargo run --example +``` + +To pass in arguments to the examples, put them after `--`, for example: + +``` +cargo run --example client -- --help +``` + +### Running the server +To run the server, follow these simple steps: + +``` +cargo run --example server +``` + +### Running a client +To run a client, follow one of the following simple steps: + +``` +cargo run --example client Op10Get +cargo run --example client Op11Get +cargo run --example client Op12Get +cargo run --example client Op13Get +cargo run --example client Op14Get +cargo run --example client Op15Get +cargo run --example client Op16Get +cargo run --example client Op17Get +cargo run --example client Op18Get +cargo run --example client Op19Get +cargo run --example client Op1Get +cargo run --example client Op20Get +cargo run --example client Op21Get +cargo run --example client Op22Get +cargo run --example client Op23Get +cargo run --example client Op24Get +cargo run --example client Op25Get +cargo run --example client Op26Get +cargo run --example client Op27Get +cargo run --example client Op28Get +cargo run --example client Op29Get +cargo run --example client Op2Get +cargo run --example client Op30Get +cargo run --example client Op31Get +cargo run --example client Op32Get +cargo run --example client Op33Get +cargo run --example client Op34Get +cargo run --example client Op35Get +cargo run --example client Op36Get +cargo run --example client Op37Get +cargo run --example client Op3Get +cargo run --example client Op4Get +cargo run --example client Op5Get +cargo run --example client Op6Get +cargo run --example client Op7Get +cargo run --example client Op8Get +cargo run --example client Op9Get +``` + +### HTTPS +The examples can be run in HTTPS mode by passing in the flag `--https`, for example: + +``` +cargo run --example server -- --https +``` + +This will use the keys/certificates from the examples directory. Note that the server chain is signed with +`CN=localhost`. + + +## Writing a server + +The server example is designed to form the basis for implementing your own server. Simply follow these steps. + +* Set up a new Rust project, e.g., with `cargo init --bin`. +* Insert `ops-v3` into the `members` array under [workspace] in the root `Cargo.toml`, e.g., `members = [ "ops-v3" ]`. +* Add `ops-v3 = {version = "0.0.1", path = "ops-v3"}` under `[dependencies]` in the root `Cargo.toml`. +* Copy the `[dependencies]` and `[dev-dependencies]` from `ops-v3/Cargo.toml` into the root `Cargo.toml`'s `[dependencies]` section. + * Copy all of the `[dev-dependencies]`, but only the `[dependencies]` that are required by the example server. These should be clearly indicated by comments. + * Remove `"optional = true"` from each of these lines if present. + +Each autogenerated API will contain an implementation stub and main entry point, which should be copied into your project the first time: +``` +cp ops-v3/examples/server.rs src/main.rs +cp ops-v3/examples/server_lib/mod.rs src/lib.rs +cp ops-v3/examples/server_lib/server.rs src/server.rs +``` + +Now + +* From `src/main.rs`, remove the `mod server_lib;` line, and uncomment and fill in the `extern crate` line with the name of this server crate. +* Move the block of imports "required by the service library" from `src/main.rs` to `src/lib.rs` and uncomment. +* Change the `let server = server::Server {};` line to `let server = SERVICE_NAME::server().unwrap();` where `SERVICE_NAME` is the name of the server crate. +* Run `cargo build` to check it builds. +* Run `cargo fmt` to reformat the code. +* Commit the result before making any further changes (lest format changes get confused with your own updates). + +Now replace the implementations in `src/server.rs` with your own code as required. + +## Updating your server to track API changes + +Later, if the API changes, you can copy new sections from the autogenerated API stub into your implementation. +Alternatively, implement the now-missing methods based on the compiler's error messages. + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[****](docs/default_api.md#) | **GET** /op10 | +[****](docs/default_api.md#) | **GET** /op11 | +[****](docs/default_api.md#) | **GET** /op12 | +[****](docs/default_api.md#) | **GET** /op13 | +[****](docs/default_api.md#) | **GET** /op14 | +[****](docs/default_api.md#) | **GET** /op15 | +[****](docs/default_api.md#) | **GET** /op16 | +[****](docs/default_api.md#) | **GET** /op17 | +[****](docs/default_api.md#) | **GET** /op18 | +[****](docs/default_api.md#) | **GET** /op19 | +[****](docs/default_api.md#) | **GET** /op1 | +[****](docs/default_api.md#) | **GET** /op20 | +[****](docs/default_api.md#) | **GET** /op21 | +[****](docs/default_api.md#) | **GET** /op22 | +[****](docs/default_api.md#) | **GET** /op23 | +[****](docs/default_api.md#) | **GET** /op24 | +[****](docs/default_api.md#) | **GET** /op25 | +[****](docs/default_api.md#) | **GET** /op26 | +[****](docs/default_api.md#) | **GET** /op27 | +[****](docs/default_api.md#) | **GET** /op28 | +[****](docs/default_api.md#) | **GET** /op29 | +[****](docs/default_api.md#) | **GET** /op2 | +[****](docs/default_api.md#) | **GET** /op30 | +[****](docs/default_api.md#) | **GET** /op31 | +[****](docs/default_api.md#) | **GET** /op32 | +[****](docs/default_api.md#) | **GET** /op33 | +[****](docs/default_api.md#) | **GET** /op34 | +[****](docs/default_api.md#) | **GET** /op35 | +[****](docs/default_api.md#) | **GET** /op36 | +[****](docs/default_api.md#) | **GET** /op37 | +[****](docs/default_api.md#) | **GET** /op3 | +[****](docs/default_api.md#) | **GET** /op4 | +[****](docs/default_api.md#) | **GET** /op5 | +[****](docs/default_api.md#) | **GET** /op6 | +[****](docs/default_api.md#) | **GET** /op7 | +[****](docs/default_api.md#) | **GET** /op8 | +[****](docs/default_api.md#) | **GET** /op9 | + + +## Documentation For Models + + + +## Documentation For Authorization + Endpoints do not require authorization. + + +## Author + + + diff --git a/samples/server/petstore/rust-server/output/ops-v3/api/openapi.yaml b/samples/server/petstore/rust-server/output/ops-v3/api/openapi.yaml new file mode 100644 index 00000000000..05f79c3e865 --- /dev/null +++ b/samples/server/petstore/rust-server/output/ops-v3/api/openapi.yaml @@ -0,0 +1,195 @@ +openapi: 3.0.1 +info: + title: Regression test for large number of operations + version: 0.0.1 +servers: +- url: / +paths: + /op1: + get: + responses: + 200: + description: OK + /op2: + get: + responses: + 200: + description: OK + /op3: + get: + responses: + 200: + description: OK + /op4: + get: + responses: + 200: + description: OK + /op5: + get: + responses: + 200: + description: OK + /op6: + get: + responses: + 200: + description: OK + /op7: + get: + responses: + 200: + description: OK + /op8: + get: + responses: + 200: + description: OK + /op9: + get: + responses: + 200: + description: OK + /op10: + get: + responses: + 200: + description: OK + /op11: + get: + responses: + 200: + description: OK + /op12: + get: + responses: + 200: + description: OK + /op13: + get: + responses: + 200: + description: OK + /op14: + get: + responses: + 200: + description: OK + /op15: + get: + responses: + 200: + description: OK + /op16: + get: + responses: + 200: + description: OK + /op17: + get: + responses: + 200: + description: OK + /op18: + get: + responses: + 200: + description: OK + /op19: + get: + responses: + 200: + description: OK + /op20: + get: + responses: + 200: + description: OK + /op21: + get: + responses: + 200: + description: OK + /op22: + get: + responses: + 200: + description: OK + /op23: + get: + responses: + 200: + description: OK + /op24: + get: + responses: + 200: + description: OK + /op25: + get: + responses: + 200: + description: OK + /op26: + get: + responses: + 200: + description: OK + /op27: + get: + responses: + 200: + description: OK + /op28: + get: + responses: + 200: + description: OK + /op29: + get: + responses: + 200: + description: OK + /op30: + get: + responses: + 200: + description: OK + /op31: + get: + responses: + 200: + description: OK + /op32: + get: + responses: + 200: + description: OK + /op33: + get: + responses: + 200: + description: OK + /op34: + get: + responses: + 200: + description: OK + /op35: + get: + responses: + 200: + description: OK + /op36: + get: + responses: + 200: + description: OK + /op37: + get: + responses: + 200: + description: OK +components: + schemas: {} + diff --git a/samples/server/petstore/rust-server/output/ops-v3/docs/default_api.md b/samples/server/petstore/rust-server/output/ops-v3/docs/default_api.md new file mode 100644 index 00000000000..c76b59cefd3 --- /dev/null +++ b/samples/server/petstore/rust-server/output/ops-v3/docs/default_api.md @@ -0,0 +1,859 @@ +# default_api + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +****](default_api.md#) | **GET** /op10 | +****](default_api.md#) | **GET** /op11 | +****](default_api.md#) | **GET** /op12 | +****](default_api.md#) | **GET** /op13 | +****](default_api.md#) | **GET** /op14 | +****](default_api.md#) | **GET** /op15 | +****](default_api.md#) | **GET** /op16 | +****](default_api.md#) | **GET** /op17 | +****](default_api.md#) | **GET** /op18 | +****](default_api.md#) | **GET** /op19 | +****](default_api.md#) | **GET** /op1 | +****](default_api.md#) | **GET** /op20 | +****](default_api.md#) | **GET** /op21 | +****](default_api.md#) | **GET** /op22 | +****](default_api.md#) | **GET** /op23 | +****](default_api.md#) | **GET** /op24 | +****](default_api.md#) | **GET** /op25 | +****](default_api.md#) | **GET** /op26 | +****](default_api.md#) | **GET** /op27 | +****](default_api.md#) | **GET** /op28 | +****](default_api.md#) | **GET** /op29 | +****](default_api.md#) | **GET** /op2 | +****](default_api.md#) | **GET** /op30 | +****](default_api.md#) | **GET** /op31 | +****](default_api.md#) | **GET** /op32 | +****](default_api.md#) | **GET** /op33 | +****](default_api.md#) | **GET** /op34 | +****](default_api.md#) | **GET** /op35 | +****](default_api.md#) | **GET** /op36 | +****](default_api.md#) | **GET** /op37 | +****](default_api.md#) | **GET** /op3 | +****](default_api.md#) | **GET** /op4 | +****](default_api.md#) | **GET** /op5 | +****](default_api.md#) | **GET** /op6 | +****](default_api.md#) | **GET** /op7 | +****](default_api.md#) | **GET** /op8 | +****](default_api.md#) | **GET** /op9 | + + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **** +> () + + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/server/petstore/rust-server/output/ops-v3/examples/ca.pem b/samples/server/petstore/rust-server/output/ops-v3/examples/ca.pem new file mode 100644 index 00000000000..d2317fb5db7 --- /dev/null +++ b/samples/server/petstore/rust-server/output/ops-v3/examples/ca.pem @@ -0,0 +1,17 @@ +-----BEGIN CERTIFICATE----- +MIICtjCCAZ4CCQDpKecRERZ0xDANBgkqhkiG9w0BAQsFADAdMQswCQYDVQQGEwJV +UzEOMAwGA1UEAxMFTXkgQ0EwHhcNMTcwNTIzMTYwMDIzWhcNMTcwNjIyMTYwMDIz +WjAdMQswCQYDVQQGEwJVUzEOMAwGA1UEAxMFTXkgQ0EwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQCt66py3x7sCSASRF2D05L5wkNDxAUjQKYx23W8Gbwv +GMGykk89BIdU5LX1JB1cKiUOkoIxfwAYuWc2V/wzTvVV7+11besnk3uX1c9KiqUF +LIX7kn/z5hzS4aelhKvH+MJlSZCSlp1ytpZbwo5GB5Pi2SGH56jDBiBoDRNBVdWL +z4wH7TdrQjqWwNxIZumD5OGMtcfJyuX08iPiEOaslOeoMqzObhvjc9aUgjVjhqyA +FkJGTXsi0oaD7oml+NE+mTNfEeZvEJQpLSjBY0OvQHzuHkyGBShBnfu/9x7/NRwd +WaqsLiF7/re9KDGYdJwP7Cu6uxYfKAyWarp6h2mG/GIdAgMBAAEwDQYJKoZIhvcN +AQELBQADggEBAGIl/VVIafeq/AJOQ9r7TzzB2ABJYr7NZa6bTu5O1jSp1Fonac15 +SZ8gvRxODgH22ZYSqghPG4xzq4J3hkytlQqm57ZEt2I2M3OqIp17Ndcc1xDYzpLl +tA0FrVn6crQTM8vQkTDtGesaCWX+7Fir5dK7HnYWzfpSmsOpST07PfbNisEXKOxG +Dj4lBL1OnhTjsJeymVS1pFvkKkrcEJO+IxFiHL3CDsWjcXB0Z+E1zBtPoYyYsNsO +rBrjUxcZewF4xqWZhpW90Mt61fY2nRgU0uUwHcvDQUqvmzKcsqYa4mPKzfBI5mxo +01Ta96cDD6pS5Y1hOflZ0g84f2g/7xBLLDA= +-----END CERTIFICATE----- diff --git a/samples/server/petstore/rust-server/output/ops-v3/examples/client.rs b/samples/server/petstore/rust-server/output/ops-v3/examples/client.rs new file mode 100644 index 00000000000..1f440afafba --- /dev/null +++ b/samples/server/petstore/rust-server/output/ops-v3/examples/client.rs @@ -0,0 +1,334 @@ +#![allow(missing_docs, unused_variables, trivial_casts)] + +extern crate ops_v3; +#[allow(unused_extern_crates)] +extern crate futures; +#[allow(unused_extern_crates)] +#[macro_use] +extern crate swagger; +#[allow(unused_extern_crates)] +extern crate uuid; +extern crate clap; +extern crate tokio_core; + +use swagger::{ContextBuilder, EmptyContext, XSpanIdString, Has, Push, AuthData}; + +#[allow(unused_imports)] +use futures::{Future, future, Stream, stream}; +use tokio_core::reactor; +#[allow(unused_imports)] +use ops_v3::{ApiNoContext, ContextWrapperExt, + ApiError, + Op10GetResponse, + Op11GetResponse, + Op12GetResponse, + Op13GetResponse, + Op14GetResponse, + Op15GetResponse, + Op16GetResponse, + Op17GetResponse, + Op18GetResponse, + Op19GetResponse, + Op1GetResponse, + Op20GetResponse, + Op21GetResponse, + Op22GetResponse, + Op23GetResponse, + Op24GetResponse, + Op25GetResponse, + Op26GetResponse, + Op27GetResponse, + Op28GetResponse, + Op29GetResponse, + Op2GetResponse, + Op30GetResponse, + Op31GetResponse, + Op32GetResponse, + Op33GetResponse, + Op34GetResponse, + Op35GetResponse, + Op36GetResponse, + Op37GetResponse, + Op3GetResponse, + Op4GetResponse, + Op5GetResponse, + Op6GetResponse, + Op7GetResponse, + Op8GetResponse, + Op9GetResponse + }; +use clap::{App, Arg}; + +fn main() { + let matches = App::new("client") + .arg(Arg::with_name("operation") + .help("Sets the operation to run") + .possible_values(&[ + "Op10Get", + "Op11Get", + "Op12Get", + "Op13Get", + "Op14Get", + "Op15Get", + "Op16Get", + "Op17Get", + "Op18Get", + "Op19Get", + "Op1Get", + "Op20Get", + "Op21Get", + "Op22Get", + "Op23Get", + "Op24Get", + "Op25Get", + "Op26Get", + "Op27Get", + "Op28Get", + "Op29Get", + "Op2Get", + "Op30Get", + "Op31Get", + "Op32Get", + "Op33Get", + "Op34Get", + "Op35Get", + "Op36Get", + "Op37Get", + "Op3Get", + "Op4Get", + "Op5Get", + "Op6Get", + "Op7Get", + "Op8Get", + "Op9Get", +]) + .required(true) + .index(1)) + .arg(Arg::with_name("https") + .long("https") + .help("Whether to use HTTPS or not")) + .arg(Arg::with_name("host") + .long("host") + .takes_value(true) + .default_value("localhost") + .help("Hostname to contact")) + .arg(Arg::with_name("port") + .long("port") + .takes_value(true) + .default_value("80") + .help("Port to contact")) + .get_matches(); + + let mut core = reactor::Core::new().unwrap(); + let is_https = matches.is_present("https"); + let base_url = format!("{}://{}:{}", + if is_https { "https" } else { "http" }, + matches.value_of("host").unwrap(), + matches.value_of("port").unwrap()); + let client = if matches.is_present("https") { + // Using Simple HTTPS + ops_v3::Client::try_new_https(core.handle(), &base_url, "examples/ca.pem") + .expect("Failed to create HTTPS client") + } else { + // Using HTTP + ops_v3::Client::try_new_http(core.handle(), &base_url) + .expect("Failed to create HTTP client") + }; + + let context: make_context_ty!(ContextBuilder, EmptyContext, Option, XSpanIdString) = + make_context!(ContextBuilder, EmptyContext, None as Option, XSpanIdString(self::uuid::Uuid::new_v4().to_string())); + let client = client.with_context(context); + + match matches.value_of("operation") { + + Some("Op10Get") => { + let result = core.run(client.op10_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op11Get") => { + let result = core.run(client.op11_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op12Get") => { + let result = core.run(client.op12_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op13Get") => { + let result = core.run(client.op13_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op14Get") => { + let result = core.run(client.op14_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op15Get") => { + let result = core.run(client.op15_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op16Get") => { + let result = core.run(client.op16_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op17Get") => { + let result = core.run(client.op17_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op18Get") => { + let result = core.run(client.op18_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op19Get") => { + let result = core.run(client.op19_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op1Get") => { + let result = core.run(client.op1_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op20Get") => { + let result = core.run(client.op20_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op21Get") => { + let result = core.run(client.op21_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op22Get") => { + let result = core.run(client.op22_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op23Get") => { + let result = core.run(client.op23_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op24Get") => { + let result = core.run(client.op24_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op25Get") => { + let result = core.run(client.op25_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op26Get") => { + let result = core.run(client.op26_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op27Get") => { + let result = core.run(client.op27_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op28Get") => { + let result = core.run(client.op28_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op29Get") => { + let result = core.run(client.op29_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op2Get") => { + let result = core.run(client.op2_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op30Get") => { + let result = core.run(client.op30_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op31Get") => { + let result = core.run(client.op31_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op32Get") => { + let result = core.run(client.op32_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op33Get") => { + let result = core.run(client.op33_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op34Get") => { + let result = core.run(client.op34_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op35Get") => { + let result = core.run(client.op35_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op36Get") => { + let result = core.run(client.op36_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op37Get") => { + let result = core.run(client.op37_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op3Get") => { + let result = core.run(client.op3_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op4Get") => { + let result = core.run(client.op4_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op5Get") => { + let result = core.run(client.op5_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op6Get") => { + let result = core.run(client.op6_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op7Get") => { + let result = core.run(client.op7_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op8Get") => { + let result = core.run(client.op8_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + Some("Op9Get") => { + let result = core.run(client.op9_get()); + println!("{:?} (X-Span-ID: {:?})", result, (client.context() as &Has).get().clone()); + }, + + _ => { + panic!("Invalid operation provided") + } + } +} + diff --git a/samples/server/petstore/rust-server/output/ops-v3/examples/server-chain.pem b/samples/server/petstore/rust-server/output/ops-v3/examples/server-chain.pem new file mode 100644 index 00000000000..47d7e201404 --- /dev/null +++ b/samples/server/petstore/rust-server/output/ops-v3/examples/server-chain.pem @@ -0,0 +1,66 @@ +Certificate: + Data: + Version: 1 (0x0) + Serial Number: 4096 (0x1000) + Signature Algorithm: sha256WithRSAEncryption + Issuer: C=US, CN=My CA + Validity + Not Before: May 23 16:00:23 2017 GMT + Not After : Apr 29 16:00:23 2117 GMT + Subject: CN=localhost, C=US + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (2048 bit) + Modulus: + 00:c9:d4:43:60:50:fc:d6:0f:38:4d:5d:5e:aa:7c: + c0:5e:a9:ec:d9:93:78:d3:93:72:28:41:f5:08:a5: + ea:ac:67:07:d7:1f:f7:7d:74:69:7e:46:89:20:4b: + 7a:2d:9b:02:08:e7:6f:0f:1d:0c:0f:c7:60:69:19: + 4b:df:7e:ca:75:94:0b:49:71:e3:6d:f2:e8:79:fd: + ed:0a:94:67:55:f3:ca:6b:61:ba:58:b7:2e:dd:7b: + ca:b9:02:9f:24:36:ac:26:8f:04:8f:81:c8:35:10: + f4:aa:33:b2:24:16:f8:f7:1e:ea:f7:16:fe:fa:34: + c3:dd:bb:2c:ba:7a:df:4d:e2:da:1e:e5:d2:28:44: + 6e:c8:96:e0:fd:09:0c:14:0c:31:dc:e0:ca:c1:a7: + 9b:bf:16:8c:f7:36:3f:1b:2e:dd:90:eb:45:78:51: + bf:59:22:1e:c6:8c:0a:69:88:e5:03:5e:73:b7:fc: + 93:7f:1b:46:1b:97:68:c5:c0:8b:35:1f:bb:1e:67: + 7f:55:b7:3b:55:3f:ea:f2:ca:db:cc:52:cd:16:89: + db:15:47:bd:f2:cd:6c:7a:d7:b4:1a:ac:c8:15:6c: + 6a:fb:77:c4:e9:f2:30:e0:14:24:66:65:6f:2a:e5: + 2d:cc:f6:81:ae:57:c8:d1:9b:38:90:dc:60:93:02: + 5e:cb + Exponent: 65537 (0x10001) + Signature Algorithm: sha256WithRSAEncryption + 1c:7c:39:e8:3d:49:b2:09:1e:68:5a:2f:74:18:f4:63:b5:8c: + f6:e6:a1:e3:4d:95:90:99:ef:32:5c:34:40:e8:55:13:0e:e0: + 1c:be:cd:ab:3f:64:38:99:5e:2b:c1:81:53:a0:18:a8:f6:ee: + 6a:33:73:6c:9a:73:9d:86:08:5d:c7:11:38:46:4c:cd:a0:47: + 37:8f:fe:a6:50:a9:02:21:99:42:86:5e:47:fe:65:56:60:1d: + 16:53:86:bd:e4:63:c5:69:cf:fa:30:51:ab:a1:c3:50:53:cc: + 66:1c:4c:ff:3f:2a:39:4d:a2:8f:9d:d1:a7:8b:22:e4:78:69: + 24:06:83:4d:cc:0a:c0:87:69:9b:bc:80:a9:d2:b7:a5:23:84: + 7e:a2:32:26:7c:78:0e:bd:db:cd:3b:69:18:33:b8:44:ef:96: + b4:99:86:ee:06:bd:51:1c:c7:a1:a4:0c:c4:4c:51:a0:df:ac: + 14:07:88:8e:d7:39:45:fe:52:e0:a3:4c:db:5d:7a:ab:4d:e4: + ca:06:e8:bd:74:6f:46:e7:93:4a:4f:1b:67:e7:a5:9f:ef:9c: + 02:49:d1:f2:d5:e9:53:ee:09:21:ac:08:c8:15:f7:af:35:b9: + 4f:11:0f:43:ae:46:8e:fd:5b:8d:a3:4e:a7:2c:b7:25:ed:e4: + e5:94:1d:e3 +-----BEGIN CERTIFICATE----- +MIICtTCCAZ0CAhAAMA0GCSqGSIb3DQEBCwUAMB0xCzAJBgNVBAYTAlVTMQ4wDAYD +VQQDEwVNeSBDQTAgFw0xNzA1MjMxNjAwMjNaGA8yMTE3MDQyOTE2MDAyM1owITES +MBAGA1UEAxMJbG9jYWxob3N0MQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEB +BQADggEPADCCAQoCggEBAMnUQ2BQ/NYPOE1dXqp8wF6p7NmTeNOTcihB9Qil6qxn +B9cf9310aX5GiSBLei2bAgjnbw8dDA/HYGkZS99+ynWUC0lx423y6Hn97QqUZ1Xz +ymthuli3Lt17yrkCnyQ2rCaPBI+ByDUQ9KozsiQW+Pce6vcW/vo0w927LLp6303i +2h7l0ihEbsiW4P0JDBQMMdzgysGnm78WjPc2Pxsu3ZDrRXhRv1kiHsaMCmmI5QNe +c7f8k38bRhuXaMXAizUfux5nf1W3O1U/6vLK28xSzRaJ2xVHvfLNbHrXtBqsyBVs +avt3xOnyMOAUJGZlbyrlLcz2ga5XyNGbOJDcYJMCXssCAwEAATANBgkqhkiG9w0B +AQsFAAOCAQEAHHw56D1JsgkeaFovdBj0Y7WM9uah402VkJnvMlw0QOhVEw7gHL7N +qz9kOJleK8GBU6AYqPbuajNzbJpznYYIXccROEZMzaBHN4/+plCpAiGZQoZeR/5l +VmAdFlOGveRjxWnP+jBRq6HDUFPMZhxM/z8qOU2ij53Rp4si5HhpJAaDTcwKwIdp +m7yAqdK3pSOEfqIyJnx4Dr3bzTtpGDO4RO+WtJmG7ga9URzHoaQMxExRoN+sFAeI +jtc5Rf5S4KNM2116q03kygbovXRvRueTSk8bZ+eln++cAknR8tXpU+4JIawIyBX3 +rzW5TxEPQ65Gjv1bjaNOpyy3Je3k5ZQd4w== +-----END CERTIFICATE----- diff --git a/samples/server/petstore/rust-server/output/ops-v3/examples/server-key.pem b/samples/server/petstore/rust-server/output/ops-v3/examples/server-key.pem new file mode 100644 index 00000000000..29c00682922 --- /dev/null +++ b/samples/server/petstore/rust-server/output/ops-v3/examples/server-key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDJ1ENgUPzWDzhN +XV6qfMBeqezZk3jTk3IoQfUIpeqsZwfXH/d9dGl+RokgS3otmwII528PHQwPx2Bp +GUvffsp1lAtJceNt8uh5/e0KlGdV88prYbpYty7de8q5Ap8kNqwmjwSPgcg1EPSq +M7IkFvj3Hur3Fv76NMPduyy6et9N4toe5dIoRG7IluD9CQwUDDHc4MrBp5u/Foz3 +Nj8bLt2Q60V4Ub9ZIh7GjAppiOUDXnO3/JN/G0Ybl2jFwIs1H7seZ39VtztVP+ry +ytvMUs0WidsVR73yzWx617QarMgVbGr7d8Tp8jDgFCRmZW8q5S3M9oGuV8jRmziQ +3GCTAl7LAgMBAAECggEBAKEd1q9j14KWYc64s6KLthGbutyxsinMMbxbct11fdIk +6YhdF3fJ35ETg9IJDr6rWEN9ZRX+jStncNpVfFEs6ThVd3Eo/nI+EEGaaIkikR93 +X2a7fEPn7/yVHu70XdBN6L1bPDvHUeiy4W2hmRrgT90OjGm1rNRWHOm7yugOwIZu +HclzbR9Ca7EInFnotUiDQm9sw9VKHbJHqWx6OORdZrxR2ytYs0Qkq0XpGMvti2HW +7WAmKTg5QM8myXW7+/4iqb/u68wVBR2BBalShKmIf7lim9O3W2a1RjDdsvm/wNe9 +I+D+Iq825vpqkKXcrxYlpVg7hYiaQaW/MNsEb7lQRjECgYEA/RJYby0POW+/k0Jn +jO8UmJVEMiuGa8WIUu/JJWMOmzRCukjSRNQOkt7niQrZPJYE8W6clM6RJTolWf9L +IL6mIb+mRaoudUk8SHGDq7ho1iMg9GK8lhYxvKh1Q6uv8EyVSkgLknAEY0NANKC1 +zNdU5Dhven9aRX2gq9vP4XwMz2MCgYEAzCogQ7IFk+gkp3k491dOZnrGRoRCfuzo +4CJtyKFgOSd7BjmpcKkj0IPfVBjw6GjMIxfQRMTQmxAjjWevH45vG8l0Iiwz/gSp +81b5nsDEX5uv2Olcmcz5zxRFy36jOZ9ihMWinxcIlT2oDbyCdbruDKZq9ieJ9S8g +4qGx0OkwE3kCgYEA7CmAiU89U9YqqttfEq/RQoqY91CSwmO10d+ej9seuEtOsdRf +FIfnibulycdr7hP5TOxyBpO1802NqayJiWcgVYIpQf2MGTtcnCYCP+95NcvWZvj1 +EAJqK6nwtFO1fcOZ1ZXh5qfOEGujsPkAbsXLnKXlsiTCMvMHSxl3pu5Cbg0CgYBf +JjbZNctRrjv+7Qj2hPLd4dQsIxGWc7ToWENP4J2mpVa5hQAJqFovoHXhjKohtk2F +AWEn243Y5oGbMjo0e74edhmwn2cvuF64MM2vBem/ISCn98IXT6cQskMA3qkVfsl8 +VVs/x41ReGWs2TD3y0GMFbb9t1mdMfSiincDhNnKCQKBgGfeT4jKyYeCoCw4OLI1 +G75Gd0METt/IkppwODPpNwj3Rp9I5jctWZFA/3wCX/zk0HgBeou5AFNS4nQZ/X/L +L9axbSdR7UJTGkT1r4gu3rLkPV4Tk+8XM03/JT2cofMlzQBuhvl1Pn4SgKowz7hl +lS76ECw4Av3T0S34VW9Z5oye +-----END PRIVATE KEY----- diff --git a/samples/server/petstore/rust-server/output/ops-v3/examples/server.rs b/samples/server/petstore/rust-server/output/ops-v3/examples/server.rs new file mode 100644 index 00000000000..d17f981ccf0 --- /dev/null +++ b/samples/server/petstore/rust-server/output/ops-v3/examples/server.rs @@ -0,0 +1,75 @@ +//! Main binary entry point for ops_v3 implementation. + +#![allow(missing_docs)] + +// Imports required by this file. +// extern crate ; +extern crate ops_v3; +extern crate swagger; +extern crate hyper; +extern crate openssl; +extern crate native_tls; +extern crate tokio_proto; +extern crate tokio_tls; +extern crate clap; + +// Imports required by server library. +// extern crate ops_v3; +// extern crate swagger; +extern crate futures; +extern crate chrono; +#[macro_use] +extern crate error_chain; + + +use openssl::x509::X509_FILETYPE_PEM; +use openssl::ssl::{SslAcceptorBuilder, SslMethod}; +use openssl::error::ErrorStack; +use hyper::server::Http; +use tokio_proto::TcpServer; +use clap::{App, Arg}; +use swagger::auth::AllowAllAuthenticator; +use swagger::EmptyContext; + +mod server_lib; + +// Builds an SSL implementation for Simple HTTPS from some hard-coded file names +fn ssl() -> Result { + let mut ssl = SslAcceptorBuilder::mozilla_intermediate_raw(SslMethod::tls())?; + + // Server authentication + ssl.set_private_key_file("examples/server-key.pem", X509_FILETYPE_PEM)?; + ssl.set_certificate_chain_file("examples/server-chain.pem")?; + ssl.check_private_key()?; + + Ok(ssl) +} + +/// Create custom server, wire it to the autogenerated router, +/// and pass it to the web server. +fn main() { + let matches = App::new("server") + .arg(Arg::with_name("https") + .long("https") + .help("Whether to use HTTPS or not")) + .get_matches(); + + let service_fn = + ops_v3::server::context::NewAddContext::<_, EmptyContext>::new( + AllowAllAuthenticator::new( + server_lib::NewService::new(), + "cosmo" + ) + ); + + let addr = "127.0.0.1:80".parse().expect("Failed to parse bind address"); + if matches.is_present("https") { + let ssl = ssl().expect("Failed to load SSL keys"); + let builder: native_tls::TlsAcceptorBuilder = native_tls::backend::openssl::TlsAcceptorBuilderExt::from_openssl(ssl); + let tls_acceptor = builder.build().expect("Failed to build TLS acceptor"); + TcpServer::new(tokio_tls::proto::Server::new(Http::new(), tls_acceptor), addr).serve(service_fn); + } else { + // Using HTTP + TcpServer::new(Http::new(), addr).serve(service_fn); + } +} diff --git a/samples/server/petstore/rust-server/output/ops-v3/examples/server_lib/mod.rs b/samples/server/petstore/rust-server/output/ops-v3/examples/server_lib/mod.rs new file mode 100644 index 00000000000..b2313e94b56 --- /dev/null +++ b/samples/server/petstore/rust-server/output/ops-v3/examples/server_lib/mod.rs @@ -0,0 +1,37 @@ +//! Main library entry point for ops_v3 implementation. + +mod server; + +mod errors { + error_chain!{} +} + +pub use self::errors::*; +use std::io; +use std::clone::Clone; +use std::marker::PhantomData; +use hyper; +use ops_v3; +use swagger::{Has, XSpanIdString}; + +pub struct NewService{ + marker: PhantomData +} + +impl NewService{ + pub fn new() -> Self { + NewService{marker:PhantomData} + } +} + +impl hyper::server::NewService for NewService where C: Has + Clone + 'static { + type Request = (hyper::Request, C); + type Response = hyper::Response; + type Error = hyper::Error; + type Instance = ops_v3::server::Service, C>; + + /// Instantiate a new server. + fn new_service(&self) -> io::Result { + Ok(ops_v3::server::Service::new(server::Server::new())) + } +} diff --git a/samples/server/petstore/rust-server/output/ops-v3/examples/server_lib/server.rs b/samples/server/petstore/rust-server/output/ops-v3/examples/server_lib/server.rs new file mode 100644 index 00000000000..b4bae26a2ce --- /dev/null +++ b/samples/server/petstore/rust-server/output/ops-v3/examples/server_lib/server.rs @@ -0,0 +1,326 @@ +//! Server implementation of ops_v3. + +#![allow(unused_imports)] + +use futures::{self, Future}; +use chrono; +use std::collections::HashMap; +use std::marker::PhantomData; + +use swagger; +use swagger::{Has, XSpanIdString}; + +use ops_v3::{Api, ApiError, + Op10GetResponse, + Op11GetResponse, + Op12GetResponse, + Op13GetResponse, + Op14GetResponse, + Op15GetResponse, + Op16GetResponse, + Op17GetResponse, + Op18GetResponse, + Op19GetResponse, + Op1GetResponse, + Op20GetResponse, + Op21GetResponse, + Op22GetResponse, + Op23GetResponse, + Op24GetResponse, + Op25GetResponse, + Op26GetResponse, + Op27GetResponse, + Op28GetResponse, + Op29GetResponse, + Op2GetResponse, + Op30GetResponse, + Op31GetResponse, + Op32GetResponse, + Op33GetResponse, + Op34GetResponse, + Op35GetResponse, + Op36GetResponse, + Op37GetResponse, + Op3GetResponse, + Op4GetResponse, + Op5GetResponse, + Op6GetResponse, + Op7GetResponse, + Op8GetResponse, + Op9GetResponse +}; +use ops_v3::models; + +#[derive(Copy, Clone)] +pub struct Server { + marker: PhantomData, +} + +impl Server { + pub fn new() -> Self { + Server{marker: PhantomData} + } +} + +impl Api for Server where C: Has{ + + + fn op10_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op10_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op11_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op11_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op12_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op12_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op13_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op13_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op14_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op14_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op15_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op15_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op16_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op16_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op17_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op17_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op18_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op18_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op19_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op19_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op1_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op1_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op20_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op20_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op21_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op21_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op22_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op22_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op23_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op23_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op24_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op24_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op25_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op25_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op26_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op26_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op27_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op27_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op28_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op28_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op29_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op29_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op2_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op2_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op30_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op30_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op31_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op31_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op32_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op32_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op33_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op33_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op34_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op34_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op35_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op35_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op36_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op36_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op37_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op37_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op3_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op3_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op4_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op4_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op5_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op5_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op6_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op6_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op7_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op7_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op8_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op8_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + + + fn op9_get(&self, context: &C) -> Box> { + let context = context.clone(); + println!("op9_get() - X-Span-ID: {:?}", context.get().0.clone()); + Box::new(futures::failed("Generic failure".into())) + } + +} diff --git a/samples/server/petstore/rust-server/output/ops-v3/src/client/mod.rs b/samples/server/petstore/rust-server/output/ops-v3/src/client/mod.rs new file mode 100644 index 00000000000..bf95e17b0ce --- /dev/null +++ b/samples/server/petstore/rust-server/output/ops-v3/src/client/mod.rs @@ -0,0 +1,2648 @@ +#![allow(unused_extern_crates)] +extern crate tokio_core; +extern crate native_tls; +extern crate hyper_tls; +extern crate openssl; +extern crate mime; +extern crate chrono; +extern crate url; + + + +use hyper; +use hyper::header::{Headers, ContentType}; +use hyper::Uri; +use self::url::percent_encoding::{utf8_percent_encode, PATH_SEGMENT_ENCODE_SET, QUERY_ENCODE_SET}; +use futures; +use futures::{Future, Stream}; +use futures::{future, stream}; +use self::tokio_core::reactor::Handle; +use std::borrow::Cow; +use std::io::{Read, Error, ErrorKind}; +use std::error; +use std::fmt; +use std::path::Path; +use std::sync::Arc; +use std::str; +use std::str::FromStr; +use std::string::ToString; + +use mimetypes; + +use serde_json; + + +#[allow(unused_imports)] +use std::collections::{HashMap, BTreeMap}; +#[allow(unused_imports)] +use swagger; + +use swagger::{ApiError, XSpanId, XSpanIdString, Has, AuthData}; + +use {Api, + Op10GetResponse, + Op11GetResponse, + Op12GetResponse, + Op13GetResponse, + Op14GetResponse, + Op15GetResponse, + Op16GetResponse, + Op17GetResponse, + Op18GetResponse, + Op19GetResponse, + Op1GetResponse, + Op20GetResponse, + Op21GetResponse, + Op22GetResponse, + Op23GetResponse, + Op24GetResponse, + Op25GetResponse, + Op26GetResponse, + Op27GetResponse, + Op28GetResponse, + Op29GetResponse, + Op2GetResponse, + Op30GetResponse, + Op31GetResponse, + Op32GetResponse, + Op33GetResponse, + Op34GetResponse, + Op35GetResponse, + Op36GetResponse, + Op37GetResponse, + Op3GetResponse, + Op4GetResponse, + Op5GetResponse, + Op6GetResponse, + Op7GetResponse, + Op8GetResponse, + Op9GetResponse + }; +use models; + +define_encode_set! { + /// This encode set is used for object IDs + /// + /// Aside from the special characters defined in the `PATH_SEGMENT_ENCODE_SET`, + /// the vertical bar (|) is encoded. + pub ID_ENCODE_SET = [PATH_SEGMENT_ENCODE_SET] | {'|'} +} + +/// Convert input into a base path, e.g. "http://example:123". Also checks the scheme as it goes. +fn into_base_path(input: &str, correct_scheme: Option<&'static str>) -> Result { + // First convert to Uri, since a base path is a subset of Uri. + let uri = Uri::from_str(input)?; + + let scheme = uri.scheme().ok_or(ClientInitError::InvalidScheme)?; + + // Check the scheme if necessary + if let Some(correct_scheme) = correct_scheme { + if scheme != correct_scheme { + return Err(ClientInitError::InvalidScheme); + } + } + + let host = uri.host().ok_or_else(|| ClientInitError::MissingHost)?; + let port = uri.port().map(|x| format!(":{}", x)).unwrap_or_default(); + Ok(format!("{}://{}{}", scheme, host, port)) +} + +/// A client that implements the API by making HTTP calls out to a server. +pub struct Client where + F: Future + 'static { + client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, + base_path: String, +} + +impl fmt::Debug for Client where + F: Future + 'static { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "Client {{ base_path: {} }}", self.base_path) + } +} + +impl Clone for Client where + F: Future + 'static { + fn clone(&self) -> Self { + Client { + client_service: self.client_service.clone(), + base_path: self.base_path.clone() + } + } +} + +impl Client { + + /// Create an HTTP client. + /// + /// # Arguments + /// * `handle` - tokio reactor handle to use for execution + /// * `base_path` - base path of the client API, i.e. "www.my-api-implementation.com" + pub fn try_new_http(handle: Handle, base_path: &str) -> Result, ClientInitError> { + let http_connector = swagger::http_connector(); + Self::try_new_with_connector::( + handle, + base_path, + Some("http"), + http_connector, + ) + } + + /// Create a client with a TLS connection to the server. + /// + /// # Arguments + /// * `handle` - tokio reactor handle to use for execution + /// * `base_path` - base path of the client API, i.e. "www.my-api-implementation.com" + /// * `ca_certificate` - Path to CA certificate used to authenticate the server + pub fn try_new_https( + handle: Handle, + base_path: &str, + ca_certificate: CA, + ) -> Result, ClientInitError> + where + CA: AsRef, + { + let https_connector = swagger::https_connector(ca_certificate); + Self::try_new_with_connector::>( + handle, + base_path, + Some("https"), + https_connector, + ) + } + + /// Create a client with a mutually authenticated TLS connection to the server. + /// + /// # Arguments + /// * `handle` - tokio reactor handle to use for execution + /// * `base_path` - base path of the client API, i.e. "www.my-api-implementation.com" + /// * `ca_certificate` - Path to CA certificate used to authenticate the server + /// * `client_key` - Path to the client private key + /// * `client_certificate` - Path to the client's public certificate associated with the private key + pub fn try_new_https_mutual( + handle: Handle, + base_path: &str, + ca_certificate: CA, + client_key: K, + client_certificate: C, + ) -> Result, ClientInitError> + where + CA: AsRef, + K: AsRef, + C: AsRef, + { + let https_connector = + swagger::https_mutual_connector(ca_certificate, client_key, client_certificate); + Self::try_new_with_connector::>( + handle, + base_path, + Some("https"), + https_connector, + ) + } + + /// Create a client with a custom implementation of hyper::client::Connect. + /// + /// Intended for use with custom implementations of connect for e.g. protocol logging + /// or similar functionality which requires wrapping the transport layer. When wrapping a TCP connection, + /// this function should be used in conjunction with + /// `swagger::{http_connector, https_connector, https_mutual_connector}`. + /// + /// For ordinary tcp connections, prefer the use of `try_new_http`, `try_new_https` + /// and `try_new_https_mutual`, to avoid introducing a dependency on the underlying transport layer. + /// + /// # Arguments + /// + /// * `handle` - tokio reactor handle to use for execution + /// * `base_path` - base path of the client API, i.e. "www.my-api-implementation.com" + /// * `protocol` - Which protocol to use when constructing the request url, e.g. `Some("http")` + /// * `connector_fn` - Function which returns an implementation of `hyper::client::Connect` + pub fn try_new_with_connector( + handle: Handle, + base_path: &str, + protocol: Option<&'static str>, + connector_fn: Box C + Send + Sync>, + ) -> Result, ClientInitError> + where + C: hyper::client::Connect + hyper::client::Service, + { + let connector = connector_fn(&handle); + let client_service = Box::new(hyper::Client::configure().connector(connector).build( + &handle, + )); + + Ok(Client { + client_service: Arc::new(client_service), + base_path: into_base_path(base_path, protocol)?, + }) + } + + /// Constructor for creating a `Client` by passing in a pre-made `hyper` client. + /// + /// One should avoid relying on this function if possible, since it adds a dependency on the underlying transport + /// implementation, which it would be better to abstract away. Therefore, using this function may lead to a loss of + /// code generality, which may make it harder to move the application to a serverless environment, for example. + /// + /// The reason for this function's existence is to support legacy test code, which did mocking at the hyper layer. + /// This is not a recommended way to write new tests. If other reasons are found for using this function, they + /// should be mentioned here. + #[deprecated(note="Use try_new_with_client_service instead")] + pub fn try_new_with_hyper_client( + hyper_client: Arc, Response=hyper::Response, Error=hyper::Error, Future=hyper::client::FutureResponse>>>, + handle: Handle, + base_path: &str + ) -> Result, ClientInitError> + { + Ok(Client { + client_service: hyper_client, + base_path: into_base_path(base_path, None)?, + }) + } +} + +impl Client where + F: Future + 'static +{ + /// Constructor for creating a `Client` by passing in a pre-made `hyper` client Service. + /// + /// This allows adding custom wrappers around the underlying transport, for example for logging. + pub fn try_new_with_client_service(client_service: Arc, Response=hyper::Response, Error=hyper::Error, Future=F>>>, + handle: Handle, + base_path: &str) + -> Result, ClientInitError> + { + Ok(Client { + client_service: client_service, + base_path: into_base_path(base_path, None)?, + }) + } +} + +impl Api for Client where + F: Future + 'static, + C: Has { + + fn op10_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op10", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op10GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op11_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op11", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op11GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op12_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op12", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op12GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op13_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op13", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op13GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op14_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op14", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op14GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op15_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op15", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op15GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op16_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op16", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op16GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op17_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op17", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op17GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op18_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op18", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op18GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op19_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op19", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op19GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op1_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op1", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op1GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op20_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op20", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op20GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op21_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op21", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op21GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op22_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op22", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op22GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op23_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op23", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op23GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op24_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op24", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op24GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op25_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op25", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op25GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op26_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op26", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op26GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op27_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op27", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op27GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op28_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op28", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op28GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op29_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op29", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op29GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op2_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op2", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op2GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op30_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op30", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op30GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op31_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op31", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op31GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op32_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op32", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op32GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op33_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op33", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op33GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op34_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op34", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op34GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op35_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op35", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op35GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op36_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op36", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op36GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op37_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op37", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op37GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op3_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op3", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op3GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op4_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op4", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op4GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op5_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op5", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op5GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op6_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op6", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op6GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op7_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op7", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op7GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op8_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op8", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op8GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + + fn op9_get(&self, context: &C) -> Box> { + let mut uri = format!( + "{}/op9", + self.base_path + ); + + let mut query_string = self::url::form_urlencoded::Serializer::new("".to_owned()); + + + let query_string_str = query_string.finish(); + if !query_string_str.is_empty() { + uri += "?"; + uri += &query_string_str; + } + + let uri = match Uri::from_str(&uri) { + Ok(uri) => uri, + Err(err) => return Box::new(futures::done(Err(ApiError(format!("Unable to build URI: {}", err))))), + }; + + let mut request = hyper::Request::new(hyper::Method::Get, uri); + + + request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); + + + Box::new(self.client_service.call(request) + .map_err(|e| ApiError(format!("No response received: {}", e))) + .and_then(|mut response| { + match response.status().as_u16() { + 200 => { + let body = response.body(); + Box::new( + + future::ok( + Op9GetResponse::OK + ) + ) as Box> + }, + code => { + let headers = response.headers().clone(); + Box::new(response.body() + .take(100) + .concat2() + .then(move |body| + future::err(ApiError(format!("Unexpected response code {}:\n{:?}\n\n{}", + code, + headers, + match body { + Ok(ref body) => match str::from_utf8(body) { + Ok(body) => Cow::from(body), + Err(e) => Cow::from(format!("", e)), + }, + Err(e) => Cow::from(format!("", e)), + }))) + ) + ) as Box> + } + } + })) + + } + +} + +#[derive(Debug)] +pub enum ClientInitError { + InvalidScheme, + InvalidUri(hyper::error::UriError), + MissingHost, + SslError(openssl::error::ErrorStack) +} + +impl From for ClientInitError { + fn from(err: hyper::error::UriError) -> ClientInitError { + ClientInitError::InvalidUri(err) + } +} + +impl From for ClientInitError { + fn from(err: openssl::error::ErrorStack) -> ClientInitError { + ClientInitError::SslError(err) + } +} + +impl fmt::Display for ClientInitError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + (self as &fmt::Debug).fmt(f) + } +} + +impl error::Error for ClientInitError { + fn description(&self) -> &str { + "Failed to produce a hyper client." + } +} diff --git a/samples/server/petstore/rust-server/output/ops-v3/src/lib.rs b/samples/server/petstore/rust-server/output/ops-v3/src/lib.rs new file mode 100644 index 00000000000..e3170e11cf3 --- /dev/null +++ b/samples/server/petstore/rust-server/output/ops-v3/src/lib.rs @@ -0,0 +1,712 @@ +#![allow(missing_docs, trivial_casts, unused_variables, unused_mut, unused_imports, unused_extern_crates, non_camel_case_types)] +extern crate serde; +#[macro_use] +extern crate serde_derive; +extern crate serde_json; + + +extern crate futures; +extern crate chrono; +#[macro_use] +extern crate lazy_static; +#[macro_use] +extern crate log; + +// Logically this should be in the client and server modules, but rust doesn't allow `macro_use` from a module. +#[cfg(any(feature = "client", feature = "server"))] +#[macro_use] +extern crate hyper; + +extern crate swagger; + +#[macro_use] +extern crate url; + +use futures::Stream; +use std::io::Error; + +#[allow(unused_imports)] +use std::collections::HashMap; + +pub use futures::Future; + +#[cfg(any(feature = "client", feature = "server"))] +mod mimetypes; + +pub use swagger::{ApiError, ContextWrapper}; + +pub const BASE_PATH: &'static str = ""; +pub const API_VERSION: &'static str = "0.0.1"; + + +#[derive(Debug, PartialEq)] +pub enum Op10GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op11GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op12GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op13GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op14GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op15GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op16GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op17GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op18GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op19GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op1GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op20GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op21GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op22GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op23GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op24GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op25GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op26GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op27GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op28GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op29GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op2GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op30GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op31GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op32GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op33GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op34GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op35GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op36GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op37GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op3GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op4GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op5GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op6GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op7GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op8GetResponse { + /// OK + OK , +} + +#[derive(Debug, PartialEq)] +pub enum Op9GetResponse { + /// OK + OK , +} + + +/// API +pub trait Api { + + + fn op10_get(&self, context: &C) -> Box>; + + + fn op11_get(&self, context: &C) -> Box>; + + + fn op12_get(&self, context: &C) -> Box>; + + + fn op13_get(&self, context: &C) -> Box>; + + + fn op14_get(&self, context: &C) -> Box>; + + + fn op15_get(&self, context: &C) -> Box>; + + + fn op16_get(&self, context: &C) -> Box>; + + + fn op17_get(&self, context: &C) -> Box>; + + + fn op18_get(&self, context: &C) -> Box>; + + + fn op19_get(&self, context: &C) -> Box>; + + + fn op1_get(&self, context: &C) -> Box>; + + + fn op20_get(&self, context: &C) -> Box>; + + + fn op21_get(&self, context: &C) -> Box>; + + + fn op22_get(&self, context: &C) -> Box>; + + + fn op23_get(&self, context: &C) -> Box>; + + + fn op24_get(&self, context: &C) -> Box>; + + + fn op25_get(&self, context: &C) -> Box>; + + + fn op26_get(&self, context: &C) -> Box>; + + + fn op27_get(&self, context: &C) -> Box>; + + + fn op28_get(&self, context: &C) -> Box>; + + + fn op29_get(&self, context: &C) -> Box>; + + + fn op2_get(&self, context: &C) -> Box>; + + + fn op30_get(&self, context: &C) -> Box>; + + + fn op31_get(&self, context: &C) -> Box>; + + + fn op32_get(&self, context: &C) -> Box>; + + + fn op33_get(&self, context: &C) -> Box>; + + + fn op34_get(&self, context: &C) -> Box>; + + + fn op35_get(&self, context: &C) -> Box>; + + + fn op36_get(&self, context: &C) -> Box>; + + + fn op37_get(&self, context: &C) -> Box>; + + + fn op3_get(&self, context: &C) -> Box>; + + + fn op4_get(&self, context: &C) -> Box>; + + + fn op5_get(&self, context: &C) -> Box>; + + + fn op6_get(&self, context: &C) -> Box>; + + + fn op7_get(&self, context: &C) -> Box>; + + + fn op8_get(&self, context: &C) -> Box>; + + + fn op9_get(&self, context: &C) -> Box>; + +} + +/// API without a `Context` +pub trait ApiNoContext { + + + fn op10_get(&self) -> Box>; + + + fn op11_get(&self) -> Box>; + + + fn op12_get(&self) -> Box>; + + + fn op13_get(&self) -> Box>; + + + fn op14_get(&self) -> Box>; + + + fn op15_get(&self) -> Box>; + + + fn op16_get(&self) -> Box>; + + + fn op17_get(&self) -> Box>; + + + fn op18_get(&self) -> Box>; + + + fn op19_get(&self) -> Box>; + + + fn op1_get(&self) -> Box>; + + + fn op20_get(&self) -> Box>; + + + fn op21_get(&self) -> Box>; + + + fn op22_get(&self) -> Box>; + + + fn op23_get(&self) -> Box>; + + + fn op24_get(&self) -> Box>; + + + fn op25_get(&self) -> Box>; + + + fn op26_get(&self) -> Box>; + + + fn op27_get(&self) -> Box>; + + + fn op28_get(&self) -> Box>; + + + fn op29_get(&self) -> Box>; + + + fn op2_get(&self) -> Box>; + + + fn op30_get(&self) -> Box>; + + + fn op31_get(&self) -> Box>; + + + fn op32_get(&self) -> Box>; + + + fn op33_get(&self) -> Box>; + + + fn op34_get(&self) -> Box>; + + + fn op35_get(&self) -> Box>; + + + fn op36_get(&self) -> Box>; + + + fn op37_get(&self) -> Box>; + + + fn op3_get(&self) -> Box>; + + + fn op4_get(&self) -> Box>; + + + fn op5_get(&self) -> Box>; + + + fn op6_get(&self) -> Box>; + + + fn op7_get(&self) -> Box>; + + + fn op8_get(&self) -> Box>; + + + fn op9_get(&self) -> Box>; + +} + +/// Trait to extend an API to make it easy to bind it to a context. +pub trait ContextWrapperExt<'a, C> where Self: Sized { + /// Binds this API to a context. + fn with_context(self: &'a Self, context: C) -> ContextWrapper<'a, Self, C>; +} + +impl<'a, T: Api + Sized, C> ContextWrapperExt<'a, C> for T { + fn with_context(self: &'a T, context: C) -> ContextWrapper<'a, T, C> { + ContextWrapper::::new(self, context) + } +} + +impl<'a, T: Api, C> ApiNoContext for ContextWrapper<'a, T, C> { + + + fn op10_get(&self) -> Box> { + self.api().op10_get(&self.context()) + } + + + fn op11_get(&self) -> Box> { + self.api().op11_get(&self.context()) + } + + + fn op12_get(&self) -> Box> { + self.api().op12_get(&self.context()) + } + + + fn op13_get(&self) -> Box> { + self.api().op13_get(&self.context()) + } + + + fn op14_get(&self) -> Box> { + self.api().op14_get(&self.context()) + } + + + fn op15_get(&self) -> Box> { + self.api().op15_get(&self.context()) + } + + + fn op16_get(&self) -> Box> { + self.api().op16_get(&self.context()) + } + + + fn op17_get(&self) -> Box> { + self.api().op17_get(&self.context()) + } + + + fn op18_get(&self) -> Box> { + self.api().op18_get(&self.context()) + } + + + fn op19_get(&self) -> Box> { + self.api().op19_get(&self.context()) + } + + + fn op1_get(&self) -> Box> { + self.api().op1_get(&self.context()) + } + + + fn op20_get(&self) -> Box> { + self.api().op20_get(&self.context()) + } + + + fn op21_get(&self) -> Box> { + self.api().op21_get(&self.context()) + } + + + fn op22_get(&self) -> Box> { + self.api().op22_get(&self.context()) + } + + + fn op23_get(&self) -> Box> { + self.api().op23_get(&self.context()) + } + + + fn op24_get(&self) -> Box> { + self.api().op24_get(&self.context()) + } + + + fn op25_get(&self) -> Box> { + self.api().op25_get(&self.context()) + } + + + fn op26_get(&self) -> Box> { + self.api().op26_get(&self.context()) + } + + + fn op27_get(&self) -> Box> { + self.api().op27_get(&self.context()) + } + + + fn op28_get(&self) -> Box> { + self.api().op28_get(&self.context()) + } + + + fn op29_get(&self) -> Box> { + self.api().op29_get(&self.context()) + } + + + fn op2_get(&self) -> Box> { + self.api().op2_get(&self.context()) + } + + + fn op30_get(&self) -> Box> { + self.api().op30_get(&self.context()) + } + + + fn op31_get(&self) -> Box> { + self.api().op31_get(&self.context()) + } + + + fn op32_get(&self) -> Box> { + self.api().op32_get(&self.context()) + } + + + fn op33_get(&self) -> Box> { + self.api().op33_get(&self.context()) + } + + + fn op34_get(&self) -> Box> { + self.api().op34_get(&self.context()) + } + + + fn op35_get(&self) -> Box> { + self.api().op35_get(&self.context()) + } + + + fn op36_get(&self) -> Box> { + self.api().op36_get(&self.context()) + } + + + fn op37_get(&self) -> Box> { + self.api().op37_get(&self.context()) + } + + + fn op3_get(&self) -> Box> { + self.api().op3_get(&self.context()) + } + + + fn op4_get(&self) -> Box> { + self.api().op4_get(&self.context()) + } + + + fn op5_get(&self) -> Box> { + self.api().op5_get(&self.context()) + } + + + fn op6_get(&self) -> Box> { + self.api().op6_get(&self.context()) + } + + + fn op7_get(&self) -> Box> { + self.api().op7_get(&self.context()) + } + + + fn op8_get(&self) -> Box> { + self.api().op8_get(&self.context()) + } + + + fn op9_get(&self) -> Box> { + self.api().op9_get(&self.context()) + } + +} + +#[cfg(feature = "client")] +pub mod client; + +// Re-export Client as a top-level name +#[cfg(feature = "client")] +pub use self::client::Client; + +#[cfg(feature = "server")] +pub mod server; + +// Re-export router() as a top-level name +#[cfg(feature = "server")] +pub use self::server::Service; + +pub mod models; diff --git a/samples/server/petstore/rust-server/output/ops-v3/src/mimetypes.rs b/samples/server/petstore/rust-server/output/ops-v3/src/mimetypes.rs new file mode 100644 index 00000000000..304c686b3e5 --- /dev/null +++ b/samples/server/petstore/rust-server/output/ops-v3/src/mimetypes.rs @@ -0,0 +1,13 @@ +/// mime types for requests and responses + +pub mod responses { + use hyper::mime::*; + + // The macro is called per-operation to beat the recursion limit + +} + +pub mod requests { + use hyper::mime::*; + +} diff --git a/samples/server/petstore/rust-server/output/ops-v3/src/models.rs b/samples/server/petstore/rust-server/output/ops-v3/src/models.rs new file mode 100644 index 00000000000..a9cf8c096c9 --- /dev/null +++ b/samples/server/petstore/rust-server/output/ops-v3/src/models.rs @@ -0,0 +1,12 @@ +#![allow(unused_imports, unused_qualifications, unused_extern_crates)] +extern crate chrono; +extern crate uuid; + +use serde::ser::Serializer; + +use std::collections::HashMap; +use models; +use swagger; +use std::string::ParseError; + + diff --git a/samples/server/petstore/rust-server/output/ops-v3/src/server/context.rs b/samples/server/petstore/rust-server/output/ops-v3/src/server/context.rs new file mode 100644 index 00000000000..6f2900b3d70 --- /dev/null +++ b/samples/server/petstore/rust-server/output/ops-v3/src/server/context.rs @@ -0,0 +1,91 @@ +use std::io; +use std::marker::PhantomData; +use std::default::Default; +use hyper; +use hyper::{Request, Response, Error, StatusCode}; +use server::url::form_urlencoded; +use swagger::auth::{Authorization, AuthData, Scopes}; +use swagger::{Has, Pop, Push, XSpanIdString}; +use Api; + +pub struct NewAddContext +{ + inner: T, + marker: PhantomData, +} + +impl NewAddContext + where + A: Default + Push, + B: Push, Result=C>, + C: Push, Result=D>, + T: hyper::server::NewService + 'static, +{ + pub fn new(inner: T) -> NewAddContext { + NewAddContext { + inner, + marker: PhantomData, + } + } +} + +impl hyper::server::NewService for NewAddContext + where + A: Default + Push, + B: Push, Result=C>, + C: Push, Result=D>, + T: hyper::server::NewService + 'static, +{ + type Request = Request; + type Response = Response; + type Error = Error; + type Instance = AddContext; + + fn new_service(&self) -> Result { + self.inner.new_service().map(|s| AddContext::new(s)) + } +} + +/// Middleware to extract authentication data from request +pub struct AddContext +{ + inner: T, + marker: PhantomData, +} + +impl AddContext + where + A: Default + Push, + B: Push, Result=C>, + C: Push, Result=D>, + T: hyper::server::Service, +{ + pub fn new(inner: T) -> AddContext { + AddContext { + inner, + marker: PhantomData, + } + } +} + +impl hyper::server::Service for AddContext + where + A: Default + Push, + B: Push, Result=C>, + C: Push, Result=D>, + T: hyper::server::Service, +{ + type Request = Request; + type Response = Response; + type Error = Error; + type Future = T::Future; + + fn call(&self, req: Self::Request) -> Self::Future { + let context = A::default().push(XSpanIdString::get_or_generate(&req)); + + + let context = context.push(None::); + let context = context.push(None::); + return self.inner.call((req, context)); + } +} diff --git a/samples/server/petstore/rust-server/output/ops-v3/src/server/mod.rs b/samples/server/petstore/rust-server/output/ops-v3/src/server/mod.rs new file mode 100644 index 00000000000..d9ac04bfc27 --- /dev/null +++ b/samples/server/petstore/rust-server/output/ops-v3/src/server/mod.rs @@ -0,0 +1,2068 @@ +#![allow(unused_extern_crates)] +extern crate serde_ignored; +extern crate tokio_core; +extern crate native_tls; +extern crate hyper_tls; +extern crate openssl; +extern crate mime; +extern crate uuid; +extern crate chrono; +extern crate percent_encoding; +extern crate url; + + +use std::sync::Arc; +use std::marker::PhantomData; +use futures::{Future, future, Stream, stream}; +use hyper; +use hyper::{Request, Response, Error, StatusCode}; +use hyper::header::{Headers, ContentType}; +use self::url::form_urlencoded; +use mimetypes; + +use serde_json; + + +#[allow(unused_imports)] +use std::collections::{HashMap, BTreeMap}; +#[allow(unused_imports)] +use swagger; +use std::io; + +#[allow(unused_imports)] +use std::collections::BTreeSet; + +pub use swagger::auth::Authorization; +use swagger::{ApiError, XSpanId, XSpanIdString, Has, RequestParser}; +use swagger::auth::Scopes; + +use {Api, + Op10GetResponse, + Op11GetResponse, + Op12GetResponse, + Op13GetResponse, + Op14GetResponse, + Op15GetResponse, + Op16GetResponse, + Op17GetResponse, + Op18GetResponse, + Op19GetResponse, + Op1GetResponse, + Op20GetResponse, + Op21GetResponse, + Op22GetResponse, + Op23GetResponse, + Op24GetResponse, + Op25GetResponse, + Op26GetResponse, + Op27GetResponse, + Op28GetResponse, + Op29GetResponse, + Op2GetResponse, + Op30GetResponse, + Op31GetResponse, + Op32GetResponse, + Op33GetResponse, + Op34GetResponse, + Op35GetResponse, + Op36GetResponse, + Op37GetResponse, + Op3GetResponse, + Op4GetResponse, + Op5GetResponse, + Op6GetResponse, + Op7GetResponse, + Op8GetResponse, + Op9GetResponse + }; +#[allow(unused_imports)] +use models; + +pub mod context; + +header! { (Warning, "Warning") => [String] } + +mod paths { + extern crate regex; + + lazy_static! { + pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(vec![ + r"^/op1$", + r"^/op10$", + r"^/op11$", + r"^/op12$", + r"^/op13$", + r"^/op14$", + r"^/op15$", + r"^/op16$", + r"^/op17$", + r"^/op18$", + r"^/op19$", + r"^/op2$", + r"^/op20$", + r"^/op21$", + r"^/op22$", + r"^/op23$", + r"^/op24$", + r"^/op25$", + r"^/op26$", + r"^/op27$", + r"^/op28$", + r"^/op29$", + r"^/op3$", + r"^/op30$", + r"^/op31$", + r"^/op32$", + r"^/op33$", + r"^/op34$", + r"^/op35$", + r"^/op36$", + r"^/op37$", + r"^/op4$", + r"^/op5$", + r"^/op6$", + r"^/op7$", + r"^/op8$", + r"^/op9$" + ]).unwrap(); + } + pub static ID_OP1: usize = 0; + pub static ID_OP10: usize = 1; + pub static ID_OP11: usize = 2; + pub static ID_OP12: usize = 3; + pub static ID_OP13: usize = 4; + pub static ID_OP14: usize = 5; + pub static ID_OP15: usize = 6; + pub static ID_OP16: usize = 7; + pub static ID_OP17: usize = 8; + pub static ID_OP18: usize = 9; + pub static ID_OP19: usize = 10; + pub static ID_OP2: usize = 11; + pub static ID_OP20: usize = 12; + pub static ID_OP21: usize = 13; + pub static ID_OP22: usize = 14; + pub static ID_OP23: usize = 15; + pub static ID_OP24: usize = 16; + pub static ID_OP25: usize = 17; + pub static ID_OP26: usize = 18; + pub static ID_OP27: usize = 19; + pub static ID_OP28: usize = 20; + pub static ID_OP29: usize = 21; + pub static ID_OP3: usize = 22; + pub static ID_OP30: usize = 23; + pub static ID_OP31: usize = 24; + pub static ID_OP32: usize = 25; + pub static ID_OP33: usize = 26; + pub static ID_OP34: usize = 27; + pub static ID_OP35: usize = 28; + pub static ID_OP36: usize = 29; + pub static ID_OP37: usize = 30; + pub static ID_OP4: usize = 31; + pub static ID_OP5: usize = 32; + pub static ID_OP6: usize = 33; + pub static ID_OP7: usize = 34; + pub static ID_OP8: usize = 35; + pub static ID_OP9: usize = 36; +} + +pub struct NewService { + api_impl: Arc, + marker: PhantomData, +} + +impl NewService +where + T: Api + Clone + 'static, + C: Has + 'static +{ + pub fn new>>(api_impl: U) -> NewService { + NewService{api_impl: api_impl.into(), marker: PhantomData} + } +} + +impl hyper::server::NewService for NewService +where + T: Api + Clone + 'static, + C: Has + 'static +{ + type Request = (Request, C); + type Response = Response; + type Error = Error; + type Instance = Service; + + fn new_service(&self) -> Result { + Ok(Service::new(self.api_impl.clone())) + } +} + +pub struct Service { + api_impl: Arc, + marker: PhantomData, +} + +impl Service +where + T: Api + Clone + 'static, + C: Has + 'static { + pub fn new>>(api_impl: U) -> Service { + Service{api_impl: api_impl.into(), marker: PhantomData} + } +} + +impl hyper::server::Service for Service +where + T: Api + Clone + 'static, + C: Has + 'static +{ + type Request = (Request, C); + type Response = Response; + type Error = Error; + type Future = Box>; + + fn call(&self, (req, mut context): Self::Request) -> Self::Future { + let api_impl = self.api_impl.clone(); + let (method, uri, _, headers, body) = req.deconstruct(); + let path = paths::GLOBAL_REGEX_SET.matches(uri.path()); + + // This match statement is duplicated below in `parse_operation_id()`. + // Please update both places if changing how this code is autogenerated. + match &method { + + // Op10Get - GET /op10 + &hyper::Method::Get if path.matched(paths::ID_OP10) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op10_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op10GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op11Get - GET /op11 + &hyper::Method::Get if path.matched(paths::ID_OP11) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op11_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op11GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op12Get - GET /op12 + &hyper::Method::Get if path.matched(paths::ID_OP12) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op12_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op12GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op13Get - GET /op13 + &hyper::Method::Get if path.matched(paths::ID_OP13) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op13_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op13GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op14Get - GET /op14 + &hyper::Method::Get if path.matched(paths::ID_OP14) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op14_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op14GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op15Get - GET /op15 + &hyper::Method::Get if path.matched(paths::ID_OP15) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op15_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op15GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op16Get - GET /op16 + &hyper::Method::Get if path.matched(paths::ID_OP16) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op16_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op16GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op17Get - GET /op17 + &hyper::Method::Get if path.matched(paths::ID_OP17) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op17_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op17GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op18Get - GET /op18 + &hyper::Method::Get if path.matched(paths::ID_OP18) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op18_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op18GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op19Get - GET /op19 + &hyper::Method::Get if path.matched(paths::ID_OP19) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op19_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op19GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op1Get - GET /op1 + &hyper::Method::Get if path.matched(paths::ID_OP1) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op1_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op1GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op20Get - GET /op20 + &hyper::Method::Get if path.matched(paths::ID_OP20) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op20_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op20GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op21Get - GET /op21 + &hyper::Method::Get if path.matched(paths::ID_OP21) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op21_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op21GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op22Get - GET /op22 + &hyper::Method::Get if path.matched(paths::ID_OP22) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op22_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op22GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op23Get - GET /op23 + &hyper::Method::Get if path.matched(paths::ID_OP23) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op23_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op23GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op24Get - GET /op24 + &hyper::Method::Get if path.matched(paths::ID_OP24) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op24_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op24GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op25Get - GET /op25 + &hyper::Method::Get if path.matched(paths::ID_OP25) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op25_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op25GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op26Get - GET /op26 + &hyper::Method::Get if path.matched(paths::ID_OP26) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op26_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op26GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op27Get - GET /op27 + &hyper::Method::Get if path.matched(paths::ID_OP27) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op27_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op27GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op28Get - GET /op28 + &hyper::Method::Get if path.matched(paths::ID_OP28) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op28_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op28GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op29Get - GET /op29 + &hyper::Method::Get if path.matched(paths::ID_OP29) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op29_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op29GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op2Get - GET /op2 + &hyper::Method::Get if path.matched(paths::ID_OP2) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op2_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op2GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op30Get - GET /op30 + &hyper::Method::Get if path.matched(paths::ID_OP30) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op30_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op30GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op31Get - GET /op31 + &hyper::Method::Get if path.matched(paths::ID_OP31) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op31_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op31GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op32Get - GET /op32 + &hyper::Method::Get if path.matched(paths::ID_OP32) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op32_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op32GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op33Get - GET /op33 + &hyper::Method::Get if path.matched(paths::ID_OP33) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op33_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op33GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op34Get - GET /op34 + &hyper::Method::Get if path.matched(paths::ID_OP34) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op34_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op34GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op35Get - GET /op35 + &hyper::Method::Get if path.matched(paths::ID_OP35) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op35_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op35GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op36Get - GET /op36 + &hyper::Method::Get if path.matched(paths::ID_OP36) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op36_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op36GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op37Get - GET /op37 + &hyper::Method::Get if path.matched(paths::ID_OP37) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op37_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op37GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op3Get - GET /op3 + &hyper::Method::Get if path.matched(paths::ID_OP3) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op3_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op3GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op4Get - GET /op4 + &hyper::Method::Get if path.matched(paths::ID_OP4) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op4_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op4GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op5Get - GET /op5 + &hyper::Method::Get if path.matched(paths::ID_OP5) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op5_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op5GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op6Get - GET /op6 + &hyper::Method::Get if path.matched(paths::ID_OP6) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op6_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op6GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op7Get - GET /op7 + &hyper::Method::Get if path.matched(paths::ID_OP7) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op7_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op7GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op8Get - GET /op8 + &hyper::Method::Get if path.matched(paths::ID_OP8) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op8_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op8GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + // Op9Get - GET /op9 + &hyper::Method::Get if path.matched(paths::ID_OP9) => { + + + + + + + + Box::new({ + {{ + + Box::new(api_impl.op9_get(&context) + .then(move |result| { + let mut response = Response::new(); + response.headers_mut().set(XSpanId((&context as &Has).get().0.to_string())); + + match result { + Ok(rsp) => match rsp { + Op9GetResponse::OK + + + => { + response.set_status(StatusCode::try_from(200).unwrap()); + + }, + }, + Err(_) => { + // Application code returned an error. This should not happen, as the implementation should + // return a valid response. + response.set_status(StatusCode::InternalServerError); + response.set_body("An internal error occurred"); + }, + } + + future::ok(response) + } + )) + + }} + }) as Box> + + + }, + + + _ => Box::new(future::ok(Response::new().with_status(StatusCode::NotFound))) as Box>, + } + } +} + +impl Clone for Service +{ + fn clone(&self) -> Self { + Service { + api_impl: self.api_impl.clone(), + marker: self.marker.clone(), + } + } +} + +/// Request parser for `Api`. +pub struct ApiRequestParser; +impl RequestParser for ApiRequestParser { + fn parse_operation_id(request: &Request) -> Result<&'static str, ()> { + let path = paths::GLOBAL_REGEX_SET.matches(request.uri().path()); + match request.method() { + + // Op10Get - GET /op10 + &hyper::Method::Get if path.matched(paths::ID_OP10) => Ok("Op10Get"), + + // Op11Get - GET /op11 + &hyper::Method::Get if path.matched(paths::ID_OP11) => Ok("Op11Get"), + + // Op12Get - GET /op12 + &hyper::Method::Get if path.matched(paths::ID_OP12) => Ok("Op12Get"), + + // Op13Get - GET /op13 + &hyper::Method::Get if path.matched(paths::ID_OP13) => Ok("Op13Get"), + + // Op14Get - GET /op14 + &hyper::Method::Get if path.matched(paths::ID_OP14) => Ok("Op14Get"), + + // Op15Get - GET /op15 + &hyper::Method::Get if path.matched(paths::ID_OP15) => Ok("Op15Get"), + + // Op16Get - GET /op16 + &hyper::Method::Get if path.matched(paths::ID_OP16) => Ok("Op16Get"), + + // Op17Get - GET /op17 + &hyper::Method::Get if path.matched(paths::ID_OP17) => Ok("Op17Get"), + + // Op18Get - GET /op18 + &hyper::Method::Get if path.matched(paths::ID_OP18) => Ok("Op18Get"), + + // Op19Get - GET /op19 + &hyper::Method::Get if path.matched(paths::ID_OP19) => Ok("Op19Get"), + + // Op1Get - GET /op1 + &hyper::Method::Get if path.matched(paths::ID_OP1) => Ok("Op1Get"), + + // Op20Get - GET /op20 + &hyper::Method::Get if path.matched(paths::ID_OP20) => Ok("Op20Get"), + + // Op21Get - GET /op21 + &hyper::Method::Get if path.matched(paths::ID_OP21) => Ok("Op21Get"), + + // Op22Get - GET /op22 + &hyper::Method::Get if path.matched(paths::ID_OP22) => Ok("Op22Get"), + + // Op23Get - GET /op23 + &hyper::Method::Get if path.matched(paths::ID_OP23) => Ok("Op23Get"), + + // Op24Get - GET /op24 + &hyper::Method::Get if path.matched(paths::ID_OP24) => Ok("Op24Get"), + + // Op25Get - GET /op25 + &hyper::Method::Get if path.matched(paths::ID_OP25) => Ok("Op25Get"), + + // Op26Get - GET /op26 + &hyper::Method::Get if path.matched(paths::ID_OP26) => Ok("Op26Get"), + + // Op27Get - GET /op27 + &hyper::Method::Get if path.matched(paths::ID_OP27) => Ok("Op27Get"), + + // Op28Get - GET /op28 + &hyper::Method::Get if path.matched(paths::ID_OP28) => Ok("Op28Get"), + + // Op29Get - GET /op29 + &hyper::Method::Get if path.matched(paths::ID_OP29) => Ok("Op29Get"), + + // Op2Get - GET /op2 + &hyper::Method::Get if path.matched(paths::ID_OP2) => Ok("Op2Get"), + + // Op30Get - GET /op30 + &hyper::Method::Get if path.matched(paths::ID_OP30) => Ok("Op30Get"), + + // Op31Get - GET /op31 + &hyper::Method::Get if path.matched(paths::ID_OP31) => Ok("Op31Get"), + + // Op32Get - GET /op32 + &hyper::Method::Get if path.matched(paths::ID_OP32) => Ok("Op32Get"), + + // Op33Get - GET /op33 + &hyper::Method::Get if path.matched(paths::ID_OP33) => Ok("Op33Get"), + + // Op34Get - GET /op34 + &hyper::Method::Get if path.matched(paths::ID_OP34) => Ok("Op34Get"), + + // Op35Get - GET /op35 + &hyper::Method::Get if path.matched(paths::ID_OP35) => Ok("Op35Get"), + + // Op36Get - GET /op36 + &hyper::Method::Get if path.matched(paths::ID_OP36) => Ok("Op36Get"), + + // Op37Get - GET /op37 + &hyper::Method::Get if path.matched(paths::ID_OP37) => Ok("Op37Get"), + + // Op3Get - GET /op3 + &hyper::Method::Get if path.matched(paths::ID_OP3) => Ok("Op3Get"), + + // Op4Get - GET /op4 + &hyper::Method::Get if path.matched(paths::ID_OP4) => Ok("Op4Get"), + + // Op5Get - GET /op5 + &hyper::Method::Get if path.matched(paths::ID_OP5) => Ok("Op5Get"), + + // Op6Get - GET /op6 + &hyper::Method::Get if path.matched(paths::ID_OP6) => Ok("Op6Get"), + + // Op7Get - GET /op7 + &hyper::Method::Get if path.matched(paths::ID_OP7) => Ok("Op7Get"), + + // Op8Get - GET /op8 + &hyper::Method::Get if path.matched(paths::ID_OP8) => Ok("Op8Get"), + + // Op9Get - GET /op9 + &hyper::Method::Get if path.matched(paths::ID_OP9) => Ok("Op9Get"), + _ => Err(()), + } + } +} diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs index c2976549005..d37730a9a0e 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/server/mod.rs @@ -83,7 +83,7 @@ mod paths { extern crate regex; lazy_static! { - pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(&[ + pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(vec![ r"^/v2/another-fake/dummy$", r"^/v2/fake$", r"^/v2/fake/body-with-query-params$", diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs index f3dfff3a1d1..0d20d4c8103 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/server/mod.rs @@ -51,7 +51,7 @@ mod paths { extern crate regex; lazy_static! { - pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(&[ + pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(vec![ r"^/dummy$", r"^/file_response$", r"^/html$", From 4df1e1928c300a98fb86226ac799241b9296f1fd Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 4 Aug 2019 23:06:14 +0800 Subject: [PATCH 46/75] update rust server samples --- .../output/multipart-v3/src/server/mod.rs | 2 +- .../rust-server/output/ops-v3/Cargo.toml | 4 +- .../output/ops-v3/src/client/mod.rs | 79 --- .../rust-server/output/ops-v3/src/lib.rs | 1 + .../output/ops-v3/src/server/mod.rs | 450 +----------------- 5 files changed, 6 insertions(+), 530 deletions(-) diff --git a/samples/server/petstore/rust-server/output/multipart-v3/src/server/mod.rs b/samples/server/petstore/rust-server/output/multipart-v3/src/server/mod.rs index 67e139f9b24..fcdebca1781 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/multipart-v3/src/server/mod.rs @@ -51,7 +51,7 @@ mod paths { extern crate regex; lazy_static! { - pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(&[ + pub static ref GLOBAL_REGEX_SET: regex::RegexSet = regex::RegexSet::new(vec![ r"^/multipart_request$" ]).unwrap(); } diff --git a/samples/server/petstore/rust-server/output/ops-v3/Cargo.toml b/samples/server/petstore/rust-server/output/ops-v3/Cargo.toml index a5bf71f3b96..31607737856 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/Cargo.toml +++ b/samples/server/petstore/rust-server/output/ops-v3/Cargo.toml @@ -23,8 +23,8 @@ swagger = "2" # lazy_static = "0.2" log = "0.3.0" -mime = "0.3.3" -multipart = {version = "0.13.3", optional = true} +mime = "0.2.6" +multipart = {version = "0.13.3"} native-tls = {version = "0.1.4", optional = true} openssl = {version = "0.9.14", optional = true} percent-encoding = {version = "1.0.0", optional = true} diff --git a/samples/server/petstore/rust-server/output/ops-v3/src/client/mod.rs b/samples/server/petstore/rust-server/output/ops-v3/src/client/mod.rs index bf95e17b0ce..983e15ea2b4 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/src/client/mod.rs +++ b/samples/server/petstore/rust-server/output/ops-v3/src/client/mod.rs @@ -7,8 +7,6 @@ extern crate mime; extern crate chrono; extern crate url; - - use hyper; use hyper::header::{Headers, ContentType}; use hyper::Uri; @@ -26,12 +24,9 @@ use std::sync::Arc; use std::str; use std::str::FromStr; use std::string::ToString; - use mimetypes; - use serde_json; - #[allow(unused_imports)] use std::collections::{HashMap, BTreeMap}; #[allow(unused_imports)] @@ -306,8 +301,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -369,8 +362,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -432,8 +423,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -495,8 +484,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -558,8 +545,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -621,8 +606,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -684,8 +667,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -747,8 +728,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -810,8 +789,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -873,8 +850,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -936,8 +911,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -999,8 +972,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1062,8 +1033,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1125,8 +1094,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1188,8 +1155,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1251,8 +1216,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1314,8 +1277,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1377,8 +1338,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1440,8 +1399,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1503,8 +1460,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1566,8 +1521,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1629,8 +1582,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1692,8 +1643,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1755,8 +1704,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1818,8 +1765,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1881,8 +1826,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -1944,8 +1887,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2007,8 +1948,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2070,8 +2009,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2133,8 +2070,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2196,8 +2131,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2259,8 +2192,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2322,8 +2253,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2385,8 +2314,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2448,8 +2375,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2511,8 +2436,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { @@ -2574,8 +2497,6 @@ impl Api for Client where request.headers_mut().set(XSpanId((context as &Has).get().0.clone())); - - Box::new(self.client_service.call(request) .map_err(|e| ApiError(format!("No response received: {}", e))) .and_then(|mut response| { diff --git a/samples/server/petstore/rust-server/output/ops-v3/src/lib.rs b/samples/server/petstore/rust-server/output/ops-v3/src/lib.rs index e3170e11cf3..44f00e73b1c 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/src/lib.rs +++ b/samples/server/petstore/rust-server/output/ops-v3/src/lib.rs @@ -11,6 +11,7 @@ extern crate chrono; extern crate lazy_static; #[macro_use] extern crate log; +extern crate mime; // Logically this should be in the client and server modules, but rust doesn't allow `macro_use` from a module. #[cfg(any(feature = "client", feature = "server"))] diff --git a/samples/server/petstore/rust-server/output/ops-v3/src/server/mod.rs b/samples/server/petstore/rust-server/output/ops-v3/src/server/mod.rs index d9ac04bfc27..e21eeae6165 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/src/server/mod.rs +++ b/samples/server/petstore/rust-server/output/ops-v3/src/server/mod.rs @@ -5,11 +5,10 @@ extern crate native_tls; extern crate hyper_tls; extern crate openssl; extern crate mime; -extern crate uuid; extern crate chrono; extern crate percent_encoding; extern crate url; - +extern crate uuid; use std::sync::Arc; use std::marker::PhantomData; @@ -19,10 +18,8 @@ use hyper::{Request, Response, Error, StatusCode}; use hyper::header::{Headers, ContentType}; use self::url::form_urlencoded; use mimetypes; - use serde_json; - #[allow(unused_imports)] use std::collections::{HashMap, BTreeMap}; #[allow(unused_imports)] @@ -230,16 +227,8 @@ where // Op10Get - GET /op10 &hyper::Method::Get if path.matched(paths::ID_OP10) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op10_get(&context) .then(move |result| { let mut response = Response::new(); @@ -266,26 +255,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op11Get - GET /op11 &hyper::Method::Get if path.matched(paths::ID_OP11) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op11_get(&context) .then(move |result| { let mut response = Response::new(); @@ -312,26 +289,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op12Get - GET /op12 &hyper::Method::Get if path.matched(paths::ID_OP12) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op12_get(&context) .then(move |result| { let mut response = Response::new(); @@ -358,26 +323,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op13Get - GET /op13 &hyper::Method::Get if path.matched(paths::ID_OP13) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op13_get(&context) .then(move |result| { let mut response = Response::new(); @@ -404,26 +357,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op14Get - GET /op14 &hyper::Method::Get if path.matched(paths::ID_OP14) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op14_get(&context) .then(move |result| { let mut response = Response::new(); @@ -450,26 +391,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op15Get - GET /op15 &hyper::Method::Get if path.matched(paths::ID_OP15) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op15_get(&context) .then(move |result| { let mut response = Response::new(); @@ -496,26 +425,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op16Get - GET /op16 &hyper::Method::Get if path.matched(paths::ID_OP16) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op16_get(&context) .then(move |result| { let mut response = Response::new(); @@ -542,26 +459,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op17Get - GET /op17 &hyper::Method::Get if path.matched(paths::ID_OP17) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op17_get(&context) .then(move |result| { let mut response = Response::new(); @@ -588,26 +493,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op18Get - GET /op18 &hyper::Method::Get if path.matched(paths::ID_OP18) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op18_get(&context) .then(move |result| { let mut response = Response::new(); @@ -634,26 +527,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op19Get - GET /op19 &hyper::Method::Get if path.matched(paths::ID_OP19) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op19_get(&context) .then(move |result| { let mut response = Response::new(); @@ -680,26 +561,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op1Get - GET /op1 &hyper::Method::Get if path.matched(paths::ID_OP1) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op1_get(&context) .then(move |result| { let mut response = Response::new(); @@ -726,26 +595,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op20Get - GET /op20 &hyper::Method::Get if path.matched(paths::ID_OP20) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op20_get(&context) .then(move |result| { let mut response = Response::new(); @@ -772,26 +629,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op21Get - GET /op21 &hyper::Method::Get if path.matched(paths::ID_OP21) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op21_get(&context) .then(move |result| { let mut response = Response::new(); @@ -818,26 +663,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op22Get - GET /op22 &hyper::Method::Get if path.matched(paths::ID_OP22) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op22_get(&context) .then(move |result| { let mut response = Response::new(); @@ -864,26 +697,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op23Get - GET /op23 &hyper::Method::Get if path.matched(paths::ID_OP23) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op23_get(&context) .then(move |result| { let mut response = Response::new(); @@ -910,26 +731,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op24Get - GET /op24 &hyper::Method::Get if path.matched(paths::ID_OP24) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op24_get(&context) .then(move |result| { let mut response = Response::new(); @@ -956,26 +765,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op25Get - GET /op25 &hyper::Method::Get if path.matched(paths::ID_OP25) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op25_get(&context) .then(move |result| { let mut response = Response::new(); @@ -1002,26 +799,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op26Get - GET /op26 &hyper::Method::Get if path.matched(paths::ID_OP26) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op26_get(&context) .then(move |result| { let mut response = Response::new(); @@ -1048,26 +833,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op27Get - GET /op27 &hyper::Method::Get if path.matched(paths::ID_OP27) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op27_get(&context) .then(move |result| { let mut response = Response::new(); @@ -1094,26 +867,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op28Get - GET /op28 &hyper::Method::Get if path.matched(paths::ID_OP28) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op28_get(&context) .then(move |result| { let mut response = Response::new(); @@ -1140,26 +901,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op29Get - GET /op29 &hyper::Method::Get if path.matched(paths::ID_OP29) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op29_get(&context) .then(move |result| { let mut response = Response::new(); @@ -1186,26 +935,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op2Get - GET /op2 &hyper::Method::Get if path.matched(paths::ID_OP2) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op2_get(&context) .then(move |result| { let mut response = Response::new(); @@ -1232,26 +969,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op30Get - GET /op30 &hyper::Method::Get if path.matched(paths::ID_OP30) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op30_get(&context) .then(move |result| { let mut response = Response::new(); @@ -1278,26 +1003,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op31Get - GET /op31 &hyper::Method::Get if path.matched(paths::ID_OP31) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op31_get(&context) .then(move |result| { let mut response = Response::new(); @@ -1324,26 +1037,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op32Get - GET /op32 &hyper::Method::Get if path.matched(paths::ID_OP32) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op32_get(&context) .then(move |result| { let mut response = Response::new(); @@ -1370,26 +1071,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op33Get - GET /op33 &hyper::Method::Get if path.matched(paths::ID_OP33) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op33_get(&context) .then(move |result| { let mut response = Response::new(); @@ -1416,26 +1105,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op34Get - GET /op34 &hyper::Method::Get if path.matched(paths::ID_OP34) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op34_get(&context) .then(move |result| { let mut response = Response::new(); @@ -1462,26 +1139,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op35Get - GET /op35 &hyper::Method::Get if path.matched(paths::ID_OP35) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op35_get(&context) .then(move |result| { let mut response = Response::new(); @@ -1508,26 +1173,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op36Get - GET /op36 &hyper::Method::Get if path.matched(paths::ID_OP36) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op36_get(&context) .then(move |result| { let mut response = Response::new(); @@ -1554,26 +1207,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op37Get - GET /op37 &hyper::Method::Get if path.matched(paths::ID_OP37) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op37_get(&context) .then(move |result| { let mut response = Response::new(); @@ -1600,26 +1241,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op3Get - GET /op3 &hyper::Method::Get if path.matched(paths::ID_OP3) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op3_get(&context) .then(move |result| { let mut response = Response::new(); @@ -1646,26 +1275,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op4Get - GET /op4 &hyper::Method::Get if path.matched(paths::ID_OP4) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op4_get(&context) .then(move |result| { let mut response = Response::new(); @@ -1692,26 +1309,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op5Get - GET /op5 &hyper::Method::Get if path.matched(paths::ID_OP5) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op5_get(&context) .then(move |result| { let mut response = Response::new(); @@ -1738,26 +1343,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op6Get - GET /op6 &hyper::Method::Get if path.matched(paths::ID_OP6) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op6_get(&context) .then(move |result| { let mut response = Response::new(); @@ -1784,26 +1377,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op7Get - GET /op7 &hyper::Method::Get if path.matched(paths::ID_OP7) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op7_get(&context) .then(move |result| { let mut response = Response::new(); @@ -1830,26 +1411,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op8Get - GET /op8 &hyper::Method::Get if path.matched(paths::ID_OP8) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op8_get(&context) .then(move |result| { let mut response = Response::new(); @@ -1876,26 +1445,14 @@ where future::ok(response) } )) - }} }) as Box> - - }, - // Op9Get - GET /op9 &hyper::Method::Get if path.matched(paths::ID_OP9) => { - - - - - - - Box::new({ {{ - Box::new(api_impl.op9_get(&context) .then(move |result| { let mut response = Response::new(); @@ -1922,14 +1479,10 @@ where future::ok(response) } )) - }} }) as Box> - - }, - _ => Box::new(future::ok(Response::new().with_status(StatusCode::NotFound))) as Box>, } } @@ -1945,6 +1498,7 @@ impl Clone for Service } } + /// Request parser for `Api`. pub struct ApiRequestParser; impl RequestParser for ApiRequestParser { From 3f7653a5c9e1d66b71eac651168690380305b477 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 4 Aug 2019 23:57:19 +0800 Subject: [PATCH 47/75] Add a link to join the Slack workspace (#3554) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 1b7ed36b8c4..7a70c8adaf8 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@
+[![Jion the Slack chat room](https://img.shields.io/badge/Slack-Join%20the%20chat%20room-orange)](https://join.slack.com/t/openapi-generator/shared_invite/enQtNzAyNDMyOTU0OTE1LTY5ZDBiNDI5NzI5ZjQ1Y2E5OWVjMjZkYzY1ZGM2MWQ4YWFjMzcyNDY5MGI4NjQxNDBiMTlmZTc5NjY2ZTQ5MGM) [![Stable releaases in the Maven store](https://img.shields.io/maven-metadata/v/http/central.maven.org/maven2/org/openapitools/openapi-generator/maven-metadata.xml.svg)](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.openapitools%22%20AND%20a%3A%22openapi-generator%22) [![Follow OpenAPI Generator Twitter account to get the latest update](https://img.shields.io/twitter/follow/oas_generator.svg?style=social&label=Follow)](https://twitter.com/oas_generator) From a48df102d65e640414bd9dd98bc2ed13e65cc578 Mon Sep 17 00:00:00 2001 From: Esteban Gehring Date: Mon, 5 Aug 2019 10:40:18 +0200 Subject: [PATCH 48/75] #3542: typescript-angular fix string cast (#3558) --- .../codegen/languages/TypeScriptAngularClientCodegen.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java index 8fe22b430cc..87850355e90 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java @@ -165,8 +165,9 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode if (!additionalProperties.containsKey(PROVIDED_IN_ROOT)) { additionalProperties.put(PROVIDED_IN_ROOT, true); } else { - additionalProperties.put(PROVIDED_IN_ROOT, Boolean.valueOf( - (String) additionalProperties.get(PROVIDED_IN_ROOT))); + additionalProperties.put(PROVIDED_IN_ROOT, Boolean.parseBoolean( + additionalProperties.get(PROVIDED_IN_ROOT).toString() + )); } } else { additionalProperties.put(PROVIDED_IN_ROOT, false); From b20118b87c705b8f0f9ef6968aa75bfb61bdc67a Mon Sep 17 00:00:00 2001 From: Dennis Melzer Date: Mon, 5 Aug 2019 10:49:58 +0200 Subject: [PATCH 49/75] java-springcloud: No dependency management if parent overridden (#3301) * If a separate parent pom is specified, there should be no depdendency management #3230 * Add Bean Validation framework * Fix test and depedencies * Format pom --- .../libraries/spring-cloud/pom.mustache | 17 +++++++++++++++++ samples/client/petstore/spring-cloud/pom.xml | 5 +++++ 2 files changed, 22 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache index 1ba3588ac5a..6421924b76d 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache @@ -29,6 +29,7 @@ src/main/java +{{^parentOverridden}} @@ -41,11 +42,14 @@ +{{/parentOverridden}} io.swagger swagger-annotations +{{^parentOverridden}} ${swagger-core-version} +{{/parentOverridden}} @@ -84,13 +88,17 @@ com.github.joschi.jackson jackson-datatype-threetenbp + {{^parentOverridden}} 2.6.4 + {{/parentOverridden}} {{/threetenbp}} org.openapitools jackson-databind-nullable +{{^parentOverridden}} 0.1.0 +{{/parentOverridden}} org.springframework.boot @@ -104,5 +112,14 @@ spring-boot-starter-hateoas {{/hateoas}} +{{#useBeanValidation}} + + org.hibernate.validator + hibernate-validator + {{^parentOverridden}} + 6.0.16.Final + {{/parentOverridden}} + +{{/useBeanValidation}} diff --git a/samples/client/petstore/spring-cloud/pom.xml b/samples/client/petstore/spring-cloud/pom.xml index b14446583fb..db09f2e2596 100644 --- a/samples/client/petstore/spring-cloud/pom.xml +++ b/samples/client/petstore/spring-cloud/pom.xml @@ -66,5 +66,10 @@ spring-boot-starter-test test + + org.hibernate.validator + hibernate-validator + 6.0.16.Final + From 00f7134eb3a0a88aa6596720402caaddf12f7cae Mon Sep 17 00:00:00 2001 From: Cristian Achille Date: Mon, 5 Aug 2019 12:37:13 +0200 Subject: [PATCH 50/75] #2956 [typescript] change accessToken name parameter to optional (#3555) * [typescript] change accessToken name parameter to optional * [typescript] update samples for ts-fetch and ts-rxjs --- .../main/resources/typescript-axios/configuration.mustache | 4 ++-- .../src/main/resources/typescript-fetch/runtime.mustache | 2 +- .../src/main/resources/typescript-rxjs/runtime.mustache | 2 +- .../petstore/typescript-axios/builds/default/configuration.ts | 4 ++-- .../typescript-axios/builds/es6-target/configuration.ts | 4 ++-- .../builds/with-complex-headers/configuration.ts | 4 ++-- .../typescript-axios/builds/with-interfaces/configuration.ts | 4 ++-- .../configuration.ts | 4 ++-- .../typescript-axios/builds/with-npm-version/configuration.ts | 4 ++-- .../petstore/typescript-fetch/builds/default/runtime.ts | 2 +- .../petstore/typescript-fetch/builds/es6-target/runtime.ts | 2 +- .../typescript-fetch/builds/multiple-parameters/runtime.ts | 2 +- .../typescript-fetch/builds/with-interfaces/runtime.ts | 2 +- .../typescript-fetch/builds/with-npm-version/runtime.ts | 2 +- .../client/petstore/typescript-rxjs/builds/default/runtime.ts | 2 +- .../petstore/typescript-rxjs/builds/es6-target/runtime.ts | 2 +- .../typescript-rxjs/builds/with-interfaces/runtime.ts | 2 +- .../typescript-rxjs/builds/with-npm-version/runtime.ts | 2 +- 18 files changed, 25 insertions(+), 25 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/configuration.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/configuration.mustache index 98585d783f4..575a42c020f 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/configuration.mustache @@ -5,7 +5,7 @@ export interface ConfigurationParameters { apiKey?: string | ((name: string) => string); username?: string; password?: string; - accessToken?: string | ((name: string, scopes?: string[]) => string); + accessToken?: string | ((name?: string, scopes?: string[]) => string); basePath?: string; baseOptions?: any; } @@ -37,7 +37,7 @@ export class Configuration { * @param scopes oauth2 scope * @memberof Configuration */ - accessToken?: string | ((name: string, scopes?: string[]) => string); + accessToken?: string | ((name?: string, scopes?: string[]) => string); /** * override base path * diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache index 6878fd84958..0f80666ff9a 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache @@ -120,7 +120,7 @@ export interface ConfigurationParameters { username?: string; // parameter for basic security password?: string; // parameter for basic security apiKey?: string | ((name: string) => string); // parameter for apiKey security - accessToken?: string | ((name: string, scopes?: string[]) => string); // parameter for oauth2 security + accessToken?: string | ((name?: string, scopes?: string[]) => string); // parameter for oauth2 security } export class Configuration { diff --git a/modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache b/modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache index 429584b64c3..27f466a6650 100644 --- a/modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache @@ -12,7 +12,7 @@ export interface ConfigurationParameters { username?: string; // parameter for basic security password?: string; // parameter for basic security apiKey?: string | ((name: string) => string); // parameter for apiKey security - accessToken?: string | ((name: string, scopes?: string[]) => string); // parameter for oauth2 security + accessToken?: string | ((name?: string, scopes?: string[]) => string); // parameter for oauth2 security } export class Configuration { diff --git a/samples/client/petstore/typescript-axios/builds/default/configuration.ts b/samples/client/petstore/typescript-axios/builds/default/configuration.ts index 65f9da218d6..e53e30f35e3 100644 --- a/samples/client/petstore/typescript-axios/builds/default/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/default/configuration.ts @@ -16,7 +16,7 @@ export interface ConfigurationParameters { apiKey?: string | ((name: string) => string); username?: string; password?: string; - accessToken?: string | ((name: string, scopes?: string[]) => string); + accessToken?: string | ((name?: string, scopes?: string[]) => string); basePath?: string; baseOptions?: any; } @@ -48,7 +48,7 @@ export class Configuration { * @param scopes oauth2 scope * @memberof Configuration */ - accessToken?: string | ((name: string, scopes?: string[]) => string); + accessToken?: string | ((name?: string, scopes?: string[]) => string); /** * override base path * diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/configuration.ts b/samples/client/petstore/typescript-axios/builds/es6-target/configuration.ts index 65f9da218d6..e53e30f35e3 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/es6-target/configuration.ts @@ -16,7 +16,7 @@ export interface ConfigurationParameters { apiKey?: string | ((name: string) => string); username?: string; password?: string; - accessToken?: string | ((name: string, scopes?: string[]) => string); + accessToken?: string | ((name?: string, scopes?: string[]) => string); basePath?: string; baseOptions?: any; } @@ -48,7 +48,7 @@ export class Configuration { * @param scopes oauth2 scope * @memberof Configuration */ - accessToken?: string | ((name: string, scopes?: string[]) => string); + accessToken?: string | ((name?: string, scopes?: string[]) => string); /** * override base path * diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/configuration.ts b/samples/client/petstore/typescript-axios/builds/with-complex-headers/configuration.ts index 65f9da218d6..e53e30f35e3 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/configuration.ts @@ -16,7 +16,7 @@ export interface ConfigurationParameters { apiKey?: string | ((name: string) => string); username?: string; password?: string; - accessToken?: string | ((name: string, scopes?: string[]) => string); + accessToken?: string | ((name?: string, scopes?: string[]) => string); basePath?: string; baseOptions?: any; } @@ -48,7 +48,7 @@ export class Configuration { * @param scopes oauth2 scope * @memberof Configuration */ - accessToken?: string | ((name: string, scopes?: string[]) => string); + accessToken?: string | ((name?: string, scopes?: string[]) => string); /** * override base path * diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/configuration.ts b/samples/client/petstore/typescript-axios/builds/with-interfaces/configuration.ts index 65f9da218d6..e53e30f35e3 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/configuration.ts @@ -16,7 +16,7 @@ export interface ConfigurationParameters { apiKey?: string | ((name: string) => string); username?: string; password?: string; - accessToken?: string | ((name: string, scopes?: string[]) => string); + accessToken?: string | ((name?: string, scopes?: string[]) => string); basePath?: string; baseOptions?: any; } @@ -48,7 +48,7 @@ export class Configuration { * @param scopes oauth2 scope * @memberof Configuration */ - accessToken?: string | ((name: string, scopes?: string[]) => string); + accessToken?: string | ((name?: string, scopes?: string[]) => string); /** * override base path * diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/configuration.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/configuration.ts index 65f9da218d6..e53e30f35e3 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/configuration.ts @@ -16,7 +16,7 @@ export interface ConfigurationParameters { apiKey?: string | ((name: string) => string); username?: string; password?: string; - accessToken?: string | ((name: string, scopes?: string[]) => string); + accessToken?: string | ((name?: string, scopes?: string[]) => string); basePath?: string; baseOptions?: any; } @@ -48,7 +48,7 @@ export class Configuration { * @param scopes oauth2 scope * @memberof Configuration */ - accessToken?: string | ((name: string, scopes?: string[]) => string); + accessToken?: string | ((name?: string, scopes?: string[]) => string); /** * override base path * diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/configuration.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version/configuration.ts index 65f9da218d6..e53e30f35e3 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/configuration.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/configuration.ts @@ -16,7 +16,7 @@ export interface ConfigurationParameters { apiKey?: string | ((name: string) => string); username?: string; password?: string; - accessToken?: string | ((name: string, scopes?: string[]) => string); + accessToken?: string | ((name?: string, scopes?: string[]) => string); basePath?: string; baseOptions?: any; } @@ -48,7 +48,7 @@ export class Configuration { * @param scopes oauth2 scope * @memberof Configuration */ - accessToken?: string | ((name: string, scopes?: string[]) => string); + accessToken?: string | ((name?: string, scopes?: string[]) => string); /** * override base path * diff --git a/samples/client/petstore/typescript-fetch/builds/default/runtime.ts b/samples/client/petstore/typescript-fetch/builds/default/runtime.ts index c95a101fbac..6feeddff5d4 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/runtime.ts @@ -131,7 +131,7 @@ export interface ConfigurationParameters { username?: string; // parameter for basic security password?: string; // parameter for basic security apiKey?: string | ((name: string) => string); // parameter for apiKey security - accessToken?: string | ((name: string, scopes?: string[]) => string); // parameter for oauth2 security + accessToken?: string | ((name?: string, scopes?: string[]) => string); // parameter for oauth2 security } export class Configuration { diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/runtime.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/runtime.ts index c95a101fbac..6feeddff5d4 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/runtime.ts @@ -131,7 +131,7 @@ export interface ConfigurationParameters { username?: string; // parameter for basic security password?: string; // parameter for basic security apiKey?: string | ((name: string) => string); // parameter for apiKey security - accessToken?: string | ((name: string, scopes?: string[]) => string); // parameter for oauth2 security + accessToken?: string | ((name?: string, scopes?: string[]) => string); // parameter for oauth2 security } export class Configuration { diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts index c95a101fbac..6feeddff5d4 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts @@ -131,7 +131,7 @@ export interface ConfigurationParameters { username?: string; // parameter for basic security password?: string; // parameter for basic security apiKey?: string | ((name: string) => string); // parameter for apiKey security - accessToken?: string | ((name: string, scopes?: string[]) => string); // parameter for oauth2 security + accessToken?: string | ((name?: string, scopes?: string[]) => string); // parameter for oauth2 security } export class Configuration { diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts index c95a101fbac..6feeddff5d4 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts @@ -131,7 +131,7 @@ export interface ConfigurationParameters { username?: string; // parameter for basic security password?: string; // parameter for basic security apiKey?: string | ((name: string) => string); // parameter for apiKey security - accessToken?: string | ((name: string, scopes?: string[]) => string); // parameter for oauth2 security + accessToken?: string | ((name?: string, scopes?: string[]) => string); // parameter for oauth2 security } export class Configuration { diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/runtime.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/runtime.ts index c95a101fbac..6feeddff5d4 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/runtime.ts @@ -131,7 +131,7 @@ export interface ConfigurationParameters { username?: string; // parameter for basic security password?: string; // parameter for basic security apiKey?: string | ((name: string) => string); // parameter for apiKey security - accessToken?: string | ((name: string, scopes?: string[]) => string); // parameter for oauth2 security + accessToken?: string | ((name?: string, scopes?: string[]) => string); // parameter for oauth2 security } export class Configuration { diff --git a/samples/client/petstore/typescript-rxjs/builds/default/runtime.ts b/samples/client/petstore/typescript-rxjs/builds/default/runtime.ts index ef017aff8fa..01e3bb106fe 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/runtime.ts +++ b/samples/client/petstore/typescript-rxjs/builds/default/runtime.ts @@ -23,7 +23,7 @@ export interface ConfigurationParameters { username?: string; // parameter for basic security password?: string; // parameter for basic security apiKey?: string | ((name: string) => string); // parameter for apiKey security - accessToken?: string | ((name: string, scopes?: string[]) => string); // parameter for oauth2 security + accessToken?: string | ((name?: string, scopes?: string[]) => string); // parameter for oauth2 security } export class Configuration { diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/runtime.ts b/samples/client/petstore/typescript-rxjs/builds/es6-target/runtime.ts index ef017aff8fa..01e3bb106fe 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/runtime.ts +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/runtime.ts @@ -23,7 +23,7 @@ export interface ConfigurationParameters { username?: string; // parameter for basic security password?: string; // parameter for basic security apiKey?: string | ((name: string) => string); // parameter for apiKey security - accessToken?: string | ((name: string, scopes?: string[]) => string); // parameter for oauth2 security + accessToken?: string | ((name?: string, scopes?: string[]) => string); // parameter for oauth2 security } export class Configuration { diff --git a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/runtime.ts b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/runtime.ts index ef017aff8fa..01e3bb106fe 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/runtime.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/runtime.ts @@ -23,7 +23,7 @@ export interface ConfigurationParameters { username?: string; // parameter for basic security password?: string; // parameter for basic security apiKey?: string | ((name: string) => string); // parameter for apiKey security - accessToken?: string | ((name: string, scopes?: string[]) => string); // parameter for oauth2 security + accessToken?: string | ((name?: string, scopes?: string[]) => string); // parameter for oauth2 security } export class Configuration { diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/runtime.ts b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/runtime.ts index ef017aff8fa..01e3bb106fe 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/runtime.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/runtime.ts @@ -23,7 +23,7 @@ export interface ConfigurationParameters { username?: string; // parameter for basic security password?: string; // parameter for basic security apiKey?: string | ((name: string) => string); // parameter for apiKey security - accessToken?: string | ((name: string, scopes?: string[]) => string); // parameter for oauth2 security + accessToken?: string | ((name?: string, scopes?: string[]) => string); // parameter for oauth2 security } export class Configuration { From fae073874b3f1a5350f4e31c4168c7d97b8921be Mon Sep 17 00:00:00 2001 From: Jeremie Bresson Date: Mon, 5 Aug 2019 15:07:26 +0200 Subject: [PATCH 51/75] Update samples --- samples/client/petstore/spring-cloud-async/pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/samples/client/petstore/spring-cloud-async/pom.xml b/samples/client/petstore/spring-cloud-async/pom.xml index b14446583fb..db09f2e2596 100644 --- a/samples/client/petstore/spring-cloud-async/pom.xml +++ b/samples/client/petstore/spring-cloud-async/pom.xml @@ -66,5 +66,10 @@ spring-boot-starter-test test + + org.hibernate.validator + hibernate-validator + 6.0.16.Final + From f756bd5e11a4ba5e0f4b38f6cd3003eb017912d6 Mon Sep 17 00:00:00 2001 From: Prateek Malhotra Date: Mon, 5 Aug 2019 13:48:52 -0400 Subject: [PATCH 52/75] typescript-fetch: Properly detect and encode container request body param (#3517) Signed-off-by: Prateek Malhotra Co-Authored-By: Esteban Gehring --- .../src/main/resources/typescript-fetch/apis.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache index 662ec63b5b8..d1751f7135d 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache @@ -181,7 +181,7 @@ export class {{classname}} extends runtime.BaseAPI { {{#hasBodyParam}} {{#bodyParam}} {{#isContainer}} - body: requestParameters.{{paramName}}.map({{#items}}{{datatype}}{{/items}}ToJSON), + body: requestParameters.{{paramName}}{{#isListContainer}}{{#items}}{{^isPrimitiveType}}.map({{datatype}}ToJSON){{/isPrimitiveType}}{{/items}}{{/isListContainer}}, {{/isContainer}} {{^isContainer}} {{^isPrimitiveType}} From 2bbebf97528115fedbbd9f9545544c8cf325c8ff Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 6 Aug 2019 08:52:48 +0800 Subject: [PATCH 53/75] [Ruby] clean up Ruby dev dependencies (#3551) * clean up ruby dev dependencies * update ensure uptodate to cover ruby faraday --- .gitignore | 4 + bin/utils/ensure-up-to-date | 2 +- .../resources/ruby-client/gemspec.mustache | 6 -- .../petstore/ruby-faraday/petstore.gemspec | 6 -- .../client/petstore/ruby/Gemfile.lock | 79 ------------------- .../client/petstore/ruby/petstore.gemspec | 6 -- 6 files changed, 5 insertions(+), 98 deletions(-) delete mode 100644 samples/openapi3/client/petstore/ruby/Gemfile.lock diff --git a/.gitignore b/.gitignore index a4ac179d18d..56cc80cae68 100644 --- a/.gitignore +++ b/.gitignore @@ -232,3 +232,7 @@ samples/client/petstore/elm/index.html # C samples/client/petstore/c/build samples/client/petstore/c/*.so + +# Ruby +samples/openapi3/client/petstore/ruby/Gemfile.lock +samples/openapi3/client/petstore/ruby-faraday/Gemfile.lock diff --git a/bin/utils/ensure-up-to-date b/bin/utils/ensure-up-to-date index 166c8c60bd1..799e7dc2005 100755 --- a/bin/utils/ensure-up-to-date +++ b/bin/utils/ensure-up-to-date @@ -13,7 +13,7 @@ sleep 5 declare -a scripts=( # SAMPLES "./bin/openapi3/ruby-client-petstore.sh" -"./bin/ruby-client-petstore.sh" +"./bin/openapi3/ruby-client-faraday-petstore.sh" "./bin/java-petstore-all.sh" "./bin/java-jaxrs-petstore-server-all.sh" "./bin/java-msf4j-petstore-server.sh" diff --git a/modules/openapi-generator/src/main/resources/ruby-client/gemspec.mustache b/modules/openapi-generator/src/main/resources/ruby-client/gemspec.mustache index e4a486855c5..0fe63c2e47b 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/gemspec.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/gemspec.mustache @@ -33,12 +33,6 @@ Gem::Specification.new do |s| s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1' - s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3' - s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6' - s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2' - s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16' - s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12' s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } s.test_files = `find spec/*`.split("\n") diff --git a/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec b/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec index c414c1806b0..6fe25dceb0c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec +++ b/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec @@ -31,12 +31,6 @@ Gem::Specification.new do |s| s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1' - s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3' - s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6' - s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2' - s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16' - s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12' s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } s.test_files = `find spec/*`.split("\n") diff --git a/samples/openapi3/client/petstore/ruby/Gemfile.lock b/samples/openapi3/client/petstore/ruby/Gemfile.lock deleted file mode 100644 index 14030efc945..00000000000 --- a/samples/openapi3/client/petstore/ruby/Gemfile.lock +++ /dev/null @@ -1,79 +0,0 @@ -PATH - remote: . - specs: - petstore (1.0.0) - json (~> 2.1, >= 2.1.0) - typhoeus (~> 1.0, >= 1.0.1) - -GEM - remote: https://rubygems.org/ - specs: - ZenTest (4.11.2) - addressable (2.5.2) - public_suffix (>= 2.0.2, < 4.0) - autotest (4.4.6) - ZenTest (>= 4.4.1) - autotest-fsevent (0.2.14) - sys-uname - autotest-growl (0.2.16) - autotest-rails-pure (4.1.2) - byebug (10.0.2) - coderay (1.1.2) - crack (0.4.3) - safe_yaml (~> 1.0.0) - diff-lcs (1.3) - ethon (0.11.0) - ffi (>= 1.3.0) - ffi (1.9.25) - hashdiff (0.3.7) - json (2.1.0) - method_source (0.9.0) - pry (0.11.3) - coderay (~> 1.1.0) - method_source (~> 0.9.0) - pry-byebug (3.6.0) - byebug (~> 10.0) - pry (~> 0.10) - public_suffix (3.0.3) - rake (12.0.0) - rspec (3.8.0) - rspec-core (~> 3.8.0) - rspec-expectations (~> 3.8.0) - rspec-mocks (~> 3.8.0) - rspec-core (3.8.0) - rspec-support (~> 3.8.0) - rspec-expectations (3.8.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-mocks (3.8.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-support (3.8.0) - safe_yaml (1.0.4) - sys-uname (1.0.3) - ffi (>= 1.0.0) - typhoeus (1.3.0) - ethon (>= 0.9.0) - vcr (3.0.3) - webmock (1.24.6) - addressable (>= 2.3.6) - crack (>= 0.3.2) - hashdiff - -PLATFORMS - ruby - -DEPENDENCIES - autotest (~> 4.4, >= 4.4.6) - autotest-fsevent (~> 0.2, >= 0.2.12) - autotest-growl (~> 0.2, >= 0.2.16) - autotest-rails-pure (~> 4.1, >= 4.1.2) - petstore! - pry-byebug - rake (~> 12.0.0) - rspec (~> 3.6, >= 3.6.0) - vcr (~> 3.0, >= 3.0.1) - webmock (~> 1.24, >= 1.24.3) - -BUNDLED WITH - 1.16.1 diff --git a/samples/openapi3/client/petstore/ruby/petstore.gemspec b/samples/openapi3/client/petstore/ruby/petstore.gemspec index 167ff9a753e..902141a5ce5 100644 --- a/samples/openapi3/client/petstore/ruby/petstore.gemspec +++ b/samples/openapi3/client/petstore/ruby/petstore.gemspec @@ -31,12 +31,6 @@ Gem::Specification.new do |s| s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1' - s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3' - s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6' - s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2' - s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16' - s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12' s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } s.test_files = `find spec/*`.split("\n") From 5ab1c9c75b9e5bb4762bd4fa0a4e4b48a642c1bd Mon Sep 17 00:00:00 2001 From: "Juang, Yi-Lin" Date: Tue, 6 Aug 2019 10:26:50 +0800 Subject: [PATCH 54/75] Fix logic of `getNullableType` of csharp server and client. (#3537) * Fix default nullable * Fix tests * Update samples * Fix template default value * Update samples * Also fix for interface * update samples --- .../languages/AbstractCSharpCodegen.java | 1 + .../languages/AspNetCoreServerCodegen.java | 15 +- .../languages/CSharpClientCodegen.java | 14 +- .../src/main/resources/csharp/api.mustache | 16 +- .../codegen/csharp/CSharpModelTest.java | 66 +- .../OpenAPIClient/.openapi-generator/VERSION | 2 +- .../Lib/OpenAPIClient/docs/UserApi.md | 4 +- .../OpenAPIClient/docs/FormatTest.md | 2 +- ...dPropertiesAndAdditionalPropertiesClass.md | 2 +- .../OpenAPIClientCore/docs/FormatTest.md | 2 +- ...dPropertiesAndAdditionalPropertiesClass.md | 2 +- .../docs/AdditionalPropertiesClass.md | 8 +- .../csharp/OpenAPIClient/docs/ApiResponse.md | 2 +- .../docs/ArrayOfArrayOfNumberOnly.md | 2 +- .../OpenAPIClient/docs/ArrayOfNumberOnly.md | 2 +- .../csharp/OpenAPIClient/docs/ArrayTest.md | 2 +- .../petstore/csharp/OpenAPIClient/docs/Cat.md | 2 +- .../csharp/OpenAPIClient/docs/CatAllOf.md | 2 +- .../csharp/OpenAPIClient/docs/Category.md | 2 +- .../csharp/OpenAPIClient/docs/EnumTest.md | 4 +- .../csharp/OpenAPIClient/docs/FakeApi.md | 90 +- .../csharp/OpenAPIClient/docs/FormatTest.md | 18 +- .../csharp/OpenAPIClient/docs/MapTest.md | 4 +- ...dPropertiesAndAdditionalPropertiesClass.md | 4 +- .../OpenAPIClient/docs/Model200Response.md | 2 +- .../csharp/OpenAPIClient/docs/Name.md | 6 +- .../csharp/OpenAPIClient/docs/NumberOnly.md | 2 +- .../csharp/OpenAPIClient/docs/Order.md | 10 +- .../OpenAPIClient/docs/OuterComposite.md | 4 +- .../petstore/csharp/OpenAPIClient/docs/Pet.md | 2 +- .../csharp/OpenAPIClient/docs/PetApi.md | 30 +- .../csharp/OpenAPIClient/docs/Return.md | 2 +- .../OpenAPIClient/docs/SpecialModelName.md | 2 +- .../csharp/OpenAPIClient/docs/StoreApi.md | 12 +- .../petstore/csharp/OpenAPIClient/docs/Tag.md | 2 +- .../OpenAPIClient/docs/TypeHolderDefault.md | 8 +- .../OpenAPIClient/docs/TypeHolderExample.md | 8 +- .../csharp/OpenAPIClient/docs/User.md | 4 +- .../csharp/OpenAPIClient/docs/XmlItem.md | 48 +- .../Org.OpenAPITools/Api/AnotherFakeApi.cs | 2 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 170 +-- .../Api/FakeClassnameTags123Api.cs | 2 +- .../src/Org.OpenAPITools/Api/PetApi.cs | 84 +- .../src/Org.OpenAPITools/Api/StoreApi.cs | 62 +- .../src/Org.OpenAPITools/Api/UserApi.cs | 4 +- .../Model/AdditionalPropertiesBoolean.cs | 2 +- .../Model/AdditionalPropertiesClass.cs | 10 +- .../Model/AdditionalPropertiesInteger.cs | 2 +- .../Model/AdditionalPropertiesNumber.cs | 2 +- .../src/Org.OpenAPITools/Model/ApiResponse.cs | 4 +- .../Model/ArrayOfArrayOfNumberOnly.cs | 4 +- .../Model/ArrayOfNumberOnly.cs | 4 +- .../src/Org.OpenAPITools/Model/ArrayTest.cs | 4 +- .../src/Org.OpenAPITools/Model/Cat.cs | 4 +- .../src/Org.OpenAPITools/Model/CatAllOf.cs | 4 +- .../src/Org.OpenAPITools/Model/Category.cs | 4 +- .../src/Org.OpenAPITools/Model/FormatTest.cs | 60 +- .../src/Org.OpenAPITools/Model/MapTest.cs | 6 +- ...dPropertiesAndAdditionalPropertiesClass.cs | 6 +- .../Model/Model200Response.cs | 4 +- .../src/Org.OpenAPITools/Model/Name.cs | 8 +- .../src/Org.OpenAPITools/Model/NumberOnly.cs | 4 +- .../src/Org.OpenAPITools/Model/Order.cs | 12 +- .../Org.OpenAPITools/Model/OuterComposite.cs | 6 +- .../src/Org.OpenAPITools/Model/Pet.cs | 4 +- .../src/Org.OpenAPITools/Model/Return.cs | 4 +- .../Model/SpecialModelName.cs | 4 +- .../src/Org.OpenAPITools/Model/Tag.cs | 4 +- .../Model/TypeHolderDefault.cs | 10 +- .../Model/TypeHolderExample.cs | 10 +- .../src/Org.OpenAPITools/Model/User.cs | 6 +- .../src/Org.OpenAPITools/Model/XmlItem.cs | 50 +- .../.openapi-generator/VERSION | 2 +- .../csharp/OpenAPIClientNet35/README.md | 11 +- .../docs/AdditionalPropertiesClass.md | 8 +- .../OpenAPIClientNet35/docs/AnotherFakeApi.md | 16 +- .../OpenAPIClientNet35/docs/ApiResponse.md | 2 +- .../docs/ArrayOfArrayOfNumberOnly.md | 2 +- .../docs/ArrayOfNumberOnly.md | 2 +- .../OpenAPIClientNet35/docs/ArrayTest.md | 2 +- .../csharp/OpenAPIClientNet35/docs/Cat.md | 2 +- .../OpenAPIClientNet35/docs/CatAllOf.md | 2 +- .../OpenAPIClientNet35/docs/Category.md | 2 +- .../OpenAPIClientNet35/docs/EnumTest.md | 4 +- .../csharp/OpenAPIClientNet35/docs/FakeApi.md | 300 +++-- .../docs/FakeClassnameTags123Api.md | 16 +- .../OpenAPIClientNet35/docs/FormatTest.md | 18 +- .../csharp/OpenAPIClientNet35/docs/MapTest.md | 4 +- ...dPropertiesAndAdditionalPropertiesClass.md | 4 +- .../docs/Model200Response.md | 2 +- .../csharp/OpenAPIClientNet35/docs/Name.md | 6 +- .../OpenAPIClientNet35/docs/NumberOnly.md | 2 +- .../csharp/OpenAPIClientNet35/docs/Order.md | 10 +- .../OpenAPIClientNet35/docs/OuterComposite.md | 4 +- .../csharp/OpenAPIClientNet35/docs/Pet.md | 2 +- .../csharp/OpenAPIClientNet35/docs/PetApi.md | 195 +++- .../csharp/OpenAPIClientNet35/docs/Return.md | 2 +- .../docs/SpecialModelName.md | 2 +- .../OpenAPIClientNet35/docs/StoreApi.md | 80 +- .../csharp/OpenAPIClientNet35/docs/Tag.md | 2 +- .../docs/TypeHolderDefault.md | 8 +- .../docs/TypeHolderExample.md | 8 +- .../csharp/OpenAPIClientNet35/docs/User.md | 4 +- .../csharp/OpenAPIClientNet35/docs/UserApi.md | 137 ++- .../csharp/OpenAPIClientNet35/docs/XmlItem.md | 48 +- .../Org.OpenAPITools/Api/AnotherFakeApi.cs | 2 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 86 +- .../Api/FakeClassnameTags123Api.cs | 2 +- .../src/Org.OpenAPITools/Api/PetApi.cs | 44 +- .../src/Org.OpenAPITools/Api/StoreApi.cs | 32 +- .../src/Org.OpenAPITools/Api/UserApi.cs | 4 +- .../Model/AdditionalPropertiesBoolean.cs | 2 +- .../Model/AdditionalPropertiesClass.cs | 10 +- .../Model/AdditionalPropertiesInteger.cs | 2 +- .../Model/AdditionalPropertiesNumber.cs | 2 +- .../src/Org.OpenAPITools/Model/ApiResponse.cs | 4 +- .../Model/ArrayOfArrayOfNumberOnly.cs | 4 +- .../Model/ArrayOfNumberOnly.cs | 4 +- .../src/Org.OpenAPITools/Model/ArrayTest.cs | 4 +- .../src/Org.OpenAPITools/Model/Cat.cs | 4 +- .../src/Org.OpenAPITools/Model/CatAllOf.cs | 4 +- .../src/Org.OpenAPITools/Model/Category.cs | 4 +- .../src/Org.OpenAPITools/Model/FormatTest.cs | 20 +- .../src/Org.OpenAPITools/Model/MapTest.cs | 6 +- ...dPropertiesAndAdditionalPropertiesClass.cs | 6 +- .../Model/Model200Response.cs | 4 +- .../src/Org.OpenAPITools/Model/Name.cs | 8 +- .../src/Org.OpenAPITools/Model/NumberOnly.cs | 4 +- .../src/Org.OpenAPITools/Model/Order.cs | 12 +- .../Org.OpenAPITools/Model/OuterComposite.cs | 6 +- .../src/Org.OpenAPITools/Model/Pet.cs | 4 +- .../src/Org.OpenAPITools/Model/Return.cs | 4 +- .../Model/SpecialModelName.cs | 4 +- .../src/Org.OpenAPITools/Model/Tag.cs | 4 +- .../Model/TypeHolderDefault.cs | 10 +- .../Model/TypeHolderExample.cs | 10 +- .../src/Org.OpenAPITools/Model/User.cs | 6 +- .../src/Org.OpenAPITools/Model/XmlItem.cs | 50 +- .../.openapi-generator/VERSION | 2 +- .../csharp/OpenAPIClientNet40/README.md | 11 +- .../docs/AdditionalPropertiesClass.md | 8 +- .../OpenAPIClientNet40/docs/AnotherFakeApi.md | 16 +- .../OpenAPIClientNet40/docs/ApiResponse.md | 2 +- .../docs/ArrayOfArrayOfNumberOnly.md | 2 +- .../docs/ArrayOfNumberOnly.md | 2 +- .../OpenAPIClientNet40/docs/ArrayTest.md | 2 +- .../csharp/OpenAPIClientNet40/docs/Cat.md | 2 +- .../OpenAPIClientNet40/docs/CatAllOf.md | 2 +- .../OpenAPIClientNet40/docs/Category.md | 2 +- .../OpenAPIClientNet40/docs/EnumTest.md | 4 +- .../csharp/OpenAPIClientNet40/docs/FakeApi.md | 300 +++-- .../docs/FakeClassnameTags123Api.md | 16 +- .../OpenAPIClientNet40/docs/FormatTest.md | 18 +- .../csharp/OpenAPIClientNet40/docs/MapTest.md | 4 +- ...dPropertiesAndAdditionalPropertiesClass.md | 4 +- .../docs/Model200Response.md | 2 +- .../csharp/OpenAPIClientNet40/docs/Name.md | 6 +- .../OpenAPIClientNet40/docs/NumberOnly.md | 2 +- .../csharp/OpenAPIClientNet40/docs/Order.md | 10 +- .../OpenAPIClientNet40/docs/OuterComposite.md | 4 +- .../csharp/OpenAPIClientNet40/docs/Pet.md | 2 +- .../csharp/OpenAPIClientNet40/docs/PetApi.md | 195 +++- .../csharp/OpenAPIClientNet40/docs/Return.md | 2 +- .../docs/SpecialModelName.md | 2 +- .../OpenAPIClientNet40/docs/StoreApi.md | 80 +- .../csharp/OpenAPIClientNet40/docs/Tag.md | 2 +- .../docs/TypeHolderDefault.md | 8 +- .../docs/TypeHolderExample.md | 8 +- .../csharp/OpenAPIClientNet40/docs/User.md | 4 +- .../csharp/OpenAPIClientNet40/docs/UserApi.md | 137 ++- .../csharp/OpenAPIClientNet40/docs/XmlItem.md | 48 +- .../Org.OpenAPITools/Api/AnotherFakeApi.cs | 2 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 86 +- .../Api/FakeClassnameTags123Api.cs | 2 +- .../src/Org.OpenAPITools/Api/PetApi.cs | 44 +- .../src/Org.OpenAPITools/Api/StoreApi.cs | 32 +- .../src/Org.OpenAPITools/Api/UserApi.cs | 4 +- .../Model/AdditionalPropertiesBoolean.cs | 2 +- .../Model/AdditionalPropertiesClass.cs | 10 +- .../Model/AdditionalPropertiesInteger.cs | 2 +- .../Model/AdditionalPropertiesNumber.cs | 2 +- .../src/Org.OpenAPITools/Model/ApiResponse.cs | 4 +- .../Model/ArrayOfArrayOfNumberOnly.cs | 4 +- .../Model/ArrayOfNumberOnly.cs | 4 +- .../src/Org.OpenAPITools/Model/ArrayTest.cs | 4 +- .../src/Org.OpenAPITools/Model/Cat.cs | 4 +- .../src/Org.OpenAPITools/Model/CatAllOf.cs | 4 +- .../src/Org.OpenAPITools/Model/Category.cs | 4 +- .../src/Org.OpenAPITools/Model/FormatTest.cs | 60 +- .../src/Org.OpenAPITools/Model/MapTest.cs | 6 +- ...dPropertiesAndAdditionalPropertiesClass.cs | 6 +- .../Model/Model200Response.cs | 4 +- .../src/Org.OpenAPITools/Model/Name.cs | 8 +- .../src/Org.OpenAPITools/Model/NumberOnly.cs | 4 +- .../src/Org.OpenAPITools/Model/Order.cs | 12 +- .../Org.OpenAPITools/Model/OuterComposite.cs | 6 +- .../src/Org.OpenAPITools/Model/Pet.cs | 4 +- .../src/Org.OpenAPITools/Model/Return.cs | 4 +- .../Model/SpecialModelName.cs | 4 +- .../src/Org.OpenAPITools/Model/Tag.cs | 4 +- .../Model/TypeHolderDefault.cs | 10 +- .../Model/TypeHolderExample.cs | 10 +- .../src/Org.OpenAPITools/Model/User.cs | 6 +- .../src/Org.OpenAPITools/Model/XmlItem.cs | 50 +- .../.openapi-generator/VERSION | 2 +- .../OpenAPIClientNetCoreProject/README.md | 66 +- .../docs/AdditionalPropertiesAnyType.md | 13 + .../docs/AdditionalPropertiesArray.md | 13 + .../docs/AdditionalPropertiesBoolean.md | 13 + .../docs/AdditionalPropertiesClass.md | 19 +- .../docs/AdditionalPropertiesInteger.md | 13 + .../docs/AdditionalPropertiesNumber.md | 13 + .../docs/AdditionalPropertiesObject.md | 13 + .../docs/AdditionalPropertiesString.md | 13 + .../docs/Animal.md | 6 +- .../docs/AnotherFakeApi.md | 48 +- .../docs/ApiResponse.md | 8 +- .../docs/ArrayOfArrayOfNumberOnly.md | 8 +- .../docs/ArrayOfNumberOnly.md | 8 +- .../docs/ArrayTest.md | 8 +- .../docs/Capitalization.md | 6 +- .../OpenAPIClientNetCoreProject/docs/Cat.md | 8 +- .../docs/CatAllOf.md | 13 + .../docs/Category.md | 10 +- .../docs/ClassModel.md | 6 +- .../OpenAPIClientNetCoreProject/docs/Dog.md | 6 +- .../docs/DogAllOf.md | 13 + .../docs/EnumArrays.md | 6 +- .../docs/EnumClass.md | 6 +- .../docs/EnumTest.md | 10 +- .../docs/FakeApi.md | 672 ++++++++--- .../docs/FakeClassnameTags123Api.md | 40 +- .../OpenAPIClientNetCoreProject/docs/File.md | 13 + .../docs/FileSchemaTestClass.md | 14 + .../docs/FormatTest.md | 24 +- .../docs/HasOnlyReadOnly.md | 6 +- .../OpenAPIClientNetCoreProject/docs/List.md | 6 +- .../docs/MapTest.md | 8 +- ...dPropertiesAndAdditionalPropertiesClass.md | 10 +- .../docs/Model200Response.md | 8 +- .../docs/ModelClient.md | 6 +- .../OpenAPIClientNetCoreProject/docs/Name.md | 12 +- .../docs/NumberOnly.md | 8 +- .../OpenAPIClientNetCoreProject/docs/Order.md | 16 +- .../docs/OuterComposite.md | 10 +- .../docs/OuterEnum.md | 6 +- .../OpenAPIClientNetCoreProject/docs/Pet.md | 8 +- .../docs/PetApi.md | 398 +++++-- .../docs/ReadOnlyFirst.md | 6 +- .../docs/Return.md | 8 +- .../docs/SpecialModelName.md | 8 +- .../docs/StoreApi.md | 152 ++- .../OpenAPIClientNetCoreProject/docs/Tag.md | 8 +- .../docs/TypeHolderDefault.md | 17 + .../docs/TypeHolderExample.md | 17 + .../OpenAPIClientNetCoreProject/docs/User.md | 10 +- .../docs/UserApi.md | 293 +++-- .../docs/XmlItem.md | 41 + .../Org.OpenAPITools/Api/AnotherFakeApi.cs | 97 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 1022 +++++++++++++---- .../Api/FakeClassnameTags123Api.cs | 77 +- .../src/Org.OpenAPITools/Api/PetApi.cs | 444 +++++-- .../src/Org.OpenAPITools/Api/StoreApi.cs | 149 +-- .../src/Org.OpenAPITools/Api/UserApi.cs | 285 ++--- .../src/Org.OpenAPITools/Client/ApiClient.cs | 2 +- .../Org.OpenAPITools/Client/ApiException.cs | 2 +- .../Org.OpenAPITools/Client/ApiResponse.cs | 2 +- .../Org.OpenAPITools/Client/Configuration.cs | 4 +- .../Client/ExceptionFactory.cs | 2 +- .../Client/GlobalConfiguration.cs | 2 +- .../Org.OpenAPITools/Client/IApiAccessor.cs | 2 +- .../Client/IReadableConfiguration.cs | 2 +- .../Client/OpenAPIDateConverter.cs | 2 +- .../Model/AdditionalPropertiesAnyType.cs | 113 ++ .../Model/AdditionalPropertiesArray.cs | 113 ++ .../Model/AdditionalPropertiesBoolean.cs | 113 ++ .../Model/AdditionalPropertiesClass.cs | 200 +++- .../Model/AdditionalPropertiesInteger.cs | 113 ++ .../Model/AdditionalPropertiesNumber.cs | 113 ++ .../Model/AdditionalPropertiesObject.cs | 113 ++ .../Model/AdditionalPropertiesString.cs | 113 ++ .../src/Org.OpenAPITools/Model/Animal.cs | 5 +- .../src/Org.OpenAPITools/Model/ApiResponse.cs | 6 +- .../Model/ArrayOfArrayOfNumberOnly.cs | 7 +- .../Model/ArrayOfNumberOnly.cs | 7 +- .../src/Org.OpenAPITools/Model/ArrayTest.cs | 9 +- .../Org.OpenAPITools/Model/Capitalization.cs | 2 +- .../src/Org.OpenAPITools/Model/Cat.cs | 6 +- .../src/Org.OpenAPITools/Model/CatAllOf.cs | 112 ++ .../src/Org.OpenAPITools/Model/Category.cs | 24 +- .../src/Org.OpenAPITools/Model/ClassModel.cs | 2 +- .../src/Org.OpenAPITools/Model/Dog.cs | 2 +- .../src/Org.OpenAPITools/Model/DogAllOf.cs | 112 ++ .../src/Org.OpenAPITools/Model/EnumArrays.cs | 11 +- .../src/Org.OpenAPITools/Model/EnumClass.cs | 8 +- .../src/Org.OpenAPITools/Model/EnumTest.cs | 27 +- .../src/Org.OpenAPITools/Model/File.cs | 113 ++ .../Model/FileSchemaTestClass.cs | 129 +++ .../src/Org.OpenAPITools/Model/FormatTest.cs | 26 +- .../Org.OpenAPITools/Model/HasOnlyReadOnly.cs | 2 +- .../src/Org.OpenAPITools/Model/List.cs | 2 +- .../src/Org.OpenAPITools/Model/MapTest.cs | 44 +- ...dPropertiesAndAdditionalPropertiesClass.cs | 9 +- .../Model/Model200Response.cs | 6 +- .../src/Org.OpenAPITools/Model/ModelClient.cs | 2 +- .../src/Org.OpenAPITools/Model/Name.cs | 11 +- .../src/Org.OpenAPITools/Model/NumberOnly.cs | 6 +- .../src/Org.OpenAPITools/Model/Order.cs | 20 +- .../Org.OpenAPITools/Model/OuterComposite.cs | 8 +- .../src/Org.OpenAPITools/Model/OuterEnum.cs | 8 +- .../src/Org.OpenAPITools/Model/Pet.cs | 16 +- .../Org.OpenAPITools/Model/ReadOnlyFirst.cs | 2 +- .../src/Org.OpenAPITools/Model/Return.cs | 6 +- .../Model/SpecialModelName.cs | 6 +- .../src/Org.OpenAPITools/Model/Tag.cs | 6 +- .../Model/TypeHolderDefault.cs | 227 ++++ .../Model/TypeHolderExample.cs | 227 ++++ .../src/Org.OpenAPITools/Model/User.cs | 8 +- .../src/Org.OpenAPITools/Model/XmlItem.cs | 569 +++++++++ .../.openapi-generator/VERSION | 2 +- .../csharp/OpenAPIClientNetStandard/README.md | 11 +- .../docs/AdditionalPropertiesClass.md | 8 +- .../docs/AnotherFakeApi.md | 16 +- .../docs/ApiResponse.md | 2 +- .../docs/ArrayOfArrayOfNumberOnly.md | 2 +- .../docs/ArrayOfNumberOnly.md | 2 +- .../docs/ArrayTest.md | 2 +- .../OpenAPIClientNetStandard/docs/Cat.md | 2 +- .../OpenAPIClientNetStandard/docs/CatAllOf.md | 2 +- .../OpenAPIClientNetStandard/docs/Category.md | 2 +- .../OpenAPIClientNetStandard/docs/EnumTest.md | 4 +- .../OpenAPIClientNetStandard/docs/FakeApi.md | 300 +++-- .../docs/FakeClassnameTags123Api.md | 16 +- .../docs/FormatTest.md | 18 +- .../OpenAPIClientNetStandard/docs/MapTest.md | 4 +- ...dPropertiesAndAdditionalPropertiesClass.md | 4 +- .../docs/Model200Response.md | 2 +- .../OpenAPIClientNetStandard/docs/Name.md | 6 +- .../docs/NumberOnly.md | 2 +- .../OpenAPIClientNetStandard/docs/Order.md | 10 +- .../docs/OuterComposite.md | 4 +- .../OpenAPIClientNetStandard/docs/Pet.md | 2 +- .../OpenAPIClientNetStandard/docs/PetApi.md | 195 +++- .../OpenAPIClientNetStandard/docs/Return.md | 2 +- .../docs/SpecialModelName.md | 2 +- .../OpenAPIClientNetStandard/docs/StoreApi.md | 80 +- .../OpenAPIClientNetStandard/docs/Tag.md | 2 +- .../docs/TypeHolderDefault.md | 8 +- .../docs/TypeHolderExample.md | 8 +- .../OpenAPIClientNetStandard/docs/User.md | 4 +- .../OpenAPIClientNetStandard/docs/UserApi.md | 137 ++- .../OpenAPIClientNetStandard/docs/XmlItem.md | 48 +- .../Org.OpenAPITools/Api/AnotherFakeApi.cs | 2 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 170 +-- .../Api/FakeClassnameTags123Api.cs | 2 +- .../src/Org.OpenAPITools/Api/PetApi.cs | 84 +- .../src/Org.OpenAPITools/Api/StoreApi.cs | 62 +- .../src/Org.OpenAPITools/Api/UserApi.cs | 4 +- .../Model/AdditionalPropertiesBoolean.cs | 2 +- .../Model/AdditionalPropertiesClass.cs | 10 +- .../Model/AdditionalPropertiesInteger.cs | 2 +- .../Model/AdditionalPropertiesNumber.cs | 2 +- .../src/Org.OpenAPITools/Model/ApiResponse.cs | 4 +- .../Model/ArrayOfArrayOfNumberOnly.cs | 4 +- .../Model/ArrayOfNumberOnly.cs | 4 +- .../src/Org.OpenAPITools/Model/ArrayTest.cs | 4 +- .../src/Org.OpenAPITools/Model/Cat.cs | 4 +- .../src/Org.OpenAPITools/Model/CatAllOf.cs | 4 +- .../src/Org.OpenAPITools/Model/Category.cs | 4 +- .../src/Org.OpenAPITools/Model/FormatTest.cs | 20 +- .../src/Org.OpenAPITools/Model/MapTest.cs | 6 +- ...dPropertiesAndAdditionalPropertiesClass.cs | 6 +- .../Model/Model200Response.cs | 4 +- .../src/Org.OpenAPITools/Model/Name.cs | 8 +- .../src/Org.OpenAPITools/Model/NumberOnly.cs | 4 +- .../src/Org.OpenAPITools/Model/Order.cs | 12 +- .../Org.OpenAPITools/Model/OuterComposite.cs | 6 +- .../src/Org.OpenAPITools/Model/Pet.cs | 4 +- .../src/Org.OpenAPITools/Model/Return.cs | 4 +- .../Model/SpecialModelName.cs | 4 +- .../src/Org.OpenAPITools/Model/Tag.cs | 4 +- .../Model/TypeHolderDefault.cs | 10 +- .../Model/TypeHolderExample.cs | 10 +- .../src/Org.OpenAPITools/Model/User.cs | 6 +- .../src/Org.OpenAPITools/Model/XmlItem.cs | 50 +- .../.openapi-generator/VERSION | 2 +- .../README.md | 11 +- .../docs/AdditionalPropertiesClass.md | 8 +- .../docs/AnotherFakeApi.md | 16 +- .../docs/ApiResponse.md | 2 +- .../docs/ArrayOfArrayOfNumberOnly.md | 2 +- .../docs/ArrayOfNumberOnly.md | 2 +- .../docs/ArrayTest.md | 2 +- .../docs/Cat.md | 2 +- .../docs/CatAllOf.md | 2 +- .../docs/Category.md | 2 +- .../docs/EnumTest.md | 4 +- .../docs/FakeApi.md | 300 +++-- .../docs/FakeClassnameTags123Api.md | 16 +- .../docs/FormatTest.md | 18 +- .../docs/MapTest.md | 4 +- ...dPropertiesAndAdditionalPropertiesClass.md | 4 +- .../docs/Model200Response.md | 2 +- .../docs/Name.md | 6 +- .../docs/NumberOnly.md | 2 +- .../docs/Order.md | 10 +- .../docs/OuterComposite.md | 4 +- .../docs/Pet.md | 2 +- .../docs/PetApi.md | 195 +++- .../docs/Return.md | 2 +- .../docs/SpecialModelName.md | 2 +- .../docs/StoreApi.md | 80 +- .../docs/Tag.md | 2 +- .../docs/TypeHolderDefault.md | 8 +- .../docs/TypeHolderExample.md | 8 +- .../docs/User.md | 4 +- .../docs/UserApi.md | 137 ++- .../docs/XmlItem.md | 48 +- .../Org.OpenAPITools/Api/AnotherFakeApi.cs | 2 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 170 +-- .../Api/FakeClassnameTags123Api.cs | 2 +- .../src/Org.OpenAPITools/Api/PetApi.cs | 84 +- .../src/Org.OpenAPITools/Api/StoreApi.cs | 62 +- .../src/Org.OpenAPITools/Api/UserApi.cs | 4 +- .../Model/AdditionalPropertiesBoolean.cs | 2 +- .../Model/AdditionalPropertiesClass.cs | 10 +- .../Model/AdditionalPropertiesInteger.cs | 2 +- .../Model/AdditionalPropertiesNumber.cs | 2 +- .../src/Org.OpenAPITools/Model/ApiResponse.cs | 4 +- .../Model/ArrayOfArrayOfNumberOnly.cs | 4 +- .../Model/ArrayOfNumberOnly.cs | 4 +- .../src/Org.OpenAPITools/Model/ArrayTest.cs | 4 +- .../src/Org.OpenAPITools/Model/Cat.cs | 4 +- .../src/Org.OpenAPITools/Model/CatAllOf.cs | 4 +- .../src/Org.OpenAPITools/Model/Category.cs | 4 +- .../src/Org.OpenAPITools/Model/FormatTest.cs | 60 +- .../src/Org.OpenAPITools/Model/MapTest.cs | 6 +- ...dPropertiesAndAdditionalPropertiesClass.cs | 6 +- .../Model/Model200Response.cs | 4 +- .../src/Org.OpenAPITools/Model/Name.cs | 8 +- .../src/Org.OpenAPITools/Model/NumberOnly.cs | 4 +- .../src/Org.OpenAPITools/Model/Order.cs | 12 +- .../Org.OpenAPITools/Model/OuterComposite.cs | 6 +- .../src/Org.OpenAPITools/Model/Pet.cs | 4 +- .../src/Org.OpenAPITools/Model/Return.cs | 4 +- .../Model/SpecialModelName.cs | 4 +- .../src/Org.OpenAPITools/Model/Tag.cs | 4 +- .../Model/TypeHolderDefault.cs | 10 +- .../Model/TypeHolderExample.cs | 10 +- .../src/Org.OpenAPITools/Model/User.cs | 6 +- .../src/Org.OpenAPITools/Model/XmlItem.cs | 50 +- 451 files changed, 9700 insertions(+), 3839 deletions(-) create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesAnyType.md create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesArray.md create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesBoolean.md create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesInteger.md create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesNumber.md create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesObject.md create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesString.md create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/CatAllOf.md create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/DogAllOf.md create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/File.md create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FileSchemaTestClass.md create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/TypeHolderDefault.md create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/TypeHolderExample.md create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/XmlItem.md create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesAnyType.cs create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesArray.cs create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesObject.cs create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesString.cs create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/CatAllOf.cs create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/DogAllOf.cs create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/File.cs create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/TypeHolderDefault.cs create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/TypeHolderExample.cs create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/XmlItem.cs diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java index fb4a9c861b8..912b172fcd0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java @@ -160,6 +160,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co "Int64", "Float", "Guid?", + "Guid", "System.IO.Stream", // not really a primitive, we include it to avoid model import "Object") ); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java index ae3ed7e12da..d7d1f3e6da4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java @@ -22,6 +22,7 @@ import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.parser.util.SchemaTypeUtil; import org.openapitools.codegen.*; +import org.openapitools.codegen.utils.ModelUtils; import org.openapitools.codegen.utils.URLPathUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -353,7 +354,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen { supportingFiles.add(new SupportingFile("Filters" + File.separator + "GeneratePathParamsValidationFilter.mustache", packageFolder + File.separator + "Filters", "GeneratePathParamsValidationFilter.cs")); } - + supportingFiles.add(new SupportingFile("Authentication" + File.separator + "ApiAuthentication.mustache",packageFolder + File.separator + "Authentication", "ApiAuthentication.cs")); } @@ -407,12 +408,12 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen { @Override public String getNullableType(Schema p, String type) { - boolean isNullableExpected = p.getNullable() == null || (p.getNullable() != null && p.getNullable()); - - if (isNullableExpected && languageSpecificPrimitives.contains(type + "?")) { - return type + "?"; - } else if (languageSpecificPrimitives.contains(type)) { - return type; + if (languageSpecificPrimitives.contains(type)) { + if (isSupportNullable() && ModelUtils.isNullable(p) && nullableType.contains(type)) { + return type + "?"; + } else { + return type; + } } else { return null; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java index 8ef2fde34a2..6617dbe14cd 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java @@ -879,15 +879,15 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { return null; } } - + @Override public String getNullableType(Schema p, String type) { - boolean isNullableExpected = p.getNullable() == null || (p.getNullable() != null && p.getNullable()); - - if (isNullableExpected && languageSpecificPrimitives.contains(type + "?")) { - return type + "?"; - } else if (languageSpecificPrimitives.contains(type)) { - return type; + if (languageSpecificPrimitives.contains(type)) { + if (isSupportNullable() && ModelUtils.isNullable(p) && nullableType.contains(type)) { + return type + "?"; + } else { + return type; + } } else { return null; } diff --git a/modules/openapi-generator/src/main/resources/csharp/api.mustache b/modules/openapi-generator/src/main/resources/csharp/api.mustache index f3f3f7e578d..9e68b292591 100644 --- a/modules/openapi-generator/src/main/resources/csharp/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/api.mustache @@ -32,7 +32,7 @@ namespace {{packageName}}.{{apiPackage}} /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} - {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); /// /// {{summary}} @@ -43,7 +43,7 @@ namespace {{packageName}}.{{apiPackage}} /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}}/// ApiResponse of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object(void){{/returnType}} - ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); {{/operation}} #endregion Synchronous Operations {{#supportsAsync}} @@ -58,7 +58,7 @@ namespace {{packageName}}.{{apiPackage}} /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}}/// Task of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} - {{#returnType}}System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + {{#returnType}}System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); /// /// {{summary}} @@ -69,7 +69,7 @@ namespace {{packageName}}.{{apiPackage}} /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}}/// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} - System.Threading.Tasks.Task> {{operationId}}AsyncWithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + System.Threading.Tasks.Task> {{operationId}}AsyncWithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); {{/operation}} #endregion Asynchronous Operations {{/supportsAsync}} @@ -190,7 +190,7 @@ namespace {{packageName}}.{{apiPackage}} /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} - public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { {{#returnType}}ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{/returnType}} @@ -202,7 +202,7 @@ namespace {{packageName}}.{{apiPackage}} /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}}/// ApiResponse of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object(void){{/returnType}} - public ApiResponse<{{#returnType}} {{{returnType}}} {{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + public ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { {{#allParams}} {{#required}} @@ -325,7 +325,7 @@ namespace {{packageName}}.{{apiPackage}} /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}}/// Task of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} - {{#returnType}}public async System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + {{#returnType}}public async System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { {{#returnType}}ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}AsyncWithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}AsyncWithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{/returnType}} @@ -338,7 +338,7 @@ namespace {{packageName}}.{{apiPackage}} /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}}/// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} - public async System.Threading.Tasks.Task> {{operationId}}AsyncWithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + public async System.Threading.Tasks.Task> {{operationId}}AsyncWithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { {{#allParams}} {{#required}} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CSharpModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CSharpModelTest.java index 7134fe37978..91600d2ac10 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CSharpModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CSharpModelTest.java @@ -141,10 +141,10 @@ public class CSharpModelTest { final CodegenProperty property1 = cm.vars.get(0); Assert.assertEquals(property1.baseName, "id"); - Assert.assertEquals(property1.dataType, "long?"); + Assert.assertEquals(property1.dataType, "long"); Assert.assertEquals(property1.name, "Id"); Assert.assertNull(property1.defaultValue); - Assert.assertEquals(property1.baseType, "long?"); + Assert.assertEquals(property1.baseType, "long"); Assert.assertTrue(property1.hasMore); Assert.assertTrue(property1.required); Assert.assertTrue(property1.isPrimitiveType); @@ -161,10 +161,10 @@ public class CSharpModelTest { final CodegenProperty property3 = cm.vars.get(2); Assert.assertEquals(property3.baseName, "createdAt"); - Assert.assertEquals(property3.dataType, "DateTime?"); + Assert.assertEquals(property3.dataType, "DateTime"); Assert.assertEquals(property3.name, "CreatedAt"); Assert.assertNull(property3.defaultValue); - Assert.assertEquals(property3.baseType, "DateTime?"); + Assert.assertEquals(property3.baseType, "DateTime"); Assert.assertFalse(property3.hasMore); Assert.assertFalse(property3.required); } @@ -209,7 +209,59 @@ public class CSharpModelTest { Assert.assertFalse(property2.required); Assert.assertTrue(property2.isPrimitiveType); Assert.assertTrue(property2.isContainer); - + + final CodegenProperty property3 = cm.vars.get(2); + Assert.assertEquals(property3.baseName, "name"); + Assert.assertEquals(property3.dataType, "string"); + Assert.assertEquals(property3.name, "Name"); + Assert.assertNull(property3.defaultValue); + Assert.assertEquals(property3.baseType, "string"); + Assert.assertFalse(property3.hasMore); + Assert.assertFalse(property3.required); + Assert.assertTrue(property3.isPrimitiveType); + } + + @Test(description = "convert a model with a nullable property") + public void nullablePropertyTest() { + final Schema model = new Schema() + .description("a sample model") + .addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT).nullable(true)) + .addProperties("urls", new ArraySchema() + .items(new StringSchema())) + .addProperties("name", new StringSchema().nullable(true)) + .addRequiredItem("id"); + final DefaultCodegen codegen = new CSharpClientCodegen(); + OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); + codegen.setOpenAPI(openAPI); + final CodegenModel cm = codegen.fromModel("sample", model); + + Assert.assertEquals(cm.name, "sample"); + Assert.assertEquals(cm.classname, "Sample"); + Assert.assertEquals(cm.description, "a sample model"); + Assert.assertEquals(cm.vars.size(), 3); + + final CodegenProperty property1 = cm.vars.get(0); + Assert.assertEquals(property1.baseName, "id"); + Assert.assertEquals(property1.dataType, "long?"); + Assert.assertEquals(property1.name, "Id"); + Assert.assertNull(property1.defaultValue); + Assert.assertEquals(property1.baseType, "long?"); + Assert.assertTrue(property1.hasMore); + Assert.assertTrue(property1.required); + Assert.assertTrue(property1.isPrimitiveType); + + final CodegenProperty property2 = cm.vars.get(1); + Assert.assertEquals(property2.baseName, "urls"); + Assert.assertEquals(property2.dataType, "List"); + Assert.assertEquals(property2.name, "Urls"); + Assert.assertNull(property2.defaultValue); + Assert.assertEquals(property2.baseType, "List"); + Assert.assertTrue(property2.hasMore); + Assert.assertEquals(property2.containerType, "array"); + Assert.assertFalse(property2.required); + Assert.assertTrue(property2.isPrimitiveType); + Assert.assertTrue(property2.isContainer); + final CodegenProperty property3 = cm.vars.get(2); Assert.assertEquals(property3.baseName, "name"); Assert.assertEquals(property3.dataType, "string"); @@ -241,10 +293,10 @@ public class CSharpModelTest { final CodegenProperty property1 = cm.vars.get(0); Assert.assertEquals(property1.baseName, "id"); - Assert.assertEquals(property1.dataType, "long?"); + Assert.assertEquals(property1.dataType, "long"); Assert.assertEquals(property1.name, "Id"); Assert.assertNull(property1.defaultValue); - Assert.assertEquals(property1.baseType, "long?"); + Assert.assertEquals(property1.baseType, "long"); Assert.assertTrue(property1.hasMore); Assert.assertTrue(property1.required); Assert.assertTrue(property1.isPrimitiveType); diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/VERSION b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/VERSION index afa63656064..83a328a9227 100644 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/UserApi.md b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/UserApi.md index 75a3595de6c..b9909cad575 100644 --- a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/UserApi.md +++ b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/docs/UserApi.md @@ -117,7 +117,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List**](List.md)| List of user object | + **body** | [**List**](User.md)| List of user object | ### Return type @@ -176,7 +176,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List**](List.md)| List of user object | + **body** | [**List**](User.md)| List of user object | ### Return type diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FormatTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FormatTest.md index 909ceff242c..b3a80c42620 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FormatTest.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FormatTest.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes **Binary** | **System.IO.Stream** | | [optional] **Date** | **DateTime** | | **DateTime** | **DateTime** | | [optional] -**Uuid** | [**Guid**](Guid.md) | | [optional] +**Uuid** | **Guid** | | [optional] **Password** | **string** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md index f1d3323922e..9aa858ade8d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -3,7 +3,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Uuid** | [**Guid**](Guid.md) | | [optional] +**Uuid** | **Guid** | | [optional] **DateTime** | **DateTime** | | [optional] **Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FormatTest.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FormatTest.md index 909ceff242c..b3a80c42620 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FormatTest.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FormatTest.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes **Binary** | **System.IO.Stream** | | [optional] **Date** | **DateTime** | | **DateTime** | **DateTime** | | [optional] -**Uuid** | [**Guid**](Guid.md) | | [optional] +**Uuid** | **Guid** | | [optional] **Password** | **string** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/MixedPropertiesAndAdditionalPropertiesClass.md index f1d3323922e..9aa858ade8d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -3,7 +3,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Uuid** | [**Guid**](Guid.md) | | [optional] +**Uuid** | **Guid** | | [optional] **DateTime** | **DateTime** | | [optional] **Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/AdditionalPropertiesClass.md b/samples/client/petstore/csharp/OpenAPIClient/docs/AdditionalPropertiesClass.md index 32d7ffc7653..d07f57619d5 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/AdditionalPropertiesClass.md @@ -6,10 +6,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **MapString** | **Dictionary<string, string>** | | [optional] -**MapNumber** | **Dictionary<string, decimal?>** | | [optional] -**MapInteger** | **Dictionary<string, int?>** | | [optional] -**MapBoolean** | **Dictionary<string, bool?>** | | [optional] -**MapArrayInteger** | **Dictionary<string, List<int?>>** | | [optional] +**MapNumber** | **Dictionary<string, decimal>** | | [optional] +**MapInteger** | **Dictionary<string, int>** | | [optional] +**MapBoolean** | **Dictionary<string, bool>** | | [optional] +**MapArrayInteger** | **Dictionary<string, List<int>>** | | [optional] **MapArrayAnytype** | **Dictionary<string, List<Object>>** | | [optional] **MapMapString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] **MapMapAnytype** | **Dictionary<string, Dictionary<string, Object>>** | | [optional] diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/ApiResponse.md b/samples/client/petstore/csharp/OpenAPIClient/docs/ApiResponse.md index e16dea75cc2..a3b916355fd 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/ApiResponse.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/ApiResponse.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Code** | **int?** | | [optional] +**Code** | **int** | | [optional] **Type** | **string** | | [optional] **Message** | **string** | | [optional] diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/csharp/OpenAPIClient/docs/ArrayOfArrayOfNumberOnly.md index 12616c6718b..e05ea7dc240 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/ArrayOfArrayOfNumberOnly.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ArrayArrayNumber** | **List<List<decimal?>>** | | [optional] +**ArrayArrayNumber** | **List<List<decimal>>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/ArrayOfNumberOnly.md b/samples/client/petstore/csharp/OpenAPIClient/docs/ArrayOfNumberOnly.md index 04facf7d5d1..5f593d42929 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/ArrayOfNumberOnly.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ArrayNumber** | **List<decimal?>** | | [optional] +**ArrayNumber** | **List<decimal>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/ArrayTest.md b/samples/client/petstore/csharp/OpenAPIClient/docs/ArrayTest.md index 9c297f062a9..593bc2d7386 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/ArrayTest.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/ArrayTest.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ArrayOfString** | **List<string>** | | [optional] -**ArrayArrayOfInteger** | **List<List<long?>>** | | [optional] +**ArrayArrayOfInteger** | **List<List<long>>** | | [optional] **ArrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/Cat.md b/samples/client/petstore/csharp/OpenAPIClient/docs/Cat.md index 4545a124369..6609de8e12a 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/Cat.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/Cat.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ClassName** | **string** | | **Color** | **string** | | [optional] [default to "red"] -**Declawed** | **bool?** | | [optional] +**Declawed** | **bool** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/CatAllOf.md b/samples/client/petstore/csharp/OpenAPIClient/docs/CatAllOf.md index 1a630760455..d623d2a0a6e 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/CatAllOf.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/CatAllOf.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Declawed** | **bool?** | | [optional] +**Declawed** | **bool** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/Category.md b/samples/client/petstore/csharp/OpenAPIClient/docs/Category.md index 87ad855ca6f..42102d4e508 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/Category.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/Category.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Name** | **string** | | [default to "default-name"] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/EnumTest.md b/samples/client/petstore/csharp/OpenAPIClient/docs/EnumTest.md index 8e213c3335f..f8bc67baa6a 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/EnumTest.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/EnumTest.md @@ -7,8 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **EnumString** | **string** | | [optional] **EnumStringRequired** | **string** | | -**EnumInteger** | **int?** | | [optional] -**EnumNumber** | **double?** | | [optional] +**EnumInteger** | **int** | | [optional] +**EnumNumber** | **double** | | [optional] **OuterEnum** | **OuterEnum** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md index 8a53b02b5e1..2738b9e1853 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/FakeApi.md @@ -96,7 +96,7 @@ No authorization required ## FakeOuterBooleanSerialize -> bool? FakeOuterBooleanSerialize (bool? body = null) +> bool FakeOuterBooleanSerialize (bool body = null) @@ -119,11 +119,11 @@ namespace Example { Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(Configuration.Default); - var body = true; // bool? | Input boolean as post body (optional) + var body = true; // bool | Input boolean as post body (optional) try { - bool? result = apiInstance.FakeOuterBooleanSerialize(body); + bool result = apiInstance.FakeOuterBooleanSerialize(body); Debug.WriteLine(result); } catch (ApiException e) @@ -142,11 +142,11 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **bool?**| Input boolean as post body | [optional] + **body** | **bool**| Input boolean as post body | [optional] ### Return type -**bool?** +**bool** ### Authorization @@ -244,7 +244,7 @@ No authorization required ## FakeOuterNumberSerialize -> decimal? FakeOuterNumberSerialize (decimal? body = null) +> decimal FakeOuterNumberSerialize (decimal body = null) @@ -267,11 +267,11 @@ namespace Example { Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(Configuration.Default); - var body = 8.14; // decimal? | Input number as post body (optional) + var body = 8.14; // decimal | Input number as post body (optional) try { - decimal? result = apiInstance.FakeOuterNumberSerialize(body); + decimal result = apiInstance.FakeOuterNumberSerialize(body); Debug.WriteLine(result); } catch (ApiException e) @@ -290,11 +290,11 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **decimal?**| Input number as post body | [optional] + **body** | **decimal**| Input number as post body | [optional] ### Return type -**decimal?** +**decimal** ### Authorization @@ -613,7 +613,7 @@ No authorization required ## TestEndpointParameters -> void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) +> void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = null, int int32 = null, long int64 = null, float _float = null, string _string = null, System.IO.Stream binary = null, DateTime date = null, DateTime dateTime = null, string password = null, string callback = null) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -640,18 +640,18 @@ namespace Example Configuration.Default.Password = "YOUR_PASSWORD"; var apiInstance = new FakeApi(Configuration.Default); - var number = 8.14; // decimal? | None - var _double = 1.2D; // double? | None + var number = 8.14; // decimal | None + var _double = 1.2D; // double | None var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None var _byte = BYTE_ARRAY_DATA_HERE; // byte[] | None - var integer = 56; // int? | None (optional) - var int32 = 56; // int? | None (optional) - var int64 = 789; // long? | None (optional) - var _float = 3.4F; // float? | None (optional) + var integer = 56; // int | None (optional) + var int32 = 56; // int | None (optional) + var int64 = 789; // long | None (optional) + var _float = 3.4F; // float | None (optional) var _string = _string_example; // string | None (optional) var binary = BINARY_DATA_HERE; // System.IO.Stream | None (optional) - var date = 2013-10-20; // DateTime? | None (optional) - var dateTime = 2013-10-20T19:20:30+01:00; // DateTime? | None (optional) + var date = 2013-10-20; // DateTime | None (optional) + var dateTime = 2013-10-20T19:20:30+01:00; // DateTime | None (optional) var password = password_example; // string | None (optional) var callback = callback_example; // string | None (optional) @@ -676,18 +676,18 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **number** | **decimal?**| None | - **_double** | **double?**| None | + **number** | **decimal**| None | + **_double** | **double**| None | **patternWithoutDelimiter** | **string**| None | **_byte** | **byte[]**| None | - **integer** | **int?**| None | [optional] - **int32** | **int?**| None | [optional] - **int64** | **long?**| None | [optional] - **_float** | **float?**| None | [optional] + **integer** | **int**| None | [optional] + **int32** | **int**| None | [optional] + **int64** | **long**| None | [optional] + **_float** | **float**| None | [optional] **_string** | **string**| None | [optional] **binary** | **System.IO.Stream**| None | [optional] - **date** | **DateTime?**| None | [optional] - **dateTime** | **DateTime?**| None | [optional] + **date** | **DateTime**| None | [optional] + **dateTime** | **DateTime**| None | [optional] **password** | **string**| None | [optional] **callback** | **string**| None | [optional] @@ -718,7 +718,7 @@ void (empty response body) ## TestEnumParameters -> void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) +> void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int enumQueryInteger = null, double enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) To test enum parameters @@ -745,8 +745,8 @@ namespace Example var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg) var enumQueryStringArray = enumQueryStringArray_example; // List | Query parameter enum test (string array) (optional) var enumQueryString = enumQueryString_example; // string | Query parameter enum test (string) (optional) (default to -efg) - var enumQueryInteger = 56; // int? | Query parameter enum test (double) (optional) - var enumQueryDouble = 1.2D; // double? | Query parameter enum test (double) (optional) + var enumQueryInteger = 56; // int | Query parameter enum test (double) (optional) + var enumQueryDouble = 1.2D; // double | Query parameter enum test (double) (optional) var enumFormStringArray = new List(); // List | Form parameter enum test (string array) (optional) (default to $) var enumFormString = enumFormString_example; // string | Form parameter enum test (string) (optional) (default to -efg) @@ -775,8 +775,8 @@ Name | Type | Description | Notes **enumHeaderString** | **string**| Header parameter enum test (string) | [optional] [default to -efg] **enumQueryStringArray** | **List<string>**| Query parameter enum test (string array) | [optional] **enumQueryString** | **string**| Query parameter enum test (string) | [optional] [default to -efg] - **enumQueryInteger** | **int?**| Query parameter enum test (double) | [optional] - **enumQueryDouble** | **double?**| Query parameter enum test (double) | [optional] + **enumQueryInteger** | **int**| Query parameter enum test (double) | [optional] + **enumQueryDouble** | **double**| Query parameter enum test (double) | [optional] **enumFormStringArray** | [**List<string>**](string.md)| Form parameter enum test (string array) | [optional] [default to $] **enumFormString** | **string**| Form parameter enum test (string) | [optional] [default to -efg] @@ -807,7 +807,7 @@ No authorization required ## TestGroupParameters -> void TestGroupParameters (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) +> void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = null, bool booleanGroup = null, long int64Group = null) Fake endpoint to test group parameters (optional) @@ -830,12 +830,12 @@ namespace Example { Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(Configuration.Default); - var requiredStringGroup = 56; // int? | Required String in group parameters - var requiredBooleanGroup = true; // bool? | Required Boolean in group parameters - var requiredInt64Group = 789; // long? | Required Integer in group parameters - var stringGroup = 56; // int? | String in group parameters (optional) - var booleanGroup = true; // bool? | Boolean in group parameters (optional) - var int64Group = 789; // long? | Integer in group parameters (optional) + var requiredStringGroup = 56; // int | Required String in group parameters + var requiredBooleanGroup = true; // bool | Required Boolean in group parameters + var requiredInt64Group = 789; // long | Required Integer in group parameters + var stringGroup = 56; // int | String in group parameters (optional) + var booleanGroup = true; // bool | Boolean in group parameters (optional) + var int64Group = 789; // long | Integer in group parameters (optional) try { @@ -858,12 +858,12 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **requiredStringGroup** | **int?**| Required String in group parameters | - **requiredBooleanGroup** | **bool?**| Required Boolean in group parameters | - **requiredInt64Group** | **long?**| Required Integer in group parameters | - **stringGroup** | **int?**| String in group parameters | [optional] - **booleanGroup** | **bool?**| Boolean in group parameters | [optional] - **int64Group** | **long?**| Integer in group parameters | [optional] + **requiredStringGroup** | **int**| Required String in group parameters | + **requiredBooleanGroup** | **bool**| Required Boolean in group parameters | + **requiredInt64Group** | **long**| Required Integer in group parameters | + **stringGroup** | **int**| String in group parameters | [optional] + **booleanGroup** | **bool**| Boolean in group parameters | [optional] + **int64Group** | **long**| Integer in group parameters | [optional] ### Return type diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/FormatTest.md b/samples/client/petstore/csharp/OpenAPIClient/docs/FormatTest.md index 519e940a7c8..0d921285ba1 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/FormatTest.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/FormatTest.md @@ -5,18 +5,18 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Integer** | **int?** | | [optional] -**Int32** | **int?** | | [optional] -**Int64** | **long?** | | [optional] -**Number** | **decimal?** | | -**Float** | **float?** | | [optional] -**Double** | **double?** | | [optional] +**Integer** | **int** | | [optional] +**Int32** | **int** | | [optional] +**Int64** | **long** | | [optional] +**Number** | **decimal** | | +**Float** | **float** | | [optional] +**Double** | **double** | | [optional] **String** | **string** | | [optional] **Byte** | **byte[]** | | **Binary** | **System.IO.Stream** | | [optional] -**Date** | **DateTime?** | | -**DateTime** | **DateTime?** | | [optional] -**Uuid** | **Guid?** | | [optional] +**Date** | **DateTime** | | +**DateTime** | **DateTime** | | [optional] +**Uuid** | **Guid** | | [optional] **Password** | **string** | | [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/MapTest.md b/samples/client/petstore/csharp/OpenAPIClient/docs/MapTest.md index 89be5aa12cf..79d499e2cf9 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/MapTest.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/MapTest.md @@ -7,8 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **MapMapOfString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] **MapOfEnumString** | **Dictionary<string, string>** | | [optional] -**DirectMap** | **Dictionary<string, bool?>** | | [optional] -**IndirectMap** | **Dictionary<string, bool?>** | | [optional] +**DirectMap** | **Dictionary<string, bool>** | | [optional] +**IndirectMap** | **Dictionary<string, bool>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp/OpenAPIClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 323933588de..dd7b01e49fe 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Uuid** | **Guid?** | | [optional] -**DateTime** | **DateTime?** | | [optional] +**Uuid** | **Guid** | | [optional] +**DateTime** | **DateTime** | | [optional] **Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/Model200Response.md b/samples/client/petstore/csharp/OpenAPIClient/docs/Model200Response.md index 59918913107..7d826bca1ec 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/Model200Response.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/Model200Response.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **int?** | | [optional] +**Name** | **int** | | [optional] **Class** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/Name.md b/samples/client/petstore/csharp/OpenAPIClient/docs/Name.md index 80d0a9f31f3..77b9b2e7501 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/Name.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/Name.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Name** | **int?** | | -**SnakeCase** | **int?** | | [optional] +**_Name** | **int** | | +**SnakeCase** | **int** | | [optional] **Property** | **string** | | [optional] -**_123Number** | **int?** | | [optional] +**_123Number** | **int** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/NumberOnly.md b/samples/client/petstore/csharp/OpenAPIClient/docs/NumberOnly.md index 8fd05997a93..e4b08467e08 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/NumberOnly.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/NumberOnly.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**JustNumber** | **decimal?** | | [optional] +**JustNumber** | **decimal** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/Order.md b/samples/client/petstore/csharp/OpenAPIClient/docs/Order.md index f28ee2ad006..875f43a30e5 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/Order.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/Order.md @@ -5,12 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] -**PetId** | **long?** | | [optional] -**Quantity** | **int?** | | [optional] -**ShipDate** | **DateTime?** | | [optional] +**Id** | **long** | | [optional] +**PetId** | **long** | | [optional] +**Quantity** | **int** | | [optional] +**ShipDate** | **DateTime** | | [optional] **Status** | **string** | Order Status | [optional] -**Complete** | **bool?** | | [optional] [default to false] +**Complete** | **bool** | | [optional] [default to false] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/OuterComposite.md b/samples/client/petstore/csharp/OpenAPIClient/docs/OuterComposite.md index e371f712633..f381fb7fd28 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/OuterComposite.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/OuterComposite.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MyNumber** | **decimal?** | | [optional] +**MyNumber** | **decimal** | | [optional] **MyString** | **string** | | [optional] -**MyBoolean** | **bool?** | | [optional] +**MyBoolean** | **bool** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/Pet.md b/samples/client/petstore/csharp/OpenAPIClient/docs/Pet.md index 51022249270..0bd5c40fc99 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/Pet.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/Pet.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Category** | [**Category**](Category.md) | | [optional] **Name** | **string** | | **PhotoUrls** | **List<string>** | | diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/PetApi.md b/samples/client/petstore/csharp/OpenAPIClient/docs/PetApi.md index c45dd7854a7..1a9eba14868 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/PetApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/PetApi.md @@ -94,7 +94,7 @@ void (empty response body) ## DeletePet -> void DeletePet (long? petId, string apiKey = null) +> void DeletePet (long petId, string apiKey = null) Deletes a pet @@ -118,7 +118,7 @@ namespace Example Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(Configuration.Default); - var petId = 789; // long? | Pet id to delete + var petId = 789; // long | Pet id to delete var apiKey = apiKey_example; // string | (optional) try @@ -142,7 +142,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| Pet id to delete | + **petId** | **long**| Pet id to delete | **apiKey** | **string**| | [optional] ### Return type @@ -330,7 +330,7 @@ Name | Type | Description | Notes ## GetPetById -> Pet GetPetById (long? petId) +> Pet GetPetById (long petId) Find pet by ID @@ -358,7 +358,7 @@ namespace Example // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); var apiInstance = new PetApi(Configuration.Default); - var petId = 789; // long? | ID of pet to return + var petId = 789; // long | ID of pet to return try { @@ -382,7 +382,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to return | + **petId** | **long**| ID of pet to return | ### Return type @@ -490,7 +490,7 @@ void (empty response body) ## UpdatePetWithForm -> void UpdatePetWithForm (long? petId, string name = null, string status = null) +> void UpdatePetWithForm (long petId, string name = null, string status = null) Updates a pet in the store with form data @@ -514,7 +514,7 @@ namespace Example Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(Configuration.Default); - var petId = 789; // long? | ID of pet that needs to be updated + var petId = 789; // long | ID of pet that needs to be updated var name = name_example; // string | Updated name of the pet (optional) var status = status_example; // string | Updated status of the pet (optional) @@ -539,7 +539,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet that needs to be updated | + **petId** | **long**| ID of pet that needs to be updated | **name** | **string**| Updated name of the pet | [optional] **status** | **string**| Updated status of the pet | [optional] @@ -569,7 +569,7 @@ void (empty response body) ## UploadFile -> ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null) +> ApiResponse UploadFile (long petId, string additionalMetadata = null, System.IO.Stream file = null) uploads an image @@ -593,7 +593,7 @@ namespace Example Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(Configuration.Default); - var petId = 789; // long? | ID of pet to update + var petId = 789; // long | ID of pet to update var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) var file = BINARY_DATA_HERE; // System.IO.Stream | file to upload (optional) @@ -619,7 +619,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to update | + **petId** | **long**| ID of pet to update | **additionalMetadata** | **string**| Additional data to pass to server | [optional] **file** | **System.IO.Stream**| file to upload | [optional] @@ -649,7 +649,7 @@ Name | Type | Description | Notes ## UploadFileWithRequiredFile -> ApiResponse UploadFileWithRequiredFile (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) +> ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string additionalMetadata = null) uploads an image (required) @@ -673,7 +673,7 @@ namespace Example Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(Configuration.Default); - var petId = 789; // long? | ID of pet to update + var petId = 789; // long | ID of pet to update var requiredFile = BINARY_DATA_HERE; // System.IO.Stream | file to upload var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) @@ -699,7 +699,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to update | + **petId** | **long**| ID of pet to update | **requiredFile** | **System.IO.Stream**| file to upload | **additionalMetadata** | **string**| Additional data to pass to server | [optional] diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/Return.md b/samples/client/petstore/csharp/OpenAPIClient/docs/Return.md index 65481f45cf2..4761c70748e 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/Return.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/Return.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Return** | **int?** | | [optional] +**_Return** | **int** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/SpecialModelName.md b/samples/client/petstore/csharp/OpenAPIClient/docs/SpecialModelName.md index c1154219ccc..ee6489524d0 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/SpecialModelName.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/SpecialModelName.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SpecialPropertyName** | **long?** | | [optional] +**SpecialPropertyName** | **long** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/StoreApi.md b/samples/client/petstore/csharp/OpenAPIClient/docs/StoreApi.md index b4dc72258a0..57247772d4f 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/StoreApi.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/StoreApi.md @@ -88,7 +88,7 @@ No authorization required ## GetInventory -> Dictionary<string, int?> GetInventory () +> Dictionary<string, int> GetInventory () Returns pet inventories by status @@ -120,7 +120,7 @@ namespace Example try { // Returns pet inventories by status - Dictionary result = apiInstance.GetInventory(); + Dictionary result = apiInstance.GetInventory(); Debug.WriteLine(result); } catch (ApiException e) @@ -140,7 +140,7 @@ This endpoint does not need any parameter. ### Return type -**Dictionary** +**Dictionary** ### Authorization @@ -164,7 +164,7 @@ This endpoint does not need any parameter. ## GetOrderById -> Order GetOrderById (long? orderId) +> Order GetOrderById (long orderId) Find purchase order by ID @@ -187,7 +187,7 @@ namespace Example { Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new StoreApi(Configuration.Default); - var orderId = 789; // long? | ID of pet that needs to be fetched + var orderId = 789; // long | ID of pet that needs to be fetched try { @@ -211,7 +211,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **long?**| ID of pet that needs to be fetched | + **orderId** | **long**| ID of pet that needs to be fetched | ### Return type diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/Tag.md b/samples/client/petstore/csharp/OpenAPIClient/docs/Tag.md index 864cac0c8d3..f781c26f017 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/Tag.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/Tag.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Name** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/TypeHolderDefault.md b/samples/client/petstore/csharp/OpenAPIClient/docs/TypeHolderDefault.md index d336f567ab2..0945245b213 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/TypeHolderDefault.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/TypeHolderDefault.md @@ -6,10 +6,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **StringItem** | **string** | | [default to "what"] -**NumberItem** | **decimal?** | | -**IntegerItem** | **int?** | | -**BoolItem** | **bool?** | | [default to true] -**ArrayItem** | **List<int?>** | | +**NumberItem** | **decimal** | | +**IntegerItem** | **int** | | +**BoolItem** | **bool** | | [default to true] +**ArrayItem** | **List<int>** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/TypeHolderExample.md b/samples/client/petstore/csharp/OpenAPIClient/docs/TypeHolderExample.md index 8f9ec66939e..e92681b8cba 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/TypeHolderExample.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/TypeHolderExample.md @@ -6,10 +6,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **StringItem** | **string** | | -**NumberItem** | **decimal?** | | -**IntegerItem** | **int?** | | -**BoolItem** | **bool?** | | -**ArrayItem** | **List<int?>** | | +**NumberItem** | **decimal** | | +**IntegerItem** | **int** | | +**BoolItem** | **bool** | | +**ArrayItem** | **List<int>** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/User.md b/samples/client/petstore/csharp/OpenAPIClient/docs/User.md index 6faa1df688d..a25c25d1aa0 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/User.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/User.md @@ -5,14 +5,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Username** | **string** | | [optional] **FirstName** | **string** | | [optional] **LastName** | **string** | | [optional] **Email** | **string** | | [optional] **Password** | **string** | | [optional] **Phone** | **string** | | [optional] -**UserStatus** | **int?** | User Status | [optional] +**UserStatus** | **int** | User Status | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClient/docs/XmlItem.md b/samples/client/petstore/csharp/OpenAPIClient/docs/XmlItem.md index e96ea4b0de6..0dca90c706f 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/docs/XmlItem.md +++ b/samples/client/petstore/csharp/OpenAPIClient/docs/XmlItem.md @@ -6,34 +6,34 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **AttributeString** | **string** | | [optional] -**AttributeNumber** | **decimal?** | | [optional] -**AttributeInteger** | **int?** | | [optional] -**AttributeBoolean** | **bool?** | | [optional] -**WrappedArray** | **List<int?>** | | [optional] +**AttributeNumber** | **decimal** | | [optional] +**AttributeInteger** | **int** | | [optional] +**AttributeBoolean** | **bool** | | [optional] +**WrappedArray** | **List<int>** | | [optional] **NameString** | **string** | | [optional] -**NameNumber** | **decimal?** | | [optional] -**NameInteger** | **int?** | | [optional] -**NameBoolean** | **bool?** | | [optional] -**NameArray** | **List<int?>** | | [optional] -**NameWrappedArray** | **List<int?>** | | [optional] +**NameNumber** | **decimal** | | [optional] +**NameInteger** | **int** | | [optional] +**NameBoolean** | **bool** | | [optional] +**NameArray** | **List<int>** | | [optional] +**NameWrappedArray** | **List<int>** | | [optional] **PrefixString** | **string** | | [optional] -**PrefixNumber** | **decimal?** | | [optional] -**PrefixInteger** | **int?** | | [optional] -**PrefixBoolean** | **bool?** | | [optional] -**PrefixArray** | **List<int?>** | | [optional] -**PrefixWrappedArray** | **List<int?>** | | [optional] +**PrefixNumber** | **decimal** | | [optional] +**PrefixInteger** | **int** | | [optional] +**PrefixBoolean** | **bool** | | [optional] +**PrefixArray** | **List<int>** | | [optional] +**PrefixWrappedArray** | **List<int>** | | [optional] **NamespaceString** | **string** | | [optional] -**NamespaceNumber** | **decimal?** | | [optional] -**NamespaceInteger** | **int?** | | [optional] -**NamespaceBoolean** | **bool?** | | [optional] -**NamespaceArray** | **List<int?>** | | [optional] -**NamespaceWrappedArray** | **List<int?>** | | [optional] +**NamespaceNumber** | **decimal** | | [optional] +**NamespaceInteger** | **int** | | [optional] +**NamespaceBoolean** | **bool** | | [optional] +**NamespaceArray** | **List<int>** | | [optional] +**NamespaceWrappedArray** | **List<int>** | | [optional] **PrefixNsString** | **string** | | [optional] -**PrefixNsNumber** | **decimal?** | | [optional] -**PrefixNsInteger** | **int?** | | [optional] -**PrefixNsBoolean** | **bool?** | | [optional] -**PrefixNsArray** | **List<int?>** | | [optional] -**PrefixNsWrappedArray** | **List<int?>** | | [optional] +**PrefixNsNumber** | **decimal** | | [optional] +**PrefixNsInteger** | **int** | | [optional] +**PrefixNsBoolean** | **bool** | | [optional] +**PrefixNsArray** | **List<int>** | | [optional] +**PrefixNsWrappedArray** | **List<int>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 91ad0c3c299..142c089e706 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -197,7 +197,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > Call123TestSpecialTagsWithHttpInfo (ModelClient body) + public ApiResponse Call123TestSpecialTagsWithHttpInfo (ModelClient body) { // verify the required parameter 'body' is set if (body == null) diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs index e9fbcf1cca8..b352cdd30cf 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs @@ -53,8 +53,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// bool? - bool? FakeOuterBooleanSerialize (bool? body = null); + /// bool + bool FakeOuterBooleanSerialize (bool body = default(bool)); /// /// @@ -64,8 +64,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// ApiResponse of bool? - ApiResponse FakeOuterBooleanSerializeWithHttpInfo (bool? body = null); + /// ApiResponse of bool + ApiResponse FakeOuterBooleanSerializeWithHttpInfo (bool body = default(bool)); /// /// /// @@ -75,7 +75,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// OuterComposite - OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null); + OuterComposite FakeOuterCompositeSerialize (OuterComposite body = default(OuterComposite)); /// /// @@ -86,7 +86,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// ApiResponse of OuterComposite - ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null); + ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = default(OuterComposite)); /// /// /// @@ -95,8 +95,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// decimal? - decimal? FakeOuterNumberSerialize (decimal? body = null); + /// decimal + decimal FakeOuterNumberSerialize (decimal body = default(decimal)); /// /// @@ -106,8 +106,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// ApiResponse of decimal? - ApiResponse FakeOuterNumberSerializeWithHttpInfo (decimal? body = null); + /// ApiResponse of decimal + ApiResponse FakeOuterNumberSerializeWithHttpInfo (decimal body = default(decimal)); /// /// /// @@ -117,7 +117,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// string - string FakeOuterStringSerialize (string body = null); + string FakeOuterStringSerialize (string body = default(string)); /// /// @@ -128,7 +128,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// ApiResponse of string - ApiResponse FakeOuterStringSerializeWithHttpInfo (string body = null); + ApiResponse FakeOuterStringSerializeWithHttpInfo (string body = default(string)); /// /// /// @@ -216,7 +216,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// - void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -240,7 +240,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// ApiResponse of Object(void) - ApiResponse TestEndpointParametersWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + ApiResponse TestEndpointParametersWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)); /// /// To test enum parameters /// @@ -257,7 +257,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// - void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); + void TestEnumParameters (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)); /// /// To test enum parameters @@ -275,7 +275,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// ApiResponse of Object(void) - ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); + ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)); /// /// Fake endpoint to test group parameters (optional) /// @@ -290,7 +290,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// - void TestGroupParameters (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)); /// /// Fake endpoint to test group parameters (optional) @@ -306,7 +306,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// ApiResponse of Object(void) - ApiResponse TestGroupParametersWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + ApiResponse TestGroupParametersWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)); /// /// test inline additionalProperties /// @@ -382,8 +382,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of bool? - System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = null); + /// Task of bool + System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool body = default(bool)); /// /// @@ -393,8 +393,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of ApiResponse (bool?) - System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = null); + /// Task of ApiResponse (bool) + System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool body = default(bool)); /// /// /// @@ -404,7 +404,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// Task of OuterComposite - System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null); + System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = default(OuterComposite)); /// /// @@ -415,7 +415,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// Task of ApiResponse (OuterComposite) - System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null); + System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = default(OuterComposite)); /// /// /// @@ -424,8 +424,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of decimal? - System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = null); + /// Task of decimal + System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal body = default(decimal)); /// /// @@ -435,8 +435,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of ApiResponse (decimal?) - System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = null); + /// Task of ApiResponse (decimal) + System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal body = default(decimal)); /// /// /// @@ -446,7 +446,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// Task of string - System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = null); + System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = default(string)); /// /// @@ -457,7 +457,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// Task of ApiResponse (string) - System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = null); + System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = default(string)); /// /// /// @@ -545,7 +545,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// Task of void - System.Threading.Tasks.Task TestEndpointParametersAsync (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -569,7 +569,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// Task of ApiResponse - System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)); /// /// To test enum parameters /// @@ -586,7 +586,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// Task of void - System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); + System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)); /// /// To test enum parameters @@ -604,7 +604,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// Task of ApiResponse - System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); + System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)); /// /// Fake endpoint to test group parameters (optional) /// @@ -619,7 +619,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// Task of void - System.Threading.Tasks.Task TestGroupParametersAsync (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + System.Threading.Tasks.Task TestGroupParametersAsync (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)); /// /// Fake endpoint to test group parameters (optional) @@ -635,7 +635,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// Task of ApiResponse - System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)); /// /// test inline additionalProperties /// @@ -951,10 +951,10 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// bool? - public bool? FakeOuterBooleanSerialize (bool? body = null) + /// bool + public bool FakeOuterBooleanSerialize (bool body = default(bool)) { - ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -963,8 +963,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// ApiResponse of bool? - public ApiResponse< bool? > FakeOuterBooleanSerializeWithHttpInfo (bool? body = null) + /// ApiResponse of bool + public ApiResponse FakeOuterBooleanSerializeWithHttpInfo (bool body = default(bool)) { var localVarPath = "/fake/outer/boolean"; @@ -1011,9 +1011,9 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (bool?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool?))); + (bool) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool))); } /// @@ -1021,10 +1021,10 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of bool? - public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = null) + /// Task of bool + public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool body = default(bool)) { - ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -1034,8 +1034,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of ApiResponse (bool?) - public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = null) + /// Task of ApiResponse (bool) + public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool body = default(bool)) { var localVarPath = "/fake/outer/boolean"; @@ -1082,9 +1082,9 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (bool?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool?))); + (bool) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool))); } /// @@ -1093,7 +1093,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// OuterComposite - public OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) + public OuterComposite FakeOuterCompositeSerialize (OuterComposite body = default(OuterComposite)) { ApiResponse localVarResponse = FakeOuterCompositeSerializeWithHttpInfo(body); return localVarResponse.Data; @@ -1105,7 +1105,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// ApiResponse of OuterComposite - public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null) + public ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = default(OuterComposite)) { var localVarPath = "/fake/outer/composite"; @@ -1163,7 +1163,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// Task of OuterComposite - public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null) + public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = default(OuterComposite)) { ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; @@ -1176,7 +1176,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// Task of ApiResponse (OuterComposite) - public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null) + public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = default(OuterComposite)) { var localVarPath = "/fake/outer/composite"; @@ -1233,10 +1233,10 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// decimal? - public decimal? FakeOuterNumberSerialize (decimal? body = null) + /// decimal + public decimal FakeOuterNumberSerialize (decimal body = default(decimal)) { - ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -1245,8 +1245,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// ApiResponse of decimal? - public ApiResponse< decimal? > FakeOuterNumberSerializeWithHttpInfo (decimal? body = null) + /// ApiResponse of decimal + public ApiResponse FakeOuterNumberSerializeWithHttpInfo (decimal body = default(decimal)) { var localVarPath = "/fake/outer/number"; @@ -1293,9 +1293,9 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (decimal?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal?))); + (decimal) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal))); } /// @@ -1303,10 +1303,10 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of decimal? - public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = null) + /// Task of decimal + public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal body = default(decimal)) { - ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -1316,8 +1316,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of ApiResponse (decimal?) - public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = null) + /// Task of ApiResponse (decimal) + public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal body = default(decimal)) { var localVarPath = "/fake/outer/number"; @@ -1364,9 +1364,9 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (decimal?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal?))); + (decimal) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal))); } /// @@ -1375,7 +1375,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// string - public string FakeOuterStringSerialize (string body = null) + public string FakeOuterStringSerialize (string body = default(string)) { ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); return localVarResponse.Data; @@ -1387,7 +1387,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// ApiResponse of string - public ApiResponse< string > FakeOuterStringSerializeWithHttpInfo (string body = null) + public ApiResponse FakeOuterStringSerializeWithHttpInfo (string body = default(string)) { var localVarPath = "/fake/outer/string"; @@ -1445,7 +1445,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// Task of string - public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = null) + public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = default(string)) { ApiResponse localVarResponse = await FakeOuterStringSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; @@ -1458,7 +1458,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// Task of ApiResponse (string) - public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = null) + public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = default(string)) { var localVarPath = "/fake/outer/string"; @@ -1830,7 +1830,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient body) + public ApiResponse TestClientModelWithHttpInfo (ModelClient body) { // verify the required parameter 'body' is set if (body == null) @@ -1980,7 +1980,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// - public void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + public void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)) { TestEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); } @@ -2004,7 +2004,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// ApiResponse of Object(void) - public ApiResponse TestEndpointParametersWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + public ApiResponse TestEndpointParametersWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)) { // verify the required parameter 'number' is set if (number == null) @@ -2099,7 +2099,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// Task of void - public async System.Threading.Tasks.Task TestEndpointParametersAsync (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + public async System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)) { await TestEndpointParametersAsyncWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); @@ -2124,7 +2124,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + public async System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)) { // verify the required parameter 'number' is set if (number == null) @@ -2213,7 +2213,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// - public void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) + public void TestEnumParameters (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)) { TestEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } @@ -2231,7 +2231,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// ApiResponse of Object(void) - public ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) + public ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)) { var localVarPath = "/fake"; @@ -2296,7 +2296,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// Task of void - public async System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) + public async System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)) { await TestEnumParametersAsyncWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); @@ -2315,7 +2315,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) + public async System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)) { var localVarPath = "/fake"; @@ -2378,7 +2378,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// - public void TestGroupParameters (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + public void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)) { TestGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } @@ -2394,7 +2394,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// ApiResponse of Object(void) - public ApiResponse TestGroupParametersWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + public ApiResponse TestGroupParametersWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)) { // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup == null) @@ -2463,7 +2463,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// Task of void - public async System.Threading.Tasks.Task TestGroupParametersAsync (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + public async System.Threading.Tasks.Task TestGroupParametersAsync (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)) { await TestGroupParametersAsyncWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); @@ -2480,7 +2480,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + public async System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)) { // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup == null) diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 34496dfc87d..ed259e8ef95 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -197,7 +197,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient body) + public ApiResponse TestClassnameWithHttpInfo (ModelClient body) { // verify the required parameter 'body' is set if (body == null) diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs index e5abf7996ed..2b83ede5ea2 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs @@ -55,7 +55,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// - void DeletePet (long? petId, string apiKey = null); + void DeletePet (long petId, string apiKey = default(string)); /// /// Deletes a pet @@ -67,7 +67,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// ApiResponse of Object(void) - ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = null); + ApiResponse DeletePetWithHttpInfo (long petId, string apiKey = default(string)); /// /// Finds Pets by status /// @@ -119,7 +119,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Pet - Pet GetPetById (long? petId); + Pet GetPetById (long petId); /// /// Find pet by ID @@ -130,7 +130,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// ApiResponse of Pet - ApiResponse GetPetByIdWithHttpInfo (long? petId); + ApiResponse GetPetByIdWithHttpInfo (long petId); /// /// Update an existing pet /// @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// - void UpdatePetWithForm (long? petId, string name = null, string status = null); + void UpdatePetWithForm (long petId, string name = default(string), string status = default(string)); /// /// Updates a pet in the store with form data @@ -176,7 +176,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// ApiResponse of Object(void) - ApiResponse UpdatePetWithFormWithHttpInfo (long? petId, string name = null, string status = null); + ApiResponse UpdatePetWithFormWithHttpInfo (long petId, string name = default(string), string status = default(string)); /// /// uploads an image /// @@ -188,7 +188,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse - ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + ApiResponse UploadFile (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); /// /// uploads an image @@ -201,7 +201,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse of ApiResponse - ApiResponse UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + ApiResponse UploadFileWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); /// /// uploads an image (required) /// @@ -213,7 +213,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// ApiResponse - ApiResponse UploadFileWithRequiredFile (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null); + ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); /// /// uploads an image (required) @@ -226,7 +226,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// ApiResponse of ApiResponse - ApiResponse UploadFileWithRequiredFileWithHttpInfo (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null); + ApiResponse UploadFileWithRequiredFileWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -260,7 +260,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// Task of void - System.Threading.Tasks.Task DeletePetAsync (long? petId, string apiKey = null); + System.Threading.Tasks.Task DeletePetAsync (long petId, string apiKey = default(string)); /// /// Deletes a pet @@ -272,7 +272,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// Task of ApiResponse - System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long? petId, string apiKey = null); + System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string)); /// /// Finds Pets by status /// @@ -324,7 +324,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Task of Pet - System.Threading.Tasks.Task GetPetByIdAsync (long? petId); + System.Threading.Tasks.Task GetPetByIdAsync (long petId); /// /// Find pet by ID @@ -335,7 +335,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Task of ApiResponse (Pet) - System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long? petId); + System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId); /// /// Update an existing pet /// @@ -368,7 +368,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// Task of void - System.Threading.Tasks.Task UpdatePetWithFormAsync (long? petId, string name = null, string status = null); + System.Threading.Tasks.Task UpdatePetWithFormAsync (long petId, string name = default(string), string status = default(string)); /// /// Updates a pet in the store with form data @@ -381,7 +381,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// Task of ApiResponse - System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long? petId, string name = null, string status = null); + System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string)); /// /// uploads an image /// @@ -393,7 +393,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// Task of ApiResponse - System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + System.Threading.Tasks.Task UploadFileAsync (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); /// /// uploads an image @@ -406,7 +406,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// Task of ApiResponse (ApiResponse) - System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); /// /// uploads an image (required) /// @@ -418,7 +418,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// Task of ApiResponse - System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null); + System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); /// /// uploads an image (required) @@ -431,7 +431,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// Task of ApiResponse (ApiResponse) - System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null); + System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); #endregion Asynchronous Operations } @@ -709,7 +709,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// - public void DeletePet (long? petId, string apiKey = null) + public void DeletePet (long petId, string apiKey = default(string)) { DeletePetWithHttpInfo(petId, apiKey); } @@ -721,7 +721,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// ApiResponse of Object(void) - public ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = null) + public ApiResponse DeletePetWithHttpInfo (long petId, string apiKey = default(string)) { // verify the required parameter 'petId' is set if (petId == null) @@ -782,7 +782,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// Task of void - public async System.Threading.Tasks.Task DeletePetAsync (long? petId, string apiKey = null) + public async System.Threading.Tasks.Task DeletePetAsync (long petId, string apiKey = default(string)) { await DeletePetAsyncWithHttpInfo(petId, apiKey); @@ -795,7 +795,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long? petId, string apiKey = null) + public async System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string)) { // verify the required parameter 'petId' is set if (petId == null) @@ -867,7 +867,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Status values that need to be considered for filter /// ApiResponse of List<Pet> - public ApiResponse< List > FindPetsByStatusWithHttpInfo (List status) + public ApiResponse> FindPetsByStatusWithHttpInfo (List status) { // verify the required parameter 'status' is set if (status == null) @@ -1014,7 +1014,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Tags to filter by /// ApiResponse of List<Pet> - public ApiResponse< List > FindPetsByTagsWithHttpInfo (List tags) + public ApiResponse> FindPetsByTagsWithHttpInfo (List tags) { // verify the required parameter 'tags' is set if (tags == null) @@ -1149,7 +1149,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Pet - public Pet GetPetById (long? petId) + public Pet GetPetById (long petId) { ApiResponse localVarResponse = GetPetByIdWithHttpInfo(petId); return localVarResponse.Data; @@ -1161,7 +1161,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// ApiResponse of Pet - public ApiResponse< Pet > GetPetByIdWithHttpInfo (long? petId) + public ApiResponse GetPetByIdWithHttpInfo (long petId) { // verify the required parameter 'petId' is set if (petId == null) @@ -1221,7 +1221,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Task of Pet - public async System.Threading.Tasks.Task GetPetByIdAsync (long? petId) + public async System.Threading.Tasks.Task GetPetByIdAsync (long petId) { ApiResponse localVarResponse = await GetPetByIdAsyncWithHttpInfo(petId); return localVarResponse.Data; @@ -1234,7 +1234,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Task of ApiResponse (Pet) - public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long? petId) + public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId) { // verify the required parameter 'petId' is set if (petId == null) @@ -1455,7 +1455,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// - public void UpdatePetWithForm (long? petId, string name = null, string status = null) + public void UpdatePetWithForm (long petId, string name = default(string), string status = default(string)) { UpdatePetWithFormWithHttpInfo(petId, name, status); } @@ -1468,7 +1468,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// ApiResponse of Object(void) - public ApiResponse UpdatePetWithFormWithHttpInfo (long? petId, string name = null, string status = null) + public ApiResponse UpdatePetWithFormWithHttpInfo (long petId, string name = default(string), string status = default(string)) { // verify the required parameter 'petId' is set if (petId == null) @@ -1532,7 +1532,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// Task of void - public async System.Threading.Tasks.Task UpdatePetWithFormAsync (long? petId, string name = null, string status = null) + public async System.Threading.Tasks.Task UpdatePetWithFormAsync (long petId, string name = default(string), string status = default(string)) { await UpdatePetWithFormAsyncWithHttpInfo(petId, name, status); @@ -1546,7 +1546,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long? petId, string name = null, string status = null) + public async System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string)) { // verify the required parameter 'petId' is set if (petId == null) @@ -1610,7 +1610,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse - public ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public ApiResponse UploadFile (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) { ApiResponse localVarResponse = UploadFileWithHttpInfo(petId, additionalMetadata, file); return localVarResponse.Data; @@ -1624,7 +1624,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse of ApiResponse - public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public ApiResponse UploadFileWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) { // verify the required parameter 'petId' is set if (petId == null) @@ -1689,7 +1689,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public async System.Threading.Tasks.Task UploadFileAsync (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) { ApiResponse localVarResponse = await UploadFileAsyncWithHttpInfo(petId, additionalMetadata, file); return localVarResponse.Data; @@ -1704,7 +1704,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// Task of ApiResponse (ApiResponse) - public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) { // verify the required parameter 'petId' is set if (petId == null) @@ -1769,7 +1769,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// ApiResponse - public ApiResponse UploadFileWithRequiredFile (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) + public ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) { ApiResponse localVarResponse = UploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata); return localVarResponse.Data; @@ -1783,7 +1783,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// ApiResponse of ApiResponse - public ApiResponse< ApiResponse > UploadFileWithRequiredFileWithHttpInfo (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) + public ApiResponse UploadFileWithRequiredFileWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) { // verify the required parameter 'petId' is set if (petId == null) @@ -1851,7 +1851,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) + public async System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) { ApiResponse localVarResponse = await UploadFileWithRequiredFileAsyncWithHttpInfo(petId, requiredFile, additionalMetadata); return localVarResponse.Data; @@ -1866,7 +1866,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// Task of ApiResponse (ApiResponse) - public async System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) + public async System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) { // verify the required parameter 'petId' is set if (petId == null) diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs index 418c5708547..18a1678b259 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs @@ -52,8 +52,8 @@ namespace Org.OpenAPITools.Api /// Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Dictionary<string, int?> - Dictionary GetInventory (); + /// Dictionary<string, int> + Dictionary GetInventory (); /// /// Returns pet inventories by status @@ -62,8 +62,8 @@ namespace Org.OpenAPITools.Api /// Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// ApiResponse of Dictionary<string, int?> - ApiResponse> GetInventoryWithHttpInfo (); + /// ApiResponse of Dictionary<string, int> + ApiResponse> GetInventoryWithHttpInfo (); /// /// Find purchase order by ID /// @@ -73,7 +73,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Order - Order GetOrderById (long? orderId); + Order GetOrderById (long orderId); /// /// Find purchase order by ID @@ -84,7 +84,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// ApiResponse of Order - ApiResponse GetOrderByIdWithHttpInfo (long? orderId); + ApiResponse GetOrderByIdWithHttpInfo (long orderId); /// /// Place an order for a pet /// @@ -136,8 +136,8 @@ namespace Org.OpenAPITools.Api /// Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Task of Dictionary<string, int?> - System.Threading.Tasks.Task> GetInventoryAsync (); + /// Task of Dictionary<string, int> + System.Threading.Tasks.Task> GetInventoryAsync (); /// /// Returns pet inventories by status @@ -146,8 +146,8 @@ namespace Org.OpenAPITools.Api /// Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Task of ApiResponse (Dictionary<string, int?>) - System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (); + /// Task of ApiResponse (Dictionary<string, int>) + System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (); /// /// Find purchase order by ID /// @@ -157,7 +157,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Task of Order - System.Threading.Tasks.Task GetOrderByIdAsync (long? orderId); + System.Threading.Tasks.Task GetOrderByIdAsync (long orderId); /// /// Find purchase order by ID @@ -168,7 +168,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Task of ApiResponse (Order) - System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long? orderId); + System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId); /// /// Place an order for a pet /// @@ -434,10 +434,10 @@ namespace Org.OpenAPITools.Api /// Returns pet inventories by status Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Dictionary<string, int?> - public Dictionary GetInventory () + /// Dictionary<string, int> + public Dictionary GetInventory () { - ApiResponse> localVarResponse = GetInventoryWithHttpInfo(); + ApiResponse> localVarResponse = GetInventoryWithHttpInfo(); return localVarResponse.Data; } @@ -445,8 +445,8 @@ namespace Org.OpenAPITools.Api /// Returns pet inventories by status Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// ApiResponse of Dictionary<string, int?> - public ApiResponse< Dictionary > GetInventoryWithHttpInfo () + /// ApiResponse of Dictionary<string, int> + public ApiResponse> GetInventoryWithHttpInfo () { var localVarPath = "/store/inventory"; @@ -490,19 +490,19 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse>(localVarStatusCode, + return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); + (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); } /// /// Returns pet inventories by status Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Task of Dictionary<string, int?> - public async System.Threading.Tasks.Task> GetInventoryAsync () + /// Task of Dictionary<string, int> + public async System.Threading.Tasks.Task> GetInventoryAsync () { - ApiResponse> localVarResponse = await GetInventoryAsyncWithHttpInfo(); + ApiResponse> localVarResponse = await GetInventoryAsyncWithHttpInfo(); return localVarResponse.Data; } @@ -511,8 +511,8 @@ namespace Org.OpenAPITools.Api /// Returns pet inventories by status Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Task of ApiResponse (Dictionary<string, int?>) - public async System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo () + /// Task of ApiResponse (Dictionary<string, int>) + public async System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo () { var localVarPath = "/store/inventory"; @@ -556,9 +556,9 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse>(localVarStatusCode, + return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); + (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); } /// @@ -567,7 +567,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Order - public Order GetOrderById (long? orderId) + public Order GetOrderById (long orderId) { ApiResponse localVarResponse = GetOrderByIdWithHttpInfo(orderId); return localVarResponse.Data; @@ -579,7 +579,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// ApiResponse of Order - public ApiResponse< Order > GetOrderByIdWithHttpInfo (long? orderId) + public ApiResponse GetOrderByIdWithHttpInfo (long orderId) { // verify the required parameter 'orderId' is set if (orderId == null) @@ -634,7 +634,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Task of Order - public async System.Threading.Tasks.Task GetOrderByIdAsync (long? orderId) + public async System.Threading.Tasks.Task GetOrderByIdAsync (long orderId) { ApiResponse localVarResponse = await GetOrderByIdAsyncWithHttpInfo(orderId); return localVarResponse.Data; @@ -647,7 +647,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Task of ApiResponse (Order) - public async System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long? orderId) + public async System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId) { // verify the required parameter 'orderId' is set if (orderId == null) @@ -714,7 +714,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// order placed for purchasing the pet /// ApiResponse of Order - public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body) + public ApiResponse PlaceOrderWithHttpInfo (Order body) { // verify the required parameter 'body' is set if (body == null) diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs index e842bd87690..fa56bb06f5a 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs @@ -1053,7 +1053,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// The name that needs to be fetched. Use user1 for testing. /// ApiResponse of User - public ApiResponse< User > GetUserByNameWithHttpInfo (string username) + public ApiResponse GetUserByNameWithHttpInfo (string username) { // verify the required parameter 'username' is set if (username == null) @@ -1190,7 +1190,7 @@ namespace Org.OpenAPITools.Api /// The user name for login /// The password for login in clear text /// ApiResponse of string - public ApiResponse< string > LoginUserWithHttpInfo (string username, string password) + public ApiResponse LoginUserWithHttpInfo (string username, string password) { // verify the required parameter 'username' is set if (username == null) diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs index bb8bb6475e0..239289ffaba 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs @@ -28,7 +28,7 @@ namespace Org.OpenAPITools.Model /// AdditionalPropertiesBoolean /// [DataContract] - public partial class AdditionalPropertiesBoolean : Dictionary, IEquatable, IValidatableObject + public partial class AdditionalPropertiesBoolean : Dictionary, IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 661333e1276..8a4e6b78b30 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -44,7 +44,7 @@ namespace Org.OpenAPITools.Model /// anytype1. /// anytype2. /// anytype3. - public AdditionalPropertiesClass(Dictionary mapString = default(Dictionary), Dictionary mapNumber = default(Dictionary), Dictionary mapInteger = default(Dictionary), Dictionary mapBoolean = default(Dictionary), Dictionary> mapArrayInteger = default(Dictionary>), Dictionary> mapArrayAnytype = default(Dictionary>), Dictionary> mapMapString = default(Dictionary>), Dictionary> mapMapAnytype = default(Dictionary>), Object anytype1 = default(Object), Object anytype2 = default(Object), Object anytype3 = default(Object)) + public AdditionalPropertiesClass(Dictionary mapString = default(Dictionary), Dictionary mapNumber = default(Dictionary), Dictionary mapInteger = default(Dictionary), Dictionary mapBoolean = default(Dictionary), Dictionary> mapArrayInteger = default(Dictionary>), Dictionary> mapArrayAnytype = default(Dictionary>), Dictionary> mapMapString = default(Dictionary>), Dictionary> mapMapAnytype = default(Dictionary>), Object anytype1 = default(Object), Object anytype2 = default(Object), Object anytype3 = default(Object)) { this.MapString = mapString; this.MapNumber = mapNumber; @@ -69,25 +69,25 @@ namespace Org.OpenAPITools.Model /// Gets or Sets MapNumber /// [DataMember(Name="map_number", EmitDefaultValue=false)] - public Dictionary MapNumber { get; set; } + public Dictionary MapNumber { get; set; } /// /// Gets or Sets MapInteger /// [DataMember(Name="map_integer", EmitDefaultValue=false)] - public Dictionary MapInteger { get; set; } + public Dictionary MapInteger { get; set; } /// /// Gets or Sets MapBoolean /// [DataMember(Name="map_boolean", EmitDefaultValue=false)] - public Dictionary MapBoolean { get; set; } + public Dictionary MapBoolean { get; set; } /// /// Gets or Sets MapArrayInteger /// [DataMember(Name="map_array_integer", EmitDefaultValue=false)] - public Dictionary> MapArrayInteger { get; set; } + public Dictionary> MapArrayInteger { get; set; } /// /// Gets or Sets MapArrayAnytype diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs index dacca87d552..c714e994e26 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs @@ -28,7 +28,7 @@ namespace Org.OpenAPITools.Model /// AdditionalPropertiesInteger /// [DataContract] - public partial class AdditionalPropertiesInteger : Dictionary, IEquatable, IValidatableObject + public partial class AdditionalPropertiesInteger : Dictionary, IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs index 316ac1b811c..d727b2f68f1 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs @@ -28,7 +28,7 @@ namespace Org.OpenAPITools.Model /// AdditionalPropertiesNumber /// [DataContract] - public partial class AdditionalPropertiesNumber : Dictionary, IEquatable, IValidatableObject + public partial class AdditionalPropertiesNumber : Dictionary, IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ApiResponse.cs index ca5099c2e1a..8f5a5a0e5a9 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -36,7 +36,7 @@ namespace Org.OpenAPITools.Model /// code. /// type. /// message. - public ApiResponse(int? code = default(int?), string type = default(string), string message = default(string)) + public ApiResponse(int code = default(int), string type = default(string), string message = default(string)) { this.Code = code; this.Type = type; @@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Code /// [DataMember(Name="code", EmitDefaultValue=false)] - public int? Code { get; set; } + public int Code { get; set; } /// /// Gets or Sets Type diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 2ca48dc1b12..0342fb2ce66 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -34,7 +34,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// arrayArrayNumber. - public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber = default(List>)) + public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber = default(List>)) { this.ArrayArrayNumber = arrayArrayNumber; } @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets ArrayArrayNumber /// [DataMember(Name="ArrayArrayNumber", EmitDefaultValue=false)] - public List> ArrayArrayNumber { get; set; } + public List> ArrayArrayNumber { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 9b600f4a79b..1b87d630d20 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -34,7 +34,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// arrayNumber. - public ArrayOfNumberOnly(List arrayNumber = default(List)) + public ArrayOfNumberOnly(List arrayNumber = default(List)) { this.ArrayNumber = arrayNumber; } @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets ArrayNumber /// [DataMember(Name="ArrayNumber", EmitDefaultValue=false)] - public List ArrayNumber { get; set; } + public List ArrayNumber { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayTest.cs index 3738a4e4473..10886bb6af6 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -36,7 +36,7 @@ namespace Org.OpenAPITools.Model /// arrayOfString. /// arrayArrayOfInteger. /// arrayArrayOfModel. - public ArrayTest(List arrayOfString = default(List), List> arrayArrayOfInteger = default(List>), List> arrayArrayOfModel = default(List>)) + public ArrayTest(List arrayOfString = default(List), List> arrayArrayOfInteger = default(List>), List> arrayArrayOfModel = default(List>)) { this.ArrayOfString = arrayOfString; this.ArrayArrayOfInteger = arrayArrayOfInteger; @@ -53,7 +53,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets ArrayArrayOfInteger /// [DataMember(Name="array_array_of_integer", EmitDefaultValue=false)] - public List> ArrayArrayOfInteger { get; set; } + public List> ArrayArrayOfInteger { get; set; } /// /// Gets or Sets ArrayArrayOfModel diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs index 8dd338b3e59..1c28fb2755f 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs @@ -39,7 +39,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// declawed. - public Cat(bool? declawed = default(bool?), string className = default(string), string color = "red") : base(className, color) + public Cat(bool declawed = default(bool), string className = default(string), string color = "red") : base(className, color) { this.Declawed = declawed; } @@ -48,7 +48,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Declawed /// [DataMember(Name="declawed", EmitDefaultValue=false)] - public bool? Declawed { get; set; } + public bool Declawed { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/CatAllOf.cs index e17ff89769c..3d452f64b38 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/CatAllOf.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -34,7 +34,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// declawed. - public CatAllOf(bool? declawed = default(bool?)) + public CatAllOf(bool declawed = default(bool)) { this.Declawed = declawed; } @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Declawed /// [DataMember(Name="declawed", EmitDefaultValue=false)] - public bool? Declawed { get; set; } + public bool Declawed { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs index e8827551b57..9cf54d7ea34 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs @@ -40,7 +40,7 @@ namespace Org.OpenAPITools.Model /// /// id. /// name (required) (default to "default-name"). - public Category(long? id = default(long?), string name = "default-name") + public Category(long id = default(long), string name = "default-name") { // to ensure "name" is required (not null) if (name == null) @@ -59,7 +59,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Name diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs index 4fd444a4e1a..b8735b8587d 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs @@ -51,7 +51,7 @@ namespace Org.OpenAPITools.Model /// dateTime. /// uuid. /// password (required). - public FormatTest(int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), decimal? number = default(decimal?), float? _float = default(float?), double? _double = default(double?), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), Guid? uuid = default(Guid?), string password = default(string)) + public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string)) { // to ensure "number" is required (not null) if (number == null) @@ -108,37 +108,37 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Integer /// [DataMember(Name="integer", EmitDefaultValue=false)] - public int? Integer { get; set; } + public int Integer { get; set; } /// /// Gets or Sets Int32 /// [DataMember(Name="int32", EmitDefaultValue=false)] - public int? Int32 { get; set; } + public int Int32 { get; set; } /// /// Gets or Sets Int64 /// [DataMember(Name="int64", EmitDefaultValue=false)] - public long? Int64 { get; set; } + public long Int64 { get; set; } /// /// Gets or Sets Number /// [DataMember(Name="number", EmitDefaultValue=false)] - public decimal? Number { get; set; } + public decimal Number { get; set; } /// /// Gets or Sets Float /// [DataMember(Name="float", EmitDefaultValue=false)] - public float? Float { get; set; } + public float Float { get; set; } /// /// Gets or Sets Double /// [DataMember(Name="double", EmitDefaultValue=false)] - public double? Double { get; set; } + public double Double { get; set; } /// /// Gets or Sets String @@ -163,19 +163,19 @@ namespace Org.OpenAPITools.Model /// [DataMember(Name="date", EmitDefaultValue=false)] [JsonConverter(typeof(OpenAPIDateConverter))] - public DateTime? Date { get; set; } + public DateTime Date { get; set; } /// /// Gets or Sets DateTime /// [DataMember(Name="dateTime", EmitDefaultValue=false)] - public DateTime? DateTime { get; set; } + public DateTime DateTime { get; set; } /// /// Gets or Sets Uuid /// [DataMember(Name="uuid", EmitDefaultValue=false)] - public Guid? Uuid { get; set; } + public Guid Uuid { get; set; } /// /// Gets or Sets Password @@ -351,62 +351,62 @@ namespace Org.OpenAPITools.Model /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - // Integer (int?) maximum - if(this.Integer > (int?)100) + // Integer (int) maximum + if(this.Integer > (int)100) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); } - // Integer (int?) minimum - if(this.Integer < (int?)10) + // Integer (int) minimum + if(this.Integer < (int)10) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); } - // Int32 (int?) maximum - if(this.Int32 > (int?)200) + // Int32 (int) maximum + if(this.Int32 > (int)200) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); } - // Int32 (int?) minimum - if(this.Int32 < (int?)20) + // Int32 (int) minimum + if(this.Int32 < (int)20) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } - // Number (decimal?) maximum - if(this.Number > (decimal?)543.2) + // Number (decimal) maximum + if(this.Number > (decimal)543.2) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); } - // Number (decimal?) minimum - if(this.Number < (decimal?)32.1) + // Number (decimal) minimum + if(this.Number < (decimal)32.1) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); } - // Float (float?) maximum - if(this.Float > (float?)987.6) + // Float (float) maximum + if(this.Float > (float)987.6) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); } - // Float (float?) minimum - if(this.Float < (float?)54.3) + // Float (float) minimum + if(this.Float < (float)54.3) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); } - // Double (double?) maximum - if(this.Double > (double?)123.4) + // Double (double) maximum + if(this.Double > (double)123.4) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); } - // Double (double?) minimum - if(this.Double < (double?)67.8) + // Double (double) minimum + if(this.Double < (double)67.8) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); } diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs index 01f5a9b7840..71368b4b44d 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs @@ -63,7 +63,7 @@ namespace Org.OpenAPITools.Model /// mapOfEnumString. /// directMap. /// indirectMap. - public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary), Dictionary directMap = default(Dictionary), Dictionary indirectMap = default(Dictionary)) + public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary), Dictionary directMap = default(Dictionary), Dictionary indirectMap = default(Dictionary)) { this.MapMapOfString = mapMapOfString; this.MapOfEnumString = mapOfEnumString; @@ -82,13 +82,13 @@ namespace Org.OpenAPITools.Model /// Gets or Sets DirectMap /// [DataMember(Name="direct_map", EmitDefaultValue=false)] - public Dictionary DirectMap { get; set; } + public Dictionary DirectMap { get; set; } /// /// Gets or Sets IndirectMap /// [DataMember(Name="indirect_map", EmitDefaultValue=false)] - public Dictionary IndirectMap { get; set; } + public Dictionary IndirectMap { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index c9cf10c0cb2..627a4d358b7 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -36,7 +36,7 @@ namespace Org.OpenAPITools.Model /// uuid. /// dateTime. /// map. - public MixedPropertiesAndAdditionalPropertiesClass(Guid? uuid = default(Guid?), DateTime? dateTime = default(DateTime?), Dictionary map = default(Dictionary)) + public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) { this.Uuid = uuid; this.DateTime = dateTime; @@ -47,13 +47,13 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Uuid /// [DataMember(Name="uuid", EmitDefaultValue=false)] - public Guid? Uuid { get; set; } + public Guid Uuid { get; set; } /// /// Gets or Sets DateTime /// [DataMember(Name="dateTime", EmitDefaultValue=false)] - public DateTime? DateTime { get; set; } + public DateTime DateTime { get; set; } /// /// Gets or Sets Map diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Model200Response.cs index 9abadca143f..58853af412d 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Model200Response.cs @@ -35,7 +35,7 @@ namespace Org.OpenAPITools.Model /// /// name. /// _class. - public Model200Response(int? name = default(int?), string _class = default(string)) + public Model200Response(int name = default(int), string _class = default(string)) { this.Name = name; this.Class = _class; @@ -45,7 +45,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Name /// [DataMember(Name="name", EmitDefaultValue=false)] - public int? Name { get; set; } + public int Name { get; set; } /// /// Gets or Sets Class diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs index 603c7d88707..2c76d68a122 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs @@ -40,7 +40,7 @@ namespace Org.OpenAPITools.Model /// /// name (required). /// property. - public Name(int? name = default(int?), string property = default(string)) + public Name(int name = default(int), string property = default(string)) { // to ensure "name" is required (not null) if (name == null) @@ -59,13 +59,13 @@ namespace Org.OpenAPITools.Model /// Gets or Sets _Name /// [DataMember(Name="name", EmitDefaultValue=false)] - public int? _Name { get; set; } + public int _Name { get; set; } /// /// Gets or Sets SnakeCase /// [DataMember(Name="snake_case", EmitDefaultValue=false)] - public int? SnakeCase { get; private set; } + public int SnakeCase { get; private set; } /// /// Gets or Sets Property @@ -77,7 +77,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets _123Number /// [DataMember(Name="123Number", EmitDefaultValue=false)] - public int? _123Number { get; private set; } + public int _123Number { get; private set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/NumberOnly.cs index 00a4f3281e3..62f401d8785 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -34,7 +34,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// justNumber. - public NumberOnly(decimal? justNumber = default(decimal?)) + public NumberOnly(decimal justNumber = default(decimal)) { this.JustNumber = justNumber; } @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets JustNumber /// [DataMember(Name="JustNumber", EmitDefaultValue=false)] - public decimal? JustNumber { get; set; } + public decimal JustNumber { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs index 6bc71d339cc..c46c951fd30 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs @@ -72,7 +72,7 @@ namespace Org.OpenAPITools.Model /// shipDate. /// Order Status. /// complete (default to false). - public Order(long? id = default(long?), long? petId = default(long?), int? quantity = default(int?), DateTime? shipDate = default(DateTime?), StatusEnum? status = default(StatusEnum?), bool? complete = false) + public Order(long id = default(long), long petId = default(long), int quantity = default(int), DateTime shipDate = default(DateTime), StatusEnum? status = default(StatusEnum?), bool complete = false) { this.Id = id; this.PetId = petId; @@ -94,32 +94,32 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets PetId /// [DataMember(Name="petId", EmitDefaultValue=false)] - public long? PetId { get; set; } + public long PetId { get; set; } /// /// Gets or Sets Quantity /// [DataMember(Name="quantity", EmitDefaultValue=false)] - public int? Quantity { get; set; } + public int Quantity { get; set; } /// /// Gets or Sets ShipDate /// [DataMember(Name="shipDate", EmitDefaultValue=false)] - public DateTime? ShipDate { get; set; } + public DateTime ShipDate { get; set; } /// /// Gets or Sets Complete /// [DataMember(Name="complete", EmitDefaultValue=false)] - public bool? Complete { get; set; } + public bool Complete { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterComposite.cs index 7a1aaea94e3..eef811e7299 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -36,7 +36,7 @@ namespace Org.OpenAPITools.Model /// myNumber. /// myString. /// myBoolean. - public OuterComposite(decimal? myNumber = default(decimal?), string myString = default(string), bool? myBoolean = default(bool?)) + public OuterComposite(decimal myNumber = default(decimal), string myString = default(string), bool myBoolean = default(bool)) { this.MyNumber = myNumber; this.MyString = myString; @@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets MyNumber /// [DataMember(Name="my_number", EmitDefaultValue=false)] - public decimal? MyNumber { get; set; } + public decimal MyNumber { get; set; } /// /// Gets or Sets MyString @@ -59,7 +59,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets MyBoolean /// [DataMember(Name="my_boolean", EmitDefaultValue=false)] - public bool? MyBoolean { get; set; } + public bool MyBoolean { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs index 83103aaf28e..4616c023097 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs @@ -77,7 +77,7 @@ namespace Org.OpenAPITools.Model /// photoUrls (required). /// tags. /// pet status in the store. - public Pet(long? id = default(long?), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) + public Pet(long id = default(long), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) { // to ensure "name" is required (not null) if (name == null) @@ -109,7 +109,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Category diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Return.cs index f66b4ae50fb..c12d15c0a65 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Return.cs @@ -34,7 +34,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// _return. - public Return(int? _return = default(int?)) + public Return(int _return = default(int)) { this._Return = _return; } @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets _Return /// [DataMember(Name="return", EmitDefaultValue=false)] - public int? _Return { get; set; } + public int _Return { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialModelName.cs index 32c04672a4f..0cd2939c9e1 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -34,7 +34,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// specialPropertyName. - public SpecialModelName(long? specialPropertyName = default(long?)) + public SpecialModelName(long specialPropertyName = default(long)) { this.SpecialPropertyName = specialPropertyName; } @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets SpecialPropertyName /// [DataMember(Name="$special[property.name]", EmitDefaultValue=false)] - public long? SpecialPropertyName { get; set; } + public long SpecialPropertyName { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Tag.cs index 9929598f0e6..4ed40c915d2 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/Tag.cs @@ -35,7 +35,7 @@ namespace Org.OpenAPITools.Model /// /// id. /// name. - public Tag(long? id = default(long?), string name = default(string)) + public Tag(long id = default(long), string name = default(string)) { this.Id = id; this.Name = name; @@ -45,7 +45,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Name diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/TypeHolderDefault.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/TypeHolderDefault.cs index ae501fb3acf..5cce95ad3a0 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/TypeHolderDefault.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/TypeHolderDefault.cs @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// integerItem (required). /// boolItem (required) (default to true). /// arrayItem (required). - public TypeHolderDefault(string stringItem = "what", decimal? numberItem = default(decimal?), int? integerItem = default(int?), bool? boolItem = true, List arrayItem = default(List)) + public TypeHolderDefault(string stringItem = "what", decimal numberItem = default(decimal), int integerItem = default(int), bool boolItem = true, List arrayItem = default(List)) { // to ensure "stringItem" is required (not null) if (stringItem == null) @@ -107,25 +107,25 @@ namespace Org.OpenAPITools.Model /// Gets or Sets NumberItem /// [DataMember(Name="number_item", EmitDefaultValue=false)] - public decimal? NumberItem { get; set; } + public decimal NumberItem { get; set; } /// /// Gets or Sets IntegerItem /// [DataMember(Name="integer_item", EmitDefaultValue=false)] - public int? IntegerItem { get; set; } + public int IntegerItem { get; set; } /// /// Gets or Sets BoolItem /// [DataMember(Name="bool_item", EmitDefaultValue=false)] - public bool? BoolItem { get; set; } + public bool BoolItem { get; set; } /// /// Gets or Sets ArrayItem /// [DataMember(Name="array_item", EmitDefaultValue=false)] - public List ArrayItem { get; set; } + public List ArrayItem { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/TypeHolderExample.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/TypeHolderExample.cs index f6ef807487e..384b5dbbc95 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/TypeHolderExample.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/TypeHolderExample.cs @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// integerItem (required). /// boolItem (required). /// arrayItem (required). - public TypeHolderExample(string stringItem = default(string), decimal? numberItem = default(decimal?), int? integerItem = default(int?), bool? boolItem = default(bool?), List arrayItem = default(List)) + public TypeHolderExample(string stringItem = default(string), decimal numberItem = default(decimal), int integerItem = default(int), bool boolItem = default(bool), List arrayItem = default(List)) { // to ensure "stringItem" is required (not null) if (stringItem == null) @@ -107,25 +107,25 @@ namespace Org.OpenAPITools.Model /// Gets or Sets NumberItem /// [DataMember(Name="number_item", EmitDefaultValue=false)] - public decimal? NumberItem { get; set; } + public decimal NumberItem { get; set; } /// /// Gets or Sets IntegerItem /// [DataMember(Name="integer_item", EmitDefaultValue=false)] - public int? IntegerItem { get; set; } + public int IntegerItem { get; set; } /// /// Gets or Sets BoolItem /// [DataMember(Name="bool_item", EmitDefaultValue=false)] - public bool? BoolItem { get; set; } + public bool BoolItem { get; set; } /// /// Gets or Sets ArrayItem /// [DataMember(Name="array_item", EmitDefaultValue=false)] - public List ArrayItem { get; set; } + public List ArrayItem { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/User.cs index 173ac15c2dc..d59b7b04132 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/User.cs @@ -41,7 +41,7 @@ namespace Org.OpenAPITools.Model /// password. /// phone. /// User Status. - public User(long? id = default(long?), string username = default(string), string firstName = default(string), string lastName = default(string), string email = default(string), string password = default(string), string phone = default(string), int? userStatus = default(int?)) + public User(long id = default(long), string username = default(string), string firstName = default(string), string lastName = default(string), string email = default(string), string password = default(string), string phone = default(string), int userStatus = default(int)) { this.Id = id; this.Username = username; @@ -57,7 +57,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Username @@ -100,7 +100,7 @@ namespace Org.OpenAPITools.Model /// /// User Status [DataMember(Name="userStatus", EmitDefaultValue=false)] - public int? UserStatus { get; set; } + public int UserStatus { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/XmlItem.cs b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/XmlItem.cs index 2fc1cda565c..5cebfb5f5a2 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/XmlItem.cs +++ b/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools/Model/XmlItem.cs @@ -62,7 +62,7 @@ namespace Org.OpenAPITools.Model /// prefixNsBoolean. /// prefixNsArray. /// prefixNsWrappedArray. - public XmlItem(string attributeString = default(string), decimal? attributeNumber = default(decimal?), int? attributeInteger = default(int?), bool? attributeBoolean = default(bool?), List wrappedArray = default(List), string nameString = default(string), decimal? nameNumber = default(decimal?), int? nameInteger = default(int?), bool? nameBoolean = default(bool?), List nameArray = default(List), List nameWrappedArray = default(List), string prefixString = default(string), decimal? prefixNumber = default(decimal?), int? prefixInteger = default(int?), bool? prefixBoolean = default(bool?), List prefixArray = default(List), List prefixWrappedArray = default(List), string namespaceString = default(string), decimal? namespaceNumber = default(decimal?), int? namespaceInteger = default(int?), bool? namespaceBoolean = default(bool?), List namespaceArray = default(List), List namespaceWrappedArray = default(List), string prefixNsString = default(string), decimal? prefixNsNumber = default(decimal?), int? prefixNsInteger = default(int?), bool? prefixNsBoolean = default(bool?), List prefixNsArray = default(List), List prefixNsWrappedArray = default(List)) + public XmlItem(string attributeString = default(string), decimal attributeNumber = default(decimal), int attributeInteger = default(int), bool attributeBoolean = default(bool), List wrappedArray = default(List), string nameString = default(string), decimal nameNumber = default(decimal), int nameInteger = default(int), bool nameBoolean = default(bool), List nameArray = default(List), List nameWrappedArray = default(List), string prefixString = default(string), decimal prefixNumber = default(decimal), int prefixInteger = default(int), bool prefixBoolean = default(bool), List prefixArray = default(List), List prefixWrappedArray = default(List), string namespaceString = default(string), decimal namespaceNumber = default(decimal), int namespaceInteger = default(int), bool namespaceBoolean = default(bool), List namespaceArray = default(List), List namespaceWrappedArray = default(List), string prefixNsString = default(string), decimal prefixNsNumber = default(decimal), int prefixNsInteger = default(int), bool prefixNsBoolean = default(bool), List prefixNsArray = default(List), List prefixNsWrappedArray = default(List)) { this.AttributeString = attributeString; this.AttributeNumber = attributeNumber; @@ -105,25 +105,25 @@ namespace Org.OpenAPITools.Model /// Gets or Sets AttributeNumber /// [DataMember(Name="attribute_number", EmitDefaultValue=false)] - public decimal? AttributeNumber { get; set; } + public decimal AttributeNumber { get; set; } /// /// Gets or Sets AttributeInteger /// [DataMember(Name="attribute_integer", EmitDefaultValue=false)] - public int? AttributeInteger { get; set; } + public int AttributeInteger { get; set; } /// /// Gets or Sets AttributeBoolean /// [DataMember(Name="attribute_boolean", EmitDefaultValue=false)] - public bool? AttributeBoolean { get; set; } + public bool AttributeBoolean { get; set; } /// /// Gets or Sets WrappedArray /// [DataMember(Name="wrapped_array", EmitDefaultValue=false)] - public List WrappedArray { get; set; } + public List WrappedArray { get; set; } /// /// Gets or Sets NameString @@ -135,31 +135,31 @@ namespace Org.OpenAPITools.Model /// Gets or Sets NameNumber /// [DataMember(Name="name_number", EmitDefaultValue=false)] - public decimal? NameNumber { get; set; } + public decimal NameNumber { get; set; } /// /// Gets or Sets NameInteger /// [DataMember(Name="name_integer", EmitDefaultValue=false)] - public int? NameInteger { get; set; } + public int NameInteger { get; set; } /// /// Gets or Sets NameBoolean /// [DataMember(Name="name_boolean", EmitDefaultValue=false)] - public bool? NameBoolean { get; set; } + public bool NameBoolean { get; set; } /// /// Gets or Sets NameArray /// [DataMember(Name="name_array", EmitDefaultValue=false)] - public List NameArray { get; set; } + public List NameArray { get; set; } /// /// Gets or Sets NameWrappedArray /// [DataMember(Name="name_wrapped_array", EmitDefaultValue=false)] - public List NameWrappedArray { get; set; } + public List NameWrappedArray { get; set; } /// /// Gets or Sets PrefixString @@ -171,31 +171,31 @@ namespace Org.OpenAPITools.Model /// Gets or Sets PrefixNumber /// [DataMember(Name="prefix_number", EmitDefaultValue=false)] - public decimal? PrefixNumber { get; set; } + public decimal PrefixNumber { get; set; } /// /// Gets or Sets PrefixInteger /// [DataMember(Name="prefix_integer", EmitDefaultValue=false)] - public int? PrefixInteger { get; set; } + public int PrefixInteger { get; set; } /// /// Gets or Sets PrefixBoolean /// [DataMember(Name="prefix_boolean", EmitDefaultValue=false)] - public bool? PrefixBoolean { get; set; } + public bool PrefixBoolean { get; set; } /// /// Gets or Sets PrefixArray /// [DataMember(Name="prefix_array", EmitDefaultValue=false)] - public List PrefixArray { get; set; } + public List PrefixArray { get; set; } /// /// Gets or Sets PrefixWrappedArray /// [DataMember(Name="prefix_wrapped_array", EmitDefaultValue=false)] - public List PrefixWrappedArray { get; set; } + public List PrefixWrappedArray { get; set; } /// /// Gets or Sets NamespaceString @@ -207,31 +207,31 @@ namespace Org.OpenAPITools.Model /// Gets or Sets NamespaceNumber /// [DataMember(Name="namespace_number", EmitDefaultValue=false)] - public decimal? NamespaceNumber { get; set; } + public decimal NamespaceNumber { get; set; } /// /// Gets or Sets NamespaceInteger /// [DataMember(Name="namespace_integer", EmitDefaultValue=false)] - public int? NamespaceInteger { get; set; } + public int NamespaceInteger { get; set; } /// /// Gets or Sets NamespaceBoolean /// [DataMember(Name="namespace_boolean", EmitDefaultValue=false)] - public bool? NamespaceBoolean { get; set; } + public bool NamespaceBoolean { get; set; } /// /// Gets or Sets NamespaceArray /// [DataMember(Name="namespace_array", EmitDefaultValue=false)] - public List NamespaceArray { get; set; } + public List NamespaceArray { get; set; } /// /// Gets or Sets NamespaceWrappedArray /// [DataMember(Name="namespace_wrapped_array", EmitDefaultValue=false)] - public List NamespaceWrappedArray { get; set; } + public List NamespaceWrappedArray { get; set; } /// /// Gets or Sets PrefixNsString @@ -243,31 +243,31 @@ namespace Org.OpenAPITools.Model /// Gets or Sets PrefixNsNumber /// [DataMember(Name="prefix_ns_number", EmitDefaultValue=false)] - public decimal? PrefixNsNumber { get; set; } + public decimal PrefixNsNumber { get; set; } /// /// Gets or Sets PrefixNsInteger /// [DataMember(Name="prefix_ns_integer", EmitDefaultValue=false)] - public int? PrefixNsInteger { get; set; } + public int PrefixNsInteger { get; set; } /// /// Gets or Sets PrefixNsBoolean /// [DataMember(Name="prefix_ns_boolean", EmitDefaultValue=false)] - public bool? PrefixNsBoolean { get; set; } + public bool PrefixNsBoolean { get; set; } /// /// Gets or Sets PrefixNsArray /// [DataMember(Name="prefix_ns_array", EmitDefaultValue=false)] - public List PrefixNsArray { get; set; } + public List PrefixNsArray { get; set; } /// /// Gets or Sets PrefixNsWrappedArray /// [DataMember(Name="prefix_ns_wrapped_array", EmitDefaultValue=false)] - public List PrefixNsWrappedArray { get; set; } + public List PrefixNsWrappedArray { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/VERSION index 06b5019af3f..83a328a9227 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/README.md b/samples/client/petstore/csharp/OpenAPIClientNet35/README.md index 6319d9193e9..dcdb39631c5 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/README.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/README.md @@ -64,7 +64,7 @@ Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-p ## Getting Started ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -74,10 +74,11 @@ namespace Example { public class Example { - public void main() + public static void Main() { - var apiInstance = new AnotherFakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(Configuration.Default); var body = new ModelClient(); // ModelClient | client model try @@ -86,9 +87,11 @@ namespace Example ModelClient result = apiInstance.Call123TestSpecialTags(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/AdditionalPropertiesClass.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/AdditionalPropertiesClass.md index 32d7ffc7653..d07f57619d5 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/AdditionalPropertiesClass.md @@ -6,10 +6,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **MapString** | **Dictionary<string, string>** | | [optional] -**MapNumber** | **Dictionary<string, decimal?>** | | [optional] -**MapInteger** | **Dictionary<string, int?>** | | [optional] -**MapBoolean** | **Dictionary<string, bool?>** | | [optional] -**MapArrayInteger** | **Dictionary<string, List<int?>>** | | [optional] +**MapNumber** | **Dictionary<string, decimal>** | | [optional] +**MapInteger** | **Dictionary<string, int>** | | [optional] +**MapBoolean** | **Dictionary<string, bool>** | | [optional] +**MapArrayInteger** | **Dictionary<string, List<int>>** | | [optional] **MapArrayAnytype** | **Dictionary<string, List<Object>>** | | [optional] **MapMapString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] **MapMapAnytype** | **Dictionary<string, Dictionary<string, Object>>** | | [optional] diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/AnotherFakeApi.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/AnotherFakeApi.md index d13566caf34..5af41a1862c 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/AnotherFakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/AnotherFakeApi.md @@ -19,7 +19,7 @@ To test special tags and operation ID starting with number ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -29,9 +29,10 @@ namespace Example { public class Call123TestSpecialTagsExample { - public void main() + public static void Main() { - var apiInstance = new AnotherFakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(Configuration.Default); var body = new ModelClient(); // ModelClient | client model try @@ -40,9 +41,11 @@ namespace Example ModelClient result = apiInstance.Call123TestSpecialTags(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -69,6 +72,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/ApiResponse.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/ApiResponse.md index e16dea75cc2..a3b916355fd 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/ApiResponse.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/ApiResponse.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Code** | **int?** | | [optional] +**Code** | **int** | | [optional] **Type** | **string** | | [optional] **Message** | **string** | | [optional] diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/ArrayOfArrayOfNumberOnly.md index 12616c6718b..e05ea7dc240 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/ArrayOfArrayOfNumberOnly.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ArrayArrayNumber** | **List<List<decimal?>>** | | [optional] +**ArrayArrayNumber** | **List<List<decimal>>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/ArrayOfNumberOnly.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/ArrayOfNumberOnly.md index 04facf7d5d1..5f593d42929 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/ArrayOfNumberOnly.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ArrayNumber** | **List<decimal?>** | | [optional] +**ArrayNumber** | **List<decimal>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/ArrayTest.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/ArrayTest.md index 9c297f062a9..593bc2d7386 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/ArrayTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/ArrayTest.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ArrayOfString** | **List<string>** | | [optional] -**ArrayArrayOfInteger** | **List<List<long?>>** | | [optional] +**ArrayArrayOfInteger** | **List<List<long>>** | | [optional] **ArrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Cat.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Cat.md index 4545a124369..6609de8e12a 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Cat.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Cat.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ClassName** | **string** | | **Color** | **string** | | [optional] [default to "red"] -**Declawed** | **bool?** | | [optional] +**Declawed** | **bool** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/CatAllOf.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/CatAllOf.md index 1a630760455..d623d2a0a6e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/CatAllOf.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/CatAllOf.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Declawed** | **bool?** | | [optional] +**Declawed** | **bool** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Category.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Category.md index 87ad855ca6f..42102d4e508 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Category.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Category.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Name** | **string** | | [default to "default-name"] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/EnumTest.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/EnumTest.md index 8e213c3335f..f8bc67baa6a 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/EnumTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/EnumTest.md @@ -7,8 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **EnumString** | **string** | | [optional] **EnumStringRequired** | **string** | | -**EnumInteger** | **int?** | | [optional] -**EnumNumber** | **double?** | | [optional] +**EnumInteger** | **int** | | [optional] +**EnumNumber** | **double** | | [optional] **OuterEnum** | **OuterEnum** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FakeApi.md index a2284ba8f3e..2738b9e1853 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FakeApi.md @@ -31,7 +31,7 @@ this route creates an XmlItem ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -41,9 +41,10 @@ namespace Example { public class CreateXmlItemExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var xmlItem = new XmlItem(); // XmlItem | XmlItem Body try @@ -51,9 +52,11 @@ namespace Example // creates an XmlItem apiInstance.CreateXmlItem(xmlItem); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.CreateXmlItem: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -80,6 +83,11 @@ No authorization required - **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 - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -88,7 +96,7 @@ No authorization required ## FakeOuterBooleanSerialize -> bool? FakeOuterBooleanSerialize (bool? body = null) +> bool FakeOuterBooleanSerialize (bool body = null) @@ -97,7 +105,7 @@ Test serialization of outer boolean types ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -107,19 +115,22 @@ namespace Example { public class FakeOuterBooleanSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var body = true; // bool? | Input boolean as post body (optional) + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var body = true; // bool | Input boolean as post body (optional) try { - bool? result = apiInstance.FakeOuterBooleanSerialize(body); + bool result = apiInstance.FakeOuterBooleanSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -131,11 +142,11 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **bool?**| Input boolean as post body | [optional] + **body** | **bool**| Input boolean as post body | [optional] ### Return type -**bool?** +**bool** ### Authorization @@ -146,6 +157,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -163,7 +179,7 @@ Test serialization of object with outer number type ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -173,9 +189,10 @@ namespace Example { public class FakeOuterCompositeSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = new OuterComposite(); // OuterComposite | Input composite as post body (optional) try @@ -183,9 +200,11 @@ namespace Example OuterComposite result = apiInstance.FakeOuterCompositeSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -212,6 +231,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -220,7 +244,7 @@ No authorization required ## FakeOuterNumberSerialize -> decimal? FakeOuterNumberSerialize (decimal? body = null) +> decimal FakeOuterNumberSerialize (decimal body = null) @@ -229,7 +253,7 @@ Test serialization of outer number types ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -239,19 +263,22 @@ namespace Example { public class FakeOuterNumberSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var body = 8.14; // decimal? | Input number as post body (optional) + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var body = 8.14; // decimal | Input number as post body (optional) try { - decimal? result = apiInstance.FakeOuterNumberSerialize(body); + decimal result = apiInstance.FakeOuterNumberSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -263,11 +290,11 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **decimal?**| Input number as post body | [optional] + **body** | **decimal**| Input number as post body | [optional] ### Return type -**decimal?** +**decimal** ### Authorization @@ -278,6 +305,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -295,7 +327,7 @@ Test serialization of outer string types ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -305,9 +337,10 @@ namespace Example { public class FakeOuterStringSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = body_example; // string | Input string as post body (optional) try @@ -315,9 +348,11 @@ namespace Example string result = apiInstance.FakeOuterStringSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -344,6 +379,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -361,7 +401,7 @@ For this test, the body for this request much reference a schema named `File`. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -371,18 +411,21 @@ namespace Example { public class TestBodyWithFileSchemaExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = new FileSchemaTestClass(); // FileSchemaTestClass | try { apiInstance.TestBodyWithFileSchema(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchema: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -409,6 +452,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -424,7 +472,7 @@ No authorization required ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -434,9 +482,10 @@ namespace Example { public class TestBodyWithQueryParamsExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var query = query_example; // string | var body = new User(); // User | @@ -444,9 +493,11 @@ namespace Example { apiInstance.TestBodyWithQueryParams(query, body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -474,6 +525,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -491,7 +547,7 @@ To test \"client\" model ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -501,9 +557,10 @@ namespace Example { public class TestClientModelExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = new ModelClient(); // ModelClient | client model try @@ -512,9 +569,11 @@ namespace Example ModelClient result = apiInstance.TestClientModel(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -541,6 +600,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -549,7 +613,7 @@ No authorization required ## TestEndpointParameters -> void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) +> void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = null, int int32 = null, long int64 = null, float _float = null, string _string = null, System.IO.Stream binary = null, DateTime date = null, DateTime dateTime = null, string password = null, string callback = null) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -558,7 +622,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -568,25 +632,26 @@ namespace Example { public class TestEndpointParametersExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure HTTP basic authorization: http_basic_test Configuration.Default.Username = "YOUR_USERNAME"; Configuration.Default.Password = "YOUR_PASSWORD"; - var apiInstance = new FakeApi(); - var number = 8.14; // decimal? | None - var _double = 1.2D; // double? | None + var apiInstance = new FakeApi(Configuration.Default); + var number = 8.14; // decimal | None + var _double = 1.2D; // double | None var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None var _byte = BYTE_ARRAY_DATA_HERE; // byte[] | None - var integer = 56; // int? | None (optional) - var int32 = 56; // int? | None (optional) - var int64 = 789; // long? | None (optional) - var _float = 3.4F; // float? | None (optional) + var integer = 56; // int | None (optional) + var int32 = 56; // int | None (optional) + var int64 = 789; // long | None (optional) + var _float = 3.4F; // float | None (optional) var _string = _string_example; // string | None (optional) var binary = BINARY_DATA_HERE; // System.IO.Stream | None (optional) - var date = 2013-10-20; // DateTime? | None (optional) - var dateTime = 2013-10-20T19:20:30+01:00; // DateTime? | None (optional) + var date = 2013-10-20; // DateTime | None (optional) + var dateTime = 2013-10-20T19:20:30+01:00; // DateTime | None (optional) var password = password_example; // string | None (optional) var callback = callback_example; // string | None (optional) @@ -595,9 +660,11 @@ namespace Example // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 apiInstance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -609,18 +676,18 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **number** | **decimal?**| None | - **_double** | **double?**| None | + **number** | **decimal**| None | + **_double** | **double**| None | **patternWithoutDelimiter** | **string**| None | **_byte** | **byte[]**| None | - **integer** | **int?**| None | [optional] - **int32** | **int?**| None | [optional] - **int64** | **long?**| None | [optional] - **_float** | **float?**| None | [optional] + **integer** | **int**| None | [optional] + **int32** | **int**| None | [optional] + **int64** | **long**| None | [optional] + **_float** | **float**| None | [optional] **_string** | **string**| None | [optional] **binary** | **System.IO.Stream**| None | [optional] - **date** | **DateTime?**| None | [optional] - **dateTime** | **DateTime?**| None | [optional] + **date** | **DateTime**| None | [optional] + **dateTime** | **DateTime**| None | [optional] **password** | **string**| None | [optional] **callback** | **string**| None | [optional] @@ -637,6 +704,12 @@ void (empty response body) - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -645,7 +718,7 @@ void (empty response body) ## TestEnumParameters -> void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) +> void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int enumQueryInteger = null, double enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) To test enum parameters @@ -654,7 +727,7 @@ To test enum parameters ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -664,15 +737,16 @@ namespace Example { public class TestEnumParametersExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var enumHeaderStringArray = enumHeaderStringArray_example; // List | Header parameter enum test (string array) (optional) var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg) var enumQueryStringArray = enumQueryStringArray_example; // List | Query parameter enum test (string array) (optional) var enumQueryString = enumQueryString_example; // string | Query parameter enum test (string) (optional) (default to -efg) - var enumQueryInteger = 56; // int? | Query parameter enum test (double) (optional) - var enumQueryDouble = 1.2D; // double? | Query parameter enum test (double) (optional) + var enumQueryInteger = 56; // int | Query parameter enum test (double) (optional) + var enumQueryDouble = 1.2D; // double | Query parameter enum test (double) (optional) var enumFormStringArray = new List(); // List | Form parameter enum test (string array) (optional) (default to $) var enumFormString = enumFormString_example; // string | Form parameter enum test (string) (optional) (default to -efg) @@ -681,9 +755,11 @@ namespace Example // To test enum parameters apiInstance.TestEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -699,8 +775,8 @@ Name | Type | Description | Notes **enumHeaderString** | **string**| Header parameter enum test (string) | [optional] [default to -efg] **enumQueryStringArray** | **List<string>**| Query parameter enum test (string array) | [optional] **enumQueryString** | **string**| Query parameter enum test (string) | [optional] [default to -efg] - **enumQueryInteger** | **int?**| Query parameter enum test (double) | [optional] - **enumQueryDouble** | **double?**| Query parameter enum test (double) | [optional] + **enumQueryInteger** | **int**| Query parameter enum test (double) | [optional] + **enumQueryDouble** | **double**| Query parameter enum test (double) | [optional] **enumFormStringArray** | [**List<string>**](string.md)| Form parameter enum test (string array) | [optional] [default to $] **enumFormString** | **string**| Form parameter enum test (string) | [optional] [default to -efg] @@ -717,6 +793,12 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -725,7 +807,7 @@ No authorization required ## TestGroupParameters -> void TestGroupParameters (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) +> void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = null, bool booleanGroup = null, long int64Group = null) Fake endpoint to test group parameters (optional) @@ -734,7 +816,7 @@ Fake endpoint to test group parameters (optional) ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -744,24 +826,27 @@ namespace Example { public class TestGroupParametersExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var requiredStringGroup = 56; // int? | Required String in group parameters - var requiredBooleanGroup = true; // bool? | Required Boolean in group parameters - var requiredInt64Group = 789; // long? | Required Integer in group parameters - var stringGroup = 56; // int? | String in group parameters (optional) - var booleanGroup = true; // bool? | Boolean in group parameters (optional) - var int64Group = 789; // long? | Integer in group parameters (optional) + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var requiredStringGroup = 56; // int | Required String in group parameters + var requiredBooleanGroup = true; // bool | Required Boolean in group parameters + var requiredInt64Group = 789; // long | Required Integer in group parameters + var stringGroup = 56; // int | String in group parameters (optional) + var booleanGroup = true; // bool | Boolean in group parameters (optional) + var int64Group = 789; // long | Integer in group parameters (optional) try { // Fake endpoint to test group parameters (optional) apiInstance.TestGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestGroupParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -773,12 +858,12 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **requiredStringGroup** | **int?**| Required String in group parameters | - **requiredBooleanGroup** | **bool?**| Required Boolean in group parameters | - **requiredInt64Group** | **long?**| Required Integer in group parameters | - **stringGroup** | **int?**| String in group parameters | [optional] - **booleanGroup** | **bool?**| Boolean in group parameters | [optional] - **int64Group** | **long?**| Integer in group parameters | [optional] + **requiredStringGroup** | **int**| Required String in group parameters | + **requiredBooleanGroup** | **bool**| Required Boolean in group parameters | + **requiredInt64Group** | **long**| Required Integer in group parameters | + **stringGroup** | **int**| String in group parameters | [optional] + **booleanGroup** | **bool**| Boolean in group parameters | [optional] + **int64Group** | **long**| Integer in group parameters | [optional] ### Return type @@ -793,6 +878,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Someting wrong | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -808,7 +898,7 @@ test inline additionalProperties ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -818,9 +908,10 @@ namespace Example { public class TestInlineAdditionalPropertiesExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var param = new Dictionary(); // Dictionary | request body try @@ -828,9 +919,11 @@ namespace Example // test inline additionalProperties apiInstance.TestInlineAdditionalProperties(param); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -857,6 +950,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -872,7 +970,7 @@ test json serialization of form data ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -882,9 +980,10 @@ namespace Example { public class TestJsonFormDataExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var param = param_example; // string | field1 var param2 = param2_example; // string | field2 @@ -893,9 +992,11 @@ namespace Example // test json serialization of form data apiInstance.TestJsonFormData(param, param2); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -923,6 +1024,11 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FakeClassnameTags123Api.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FakeClassnameTags123Api.md index cc0cd83d12c..deb97a27697 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FakeClassnameTags123Api.md @@ -19,7 +19,7 @@ To test class name in snake case ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -29,14 +29,15 @@ namespace Example { public class TestClassnameExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key_query Configuration.Default.AddApiKey("api_key_query", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key_query", "Bearer"); - var apiInstance = new FakeClassnameTags123Api(); + var apiInstance = new FakeClassnameTags123Api(Configuration.Default); var body = new ModelClient(); // ModelClient | client model try @@ -45,9 +46,11 @@ namespace Example ModelClient result = apiInstance.TestClassname(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -74,6 +77,11 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FormatTest.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FormatTest.md index 519e940a7c8..0d921285ba1 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FormatTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/FormatTest.md @@ -5,18 +5,18 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Integer** | **int?** | | [optional] -**Int32** | **int?** | | [optional] -**Int64** | **long?** | | [optional] -**Number** | **decimal?** | | -**Float** | **float?** | | [optional] -**Double** | **double?** | | [optional] +**Integer** | **int** | | [optional] +**Int32** | **int** | | [optional] +**Int64** | **long** | | [optional] +**Number** | **decimal** | | +**Float** | **float** | | [optional] +**Double** | **double** | | [optional] **String** | **string** | | [optional] **Byte** | **byte[]** | | **Binary** | **System.IO.Stream** | | [optional] -**Date** | **DateTime?** | | -**DateTime** | **DateTime?** | | [optional] -**Uuid** | **Guid?** | | [optional] +**Date** | **DateTime** | | +**DateTime** | **DateTime** | | [optional] +**Uuid** | **Guid** | | [optional] **Password** | **string** | | [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/MapTest.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/MapTest.md index 89be5aa12cf..79d499e2cf9 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/MapTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/MapTest.md @@ -7,8 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **MapMapOfString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] **MapOfEnumString** | **Dictionary<string, string>** | | [optional] -**DirectMap** | **Dictionary<string, bool?>** | | [optional] -**IndirectMap** | **Dictionary<string, bool?>** | | [optional] +**DirectMap** | **Dictionary<string, bool>** | | [optional] +**IndirectMap** | **Dictionary<string, bool>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 323933588de..dd7b01e49fe 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Uuid** | **Guid?** | | [optional] -**DateTime** | **DateTime?** | | [optional] +**Uuid** | **Guid** | | [optional] +**DateTime** | **DateTime** | | [optional] **Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Model200Response.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Model200Response.md index 59918913107..7d826bca1ec 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Model200Response.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Model200Response.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **int?** | | [optional] +**Name** | **int** | | [optional] **Class** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Name.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Name.md index 80d0a9f31f3..77b9b2e7501 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Name.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Name.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Name** | **int?** | | -**SnakeCase** | **int?** | | [optional] +**_Name** | **int** | | +**SnakeCase** | **int** | | [optional] **Property** | **string** | | [optional] -**_123Number** | **int?** | | [optional] +**_123Number** | **int** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/NumberOnly.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/NumberOnly.md index 8fd05997a93..e4b08467e08 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/NumberOnly.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/NumberOnly.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**JustNumber** | **decimal?** | | [optional] +**JustNumber** | **decimal** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Order.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Order.md index f28ee2ad006..875f43a30e5 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Order.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Order.md @@ -5,12 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] -**PetId** | **long?** | | [optional] -**Quantity** | **int?** | | [optional] -**ShipDate** | **DateTime?** | | [optional] +**Id** | **long** | | [optional] +**PetId** | **long** | | [optional] +**Quantity** | **int** | | [optional] +**ShipDate** | **DateTime** | | [optional] **Status** | **string** | Order Status | [optional] -**Complete** | **bool?** | | [optional] [default to false] +**Complete** | **bool** | | [optional] [default to false] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/OuterComposite.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/OuterComposite.md index e371f712633..f381fb7fd28 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/OuterComposite.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/OuterComposite.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MyNumber** | **decimal?** | | [optional] +**MyNumber** | **decimal** | | [optional] **MyString** | **string** | | [optional] -**MyBoolean** | **bool?** | | [optional] +**MyBoolean** | **bool** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Pet.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Pet.md index 51022249270..0bd5c40fc99 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Pet.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Pet.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Category** | [**Category**](Category.md) | | [optional] **Name** | **string** | | **PhotoUrls** | **List<string>** | | diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/PetApi.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/PetApi.md index d2e2075bfd7..1a9eba14868 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/PetApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/PetApi.md @@ -25,7 +25,7 @@ Add a new pet to the store ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -35,12 +35,13 @@ namespace Example { public class AddPetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var body = new Pet(); // Pet | Pet object that needs to be added to the store try @@ -48,9 +49,11 @@ namespace Example // Add a new pet to the store apiInstance.AddPet(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -77,6 +80,12 @@ void (empty response body) - **Content-Type**: application/json, application/xml - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **405** | Invalid input | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -85,14 +94,14 @@ void (empty response body) ## DeletePet -> void DeletePet (long? petId, string apiKey = null) +> void DeletePet (long petId, string apiKey = null) Deletes a pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -102,13 +111,14 @@ namespace Example { public class DeletePetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var petId = 789; // long? | Pet id to delete + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | Pet id to delete var apiKey = apiKey_example; // string | (optional) try @@ -116,9 +126,11 @@ namespace Example // Deletes a pet apiInstance.DeletePet(petId, apiKey); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -130,7 +142,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| Pet id to delete | + **petId** | **long**| Pet id to delete | **apiKey** | **string**| | [optional] ### Return type @@ -146,6 +158,12 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid pet value | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -154,7 +172,7 @@ void (empty response body) ## FindPetsByStatus -> List FindPetsByStatus (List status) +> List<Pet> FindPetsByStatus (List status) Finds Pets by status @@ -163,7 +181,7 @@ Multiple status values can be provided with comma separated strings ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -173,23 +191,26 @@ namespace Example { public class FindPetsByStatusExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var status = status_example; // List | Status values that need to be considered for filter try { // Finds Pets by status - List<Pet> result = apiInstance.FindPetsByStatus(status); + List result = apiInstance.FindPetsByStatus(status); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -205,7 +226,7 @@ Name | Type | Description | Notes ### Return type -[**List**](Pet.md) +[**List<Pet>**](Pet.md) ### Authorization @@ -216,6 +237,12 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -224,7 +251,7 @@ Name | Type | Description | Notes ## FindPetsByTags -> List FindPetsByTags (List tags) +> List<Pet> FindPetsByTags (List tags) Finds Pets by tags @@ -233,7 +260,7 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -243,23 +270,26 @@ namespace Example { public class FindPetsByTagsExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var tags = new List(); // List | Tags to filter by try { // Finds Pets by tags - List<Pet> result = apiInstance.FindPetsByTags(tags); + List result = apiInstance.FindPetsByTags(tags); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -275,7 +305,7 @@ Name | Type | Description | Notes ### Return type -[**List**](Pet.md) +[**List<Pet>**](Pet.md) ### Authorization @@ -286,6 +316,12 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -294,7 +330,7 @@ Name | Type | Description | Notes ## GetPetById -> Pet GetPetById (long? petId) +> Pet GetPetById (long petId) Find pet by ID @@ -303,7 +339,7 @@ Returns a single pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -313,15 +349,16 @@ namespace Example { public class GetPetByIdExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet to return + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | ID of pet to return try { @@ -329,9 +366,11 @@ namespace Example Pet result = apiInstance.GetPetById(petId); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -343,7 +382,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to return | + **petId** | **long**| ID of pet to return | ### Return type @@ -358,6 +397,13 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -373,7 +419,7 @@ Update an existing pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -383,12 +429,13 @@ namespace Example { public class UpdatePetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var body = new Pet(); // Pet | Pet object that needs to be added to the store try @@ -396,9 +443,11 @@ namespace Example // Update an existing pet apiInstance.UpdatePet(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -425,6 +474,14 @@ void (empty response body) - **Content-Type**: application/json, application/xml - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -433,14 +490,14 @@ void (empty response body) ## UpdatePetWithForm -> void UpdatePetWithForm (long? petId, string name = null, string status = null) +> void UpdatePetWithForm (long petId, string name = null, string status = null) Updates a pet in the store with form data ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -450,13 +507,14 @@ namespace Example { public class UpdatePetWithFormExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet that needs to be updated + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | ID of pet that needs to be updated var name = name_example; // string | Updated name of the pet (optional) var status = status_example; // string | Updated status of the pet (optional) @@ -465,9 +523,11 @@ namespace Example // Updates a pet in the store with form data apiInstance.UpdatePetWithForm(petId, name, status); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -479,7 +539,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet that needs to be updated | + **petId** | **long**| ID of pet that needs to be updated | **name** | **string**| Updated name of the pet | [optional] **status** | **string**| Updated status of the pet | [optional] @@ -496,6 +556,11 @@ void (empty response body) - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -504,14 +569,14 @@ void (empty response body) ## UploadFile -> ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null) +> ApiResponse UploadFile (long petId, string additionalMetadata = null, System.IO.Stream file = null) uploads an image ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -521,13 +586,14 @@ namespace Example { public class UploadFileExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet to update + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | ID of pet to update var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) var file = BINARY_DATA_HERE; // System.IO.Stream | file to upload (optional) @@ -537,9 +603,11 @@ namespace Example ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -551,7 +619,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to update | + **petId** | **long**| ID of pet to update | **additionalMetadata** | **string**| Additional data to pass to server | [optional] **file** | **System.IO.Stream**| file to upload | [optional] @@ -568,6 +636,11 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -576,14 +649,14 @@ Name | Type | Description | Notes ## UploadFileWithRequiredFile -> ApiResponse UploadFileWithRequiredFile (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) +> ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string additionalMetadata = null) uploads an image (required) ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -593,13 +666,14 @@ namespace Example { public class UploadFileWithRequiredFileExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet to update + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | ID of pet to update var requiredFile = BINARY_DATA_HERE; // System.IO.Stream | file to upload var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) @@ -609,9 +683,11 @@ namespace Example ApiResponse result = apiInstance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -623,7 +699,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to update | + **petId** | **long**| ID of pet to update | **requiredFile** | **System.IO.Stream**| file to upload | **additionalMetadata** | **string**| Additional data to pass to server | [optional] @@ -640,6 +716,11 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Return.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Return.md index 65481f45cf2..4761c70748e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Return.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Return.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Return** | **int?** | | [optional] +**_Return** | **int** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/SpecialModelName.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/SpecialModelName.md index c1154219ccc..ee6489524d0 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/SpecialModelName.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/SpecialModelName.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SpecialPropertyName** | **long?** | | [optional] +**SpecialPropertyName** | **long** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/StoreApi.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/StoreApi.md index 0f6d9e4e3dc..57247772d4f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/StoreApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/StoreApi.md @@ -22,7 +22,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -32,9 +32,10 @@ namespace Example { public class DeleteOrderExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); var orderId = orderId_example; // string | ID of the order that needs to be deleted try @@ -42,9 +43,11 @@ namespace Example // Delete purchase order by ID apiInstance.DeleteOrder(orderId); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -71,6 +74,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -79,7 +88,7 @@ No authorization required ## GetInventory -> Dictionary GetInventory () +> Dictionary<string, int> GetInventory () Returns pet inventories by status @@ -88,7 +97,7 @@ Returns a map of status codes to quantities ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -98,24 +107,27 @@ namespace Example { public class GetInventoryExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); - var apiInstance = new StoreApi(); + var apiInstance = new StoreApi(Configuration.Default); try { // Returns pet inventories by status - Dictionary<string, int?> result = apiInstance.GetInventory(); + Dictionary result = apiInstance.GetInventory(); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -128,7 +140,7 @@ This endpoint does not need any parameter. ### Return type -**Dictionary** +**Dictionary** ### Authorization @@ -139,6 +151,11 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -147,7 +164,7 @@ This endpoint does not need any parameter. ## GetOrderById -> Order GetOrderById (long? orderId) +> Order GetOrderById (long orderId) Find purchase order by ID @@ -156,7 +173,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -166,10 +183,11 @@ namespace Example { public class GetOrderByIdExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); - var orderId = 789; // long? | ID of pet that needs to be fetched + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); + var orderId = 789; // long | ID of pet that needs to be fetched try { @@ -177,9 +195,11 @@ namespace Example Order result = apiInstance.GetOrderById(orderId); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -191,7 +211,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **long?**| ID of pet that needs to be fetched | + **orderId** | **long**| ID of pet that needs to be fetched | ### Return type @@ -206,6 +226,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -221,7 +248,7 @@ Place an order for a pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -231,9 +258,10 @@ namespace Example { public class PlaceOrderExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); var body = new Order(); // Order | order placed for purchasing the pet try @@ -242,9 +270,11 @@ namespace Example Order result = apiInstance.PlaceOrder(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -271,6 +301,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Tag.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Tag.md index 864cac0c8d3..f781c26f017 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Tag.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/Tag.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Name** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/TypeHolderDefault.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/TypeHolderDefault.md index d336f567ab2..0945245b213 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/TypeHolderDefault.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/TypeHolderDefault.md @@ -6,10 +6,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **StringItem** | **string** | | [default to "what"] -**NumberItem** | **decimal?** | | -**IntegerItem** | **int?** | | -**BoolItem** | **bool?** | | [default to true] -**ArrayItem** | **List<int?>** | | +**NumberItem** | **decimal** | | +**IntegerItem** | **int** | | +**BoolItem** | **bool** | | [default to true] +**ArrayItem** | **List<int>** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/TypeHolderExample.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/TypeHolderExample.md index 8f9ec66939e..e92681b8cba 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/TypeHolderExample.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/TypeHolderExample.md @@ -6,10 +6,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **StringItem** | **string** | | -**NumberItem** | **decimal?** | | -**IntegerItem** | **int?** | | -**BoolItem** | **bool?** | | -**ArrayItem** | **List<int?>** | | +**NumberItem** | **decimal** | | +**IntegerItem** | **int** | | +**BoolItem** | **bool** | | +**ArrayItem** | **List<int>** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/User.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/User.md index 6faa1df688d..a25c25d1aa0 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/User.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/User.md @@ -5,14 +5,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Username** | **string** | | [optional] **FirstName** | **string** | | [optional] **LastName** | **string** | | [optional] **Email** | **string** | | [optional] **Password** | **string** | | [optional] **Phone** | **string** | | [optional] -**UserStatus** | **int?** | User Status | [optional] +**UserStatus** | **int** | User Status | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/UserApi.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/UserApi.md index b9f592bdd71..1385d840413 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/UserApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/UserApi.md @@ -26,7 +26,7 @@ This can only be done by the logged in user. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -36,9 +36,10 @@ namespace Example { public class CreateUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var body = new User(); // User | Created user object try @@ -46,9 +47,11 @@ namespace Example // Create user apiInstance.CreateUser(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -75,6 +78,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -90,7 +98,7 @@ Creates list of users with given input array ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -100,9 +108,10 @@ namespace Example { public class CreateUsersWithArrayInputExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var body = new List(); // List | List of user object try @@ -110,9 +119,11 @@ namespace Example // Creates list of users with given input array apiInstance.CreateUsersWithArrayInput(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -124,7 +135,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -139,6 +150,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -154,7 +170,7 @@ Creates list of users with given input array ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -164,9 +180,10 @@ namespace Example { public class CreateUsersWithListInputExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var body = new List(); // List | List of user object try @@ -174,9 +191,11 @@ namespace Example // Creates list of users with given input array apiInstance.CreateUsersWithListInput(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -188,7 +207,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -203,6 +222,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -220,7 +244,7 @@ This can only be done by the logged in user. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -230,9 +254,10 @@ namespace Example { public class DeleteUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The name that needs to be deleted try @@ -240,9 +265,11 @@ namespace Example // Delete user apiInstance.DeleteUser(username); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -269,6 +296,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -284,7 +317,7 @@ Get user by user name ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -294,9 +327,10 @@ namespace Example { public class GetUserByNameExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. try @@ -305,9 +339,11 @@ namespace Example User result = apiInstance.GetUserByName(username); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -334,6 +370,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -349,7 +392,7 @@ Logs user into the system ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -359,9 +402,10 @@ namespace Example { public class LoginUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The user name for login var password = password_example; // string | The password for login in clear text @@ -371,9 +415,11 @@ namespace Example string result = apiInstance.LoginUser(username, password); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -401,6 +447,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -416,7 +468,7 @@ Logs out current logged in user session ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -426,18 +478,21 @@ namespace Example { public class LogoutUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); try { // Logs out current logged in user session apiInstance.LogoutUser(); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -461,6 +516,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -478,7 +538,7 @@ This can only be done by the logged in user. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -488,9 +548,10 @@ namespace Example { public class UpdateUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | name that need to be deleted var body = new User(); // User | Updated user object @@ -499,9 +560,11 @@ namespace Example // Updated user apiInstance.UpdateUser(username, body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -529,6 +592,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/XmlItem.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/XmlItem.md index e96ea4b0de6..0dca90c706f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/XmlItem.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/XmlItem.md @@ -6,34 +6,34 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **AttributeString** | **string** | | [optional] -**AttributeNumber** | **decimal?** | | [optional] -**AttributeInteger** | **int?** | | [optional] -**AttributeBoolean** | **bool?** | | [optional] -**WrappedArray** | **List<int?>** | | [optional] +**AttributeNumber** | **decimal** | | [optional] +**AttributeInteger** | **int** | | [optional] +**AttributeBoolean** | **bool** | | [optional] +**WrappedArray** | **List<int>** | | [optional] **NameString** | **string** | | [optional] -**NameNumber** | **decimal?** | | [optional] -**NameInteger** | **int?** | | [optional] -**NameBoolean** | **bool?** | | [optional] -**NameArray** | **List<int?>** | | [optional] -**NameWrappedArray** | **List<int?>** | | [optional] +**NameNumber** | **decimal** | | [optional] +**NameInteger** | **int** | | [optional] +**NameBoolean** | **bool** | | [optional] +**NameArray** | **List<int>** | | [optional] +**NameWrappedArray** | **List<int>** | | [optional] **PrefixString** | **string** | | [optional] -**PrefixNumber** | **decimal?** | | [optional] -**PrefixInteger** | **int?** | | [optional] -**PrefixBoolean** | **bool?** | | [optional] -**PrefixArray** | **List<int?>** | | [optional] -**PrefixWrappedArray** | **List<int?>** | | [optional] +**PrefixNumber** | **decimal** | | [optional] +**PrefixInteger** | **int** | | [optional] +**PrefixBoolean** | **bool** | | [optional] +**PrefixArray** | **List<int>** | | [optional] +**PrefixWrappedArray** | **List<int>** | | [optional] **NamespaceString** | **string** | | [optional] -**NamespaceNumber** | **decimal?** | | [optional] -**NamespaceInteger** | **int?** | | [optional] -**NamespaceBoolean** | **bool?** | | [optional] -**NamespaceArray** | **List<int?>** | | [optional] -**NamespaceWrappedArray** | **List<int?>** | | [optional] +**NamespaceNumber** | **decimal** | | [optional] +**NamespaceInteger** | **int** | | [optional] +**NamespaceBoolean** | **bool** | | [optional] +**NamespaceArray** | **List<int>** | | [optional] +**NamespaceWrappedArray** | **List<int>** | | [optional] **PrefixNsString** | **string** | | [optional] -**PrefixNsNumber** | **decimal?** | | [optional] -**PrefixNsInteger** | **int?** | | [optional] -**PrefixNsBoolean** | **bool?** | | [optional] -**PrefixNsArray** | **List<int?>** | | [optional] -**PrefixNsWrappedArray** | **List<int?>** | | [optional] +**PrefixNsNumber** | **decimal** | | [optional] +**PrefixNsInteger** | **int** | | [optional] +**PrefixNsBoolean** | **bool** | | [optional] +**PrefixNsArray** | **List<int>** | | [optional] +**PrefixNsWrappedArray** | **List<int>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 6d129b8a742..5d8a13468c7 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -174,7 +174,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > Call123TestSpecialTagsWithHttpInfo (ModelClient body) + public ApiResponse Call123TestSpecialTagsWithHttpInfo (ModelClient body) { // verify the required parameter 'body' is set if (body == null) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/FakeApi.cs index 40a419d09b3..bfde276a073 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/FakeApi.cs @@ -53,8 +53,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// bool? - bool? FakeOuterBooleanSerialize (bool? body = null); + /// bool + bool FakeOuterBooleanSerialize (bool body = default(bool)); /// /// @@ -64,8 +64,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// ApiResponse of bool? - ApiResponse FakeOuterBooleanSerializeWithHttpInfo (bool? body = null); + /// ApiResponse of bool + ApiResponse FakeOuterBooleanSerializeWithHttpInfo (bool body = default(bool)); /// /// /// @@ -75,7 +75,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// OuterComposite - OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null); + OuterComposite FakeOuterCompositeSerialize (OuterComposite body = default(OuterComposite)); /// /// @@ -86,7 +86,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// ApiResponse of OuterComposite - ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null); + ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = default(OuterComposite)); /// /// /// @@ -95,8 +95,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// decimal? - decimal? FakeOuterNumberSerialize (decimal? body = null); + /// decimal + decimal FakeOuterNumberSerialize (decimal body = default(decimal)); /// /// @@ -106,8 +106,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// ApiResponse of decimal? - ApiResponse FakeOuterNumberSerializeWithHttpInfo (decimal? body = null); + /// ApiResponse of decimal + ApiResponse FakeOuterNumberSerializeWithHttpInfo (decimal body = default(decimal)); /// /// /// @@ -117,7 +117,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// string - string FakeOuterStringSerialize (string body = null); + string FakeOuterStringSerialize (string body = default(string)); /// /// @@ -128,7 +128,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// ApiResponse of string - ApiResponse FakeOuterStringSerializeWithHttpInfo (string body = null); + ApiResponse FakeOuterStringSerializeWithHttpInfo (string body = default(string)); /// /// /// @@ -216,7 +216,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// - void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -240,7 +240,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// ApiResponse of Object(void) - ApiResponse TestEndpointParametersWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + ApiResponse TestEndpointParametersWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)); /// /// To test enum parameters /// @@ -257,7 +257,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// - void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); + void TestEnumParameters (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)); /// /// To test enum parameters @@ -275,7 +275,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// ApiResponse of Object(void) - ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); + ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)); /// /// Fake endpoint to test group parameters (optional) /// @@ -290,7 +290,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// - void TestGroupParameters (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)); /// /// Fake endpoint to test group parameters (optional) @@ -306,7 +306,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// ApiResponse of Object(void) - ApiResponse TestGroupParametersWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + ApiResponse TestGroupParametersWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)); /// /// test inline additionalProperties /// @@ -544,10 +544,10 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// bool? - public bool? FakeOuterBooleanSerialize (bool? body = null) + /// bool + public bool FakeOuterBooleanSerialize (bool body = default(bool)) { - ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -556,8 +556,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// ApiResponse of bool? - public ApiResponse< bool? > FakeOuterBooleanSerializeWithHttpInfo (bool? body = null) + /// ApiResponse of bool + public ApiResponse FakeOuterBooleanSerializeWithHttpInfo (bool body = default(bool)) { var localVarPath = "/fake/outer/boolean"; @@ -604,9 +604,9 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (bool?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool?))); + (bool) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool))); } /// @@ -615,7 +615,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// OuterComposite - public OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) + public OuterComposite FakeOuterCompositeSerialize (OuterComposite body = default(OuterComposite)) { ApiResponse localVarResponse = FakeOuterCompositeSerializeWithHttpInfo(body); return localVarResponse.Data; @@ -627,7 +627,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// ApiResponse of OuterComposite - public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null) + public ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = default(OuterComposite)) { var localVarPath = "/fake/outer/composite"; @@ -684,10 +684,10 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// decimal? - public decimal? FakeOuterNumberSerialize (decimal? body = null) + /// decimal + public decimal FakeOuterNumberSerialize (decimal body = default(decimal)) { - ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -696,8 +696,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// ApiResponse of decimal? - public ApiResponse< decimal? > FakeOuterNumberSerializeWithHttpInfo (decimal? body = null) + /// ApiResponse of decimal + public ApiResponse FakeOuterNumberSerializeWithHttpInfo (decimal body = default(decimal)) { var localVarPath = "/fake/outer/number"; @@ -744,9 +744,9 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (decimal?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal?))); + (decimal) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal))); } /// @@ -755,7 +755,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// string - public string FakeOuterStringSerialize (string body = null) + public string FakeOuterStringSerialize (string body = default(string)) { ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); return localVarResponse.Data; @@ -767,7 +767,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// ApiResponse of string - public ApiResponse< string > FakeOuterStringSerializeWithHttpInfo (string body = null) + public ApiResponse FakeOuterStringSerializeWithHttpInfo (string body = default(string)) { var localVarPath = "/fake/outer/string"; @@ -987,7 +987,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient body) + public ApiResponse TestClientModelWithHttpInfo (ModelClient body) { // verify the required parameter 'body' is set if (body == null) @@ -1062,7 +1062,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// - public void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + public void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)) { TestEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); } @@ -1086,7 +1086,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// ApiResponse of Object(void) - public ApiResponse TestEndpointParametersWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + public ApiResponse TestEndpointParametersWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)) { // verify the required parameter 'number' is set if (number == null) @@ -1175,7 +1175,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// - public void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) + public void TestEnumParameters (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)) { TestEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } @@ -1193,7 +1193,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// ApiResponse of Object(void) - public ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) + public ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)) { var localVarPath = "/fake"; @@ -1256,7 +1256,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// - public void TestGroupParameters (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + public void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)) { TestGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } @@ -1272,7 +1272,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// ApiResponse of Object(void) - public ApiResponse TestGroupParametersWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + public ApiResponse TestGroupParametersWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)) { // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup == null) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 239dafb914f..aadad06beca 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -174,7 +174,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient body) + public ApiResponse TestClassnameWithHttpInfo (ModelClient body) { // verify the required parameter 'body' is set if (body == null) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/PetApi.cs index f9413810c03..77f5c415633 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/PetApi.cs @@ -55,7 +55,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// - void DeletePet (long? petId, string apiKey = null); + void DeletePet (long petId, string apiKey = default(string)); /// /// Deletes a pet @@ -67,7 +67,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// ApiResponse of Object(void) - ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = null); + ApiResponse DeletePetWithHttpInfo (long petId, string apiKey = default(string)); /// /// Finds Pets by status /// @@ -119,7 +119,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Pet - Pet GetPetById (long? petId); + Pet GetPetById (long petId); /// /// Find pet by ID @@ -130,7 +130,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// ApiResponse of Pet - ApiResponse GetPetByIdWithHttpInfo (long? petId); + ApiResponse GetPetByIdWithHttpInfo (long petId); /// /// Update an existing pet /// @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// - void UpdatePetWithForm (long? petId, string name = null, string status = null); + void UpdatePetWithForm (long petId, string name = default(string), string status = default(string)); /// /// Updates a pet in the store with form data @@ -176,7 +176,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// ApiResponse of Object(void) - ApiResponse UpdatePetWithFormWithHttpInfo (long? petId, string name = null, string status = null); + ApiResponse UpdatePetWithFormWithHttpInfo (long petId, string name = default(string), string status = default(string)); /// /// uploads an image /// @@ -188,7 +188,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse - ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + ApiResponse UploadFile (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); /// /// uploads an image @@ -201,7 +201,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse of ApiResponse - ApiResponse UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + ApiResponse UploadFileWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); /// /// uploads an image (required) /// @@ -213,7 +213,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// ApiResponse - ApiResponse UploadFileWithRequiredFile (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null); + ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); /// /// uploads an image (required) @@ -226,7 +226,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// ApiResponse of ApiResponse - ApiResponse UploadFileWithRequiredFileWithHttpInfo (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null); + ApiResponse UploadFileWithRequiredFileWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); #endregion Synchronous Operations } @@ -424,7 +424,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// - public void DeletePet (long? petId, string apiKey = null) + public void DeletePet (long petId, string apiKey = default(string)) { DeletePetWithHttpInfo(petId, apiKey); } @@ -436,7 +436,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// ApiResponse of Object(void) - public ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = null) + public ApiResponse DeletePetWithHttpInfo (long petId, string apiKey = default(string)) { // verify the required parameter 'petId' is set if (petId == null) @@ -508,7 +508,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Status values that need to be considered for filter /// ApiResponse of List<Pet> - public ApiResponse< List > FindPetsByStatusWithHttpInfo (List status) + public ApiResponse> FindPetsByStatusWithHttpInfo (List status) { // verify the required parameter 'status' is set if (status == null) @@ -581,7 +581,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Tags to filter by /// ApiResponse of List<Pet> - public ApiResponse< List > FindPetsByTagsWithHttpInfo (List tags) + public ApiResponse> FindPetsByTagsWithHttpInfo (List tags) { // verify the required parameter 'tags' is set if (tags == null) @@ -642,7 +642,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Pet - public Pet GetPetById (long? petId) + public Pet GetPetById (long petId) { ApiResponse localVarResponse = GetPetByIdWithHttpInfo(petId); return localVarResponse.Data; @@ -654,7 +654,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// ApiResponse of Pet - public ApiResponse< Pet > GetPetByIdWithHttpInfo (long? petId) + public ApiResponse GetPetByIdWithHttpInfo (long petId) { // verify the required parameter 'petId' is set if (petId == null) @@ -795,7 +795,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// - public void UpdatePetWithForm (long? petId, string name = null, string status = null) + public void UpdatePetWithForm (long petId, string name = default(string), string status = default(string)) { UpdatePetWithFormWithHttpInfo(petId, name, status); } @@ -808,7 +808,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// ApiResponse of Object(void) - public ApiResponse UpdatePetWithFormWithHttpInfo (long? petId, string name = null, string status = null) + public ApiResponse UpdatePetWithFormWithHttpInfo (long petId, string name = default(string), string status = default(string)) { // verify the required parameter 'petId' is set if (petId == null) @@ -872,7 +872,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse - public ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public ApiResponse UploadFile (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) { ApiResponse localVarResponse = UploadFileWithHttpInfo(petId, additionalMetadata, file); return localVarResponse.Data; @@ -886,7 +886,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse of ApiResponse - public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public ApiResponse UploadFileWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) { // verify the required parameter 'petId' is set if (petId == null) @@ -951,7 +951,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// ApiResponse - public ApiResponse UploadFileWithRequiredFile (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) + public ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) { ApiResponse localVarResponse = UploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata); return localVarResponse.Data; @@ -965,7 +965,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// ApiResponse of ApiResponse - public ApiResponse< ApiResponse > UploadFileWithRequiredFileWithHttpInfo (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) + public ApiResponse UploadFileWithRequiredFileWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) { // verify the required parameter 'petId' is set if (petId == null) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/StoreApi.cs index 49bf78ae6ae..4405efb0a0f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/StoreApi.cs @@ -52,8 +52,8 @@ namespace Org.OpenAPITools.Api /// Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Dictionary<string, int?> - Dictionary GetInventory (); + /// Dictionary<string, int> + Dictionary GetInventory (); /// /// Returns pet inventories by status @@ -62,8 +62,8 @@ namespace Org.OpenAPITools.Api /// Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// ApiResponse of Dictionary<string, int?> - ApiResponse> GetInventoryWithHttpInfo (); + /// ApiResponse of Dictionary<string, int> + ApiResponse> GetInventoryWithHttpInfo (); /// /// Find purchase order by ID /// @@ -73,7 +73,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Order - Order GetOrderById (long? orderId); + Order GetOrderById (long orderId); /// /// Find purchase order by ID @@ -84,7 +84,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// ApiResponse of Order - ApiResponse GetOrderByIdWithHttpInfo (long? orderId); + ApiResponse GetOrderByIdWithHttpInfo (long orderId); /// /// Place an order for a pet /// @@ -285,10 +285,10 @@ namespace Org.OpenAPITools.Api /// Returns pet inventories by status Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Dictionary<string, int?> - public Dictionary GetInventory () + /// Dictionary<string, int> + public Dictionary GetInventory () { - ApiResponse> localVarResponse = GetInventoryWithHttpInfo(); + ApiResponse> localVarResponse = GetInventoryWithHttpInfo(); return localVarResponse.Data; } @@ -296,8 +296,8 @@ namespace Org.OpenAPITools.Api /// Returns pet inventories by status Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// ApiResponse of Dictionary<string, int?> - public ApiResponse< Dictionary > GetInventoryWithHttpInfo () + /// ApiResponse of Dictionary<string, int> + public ApiResponse> GetInventoryWithHttpInfo () { var localVarPath = "/store/inventory"; @@ -341,9 +341,9 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse>(localVarStatusCode, + return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); + (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); } /// @@ -352,7 +352,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Order - public Order GetOrderById (long? orderId) + public Order GetOrderById (long orderId) { ApiResponse localVarResponse = GetOrderByIdWithHttpInfo(orderId); return localVarResponse.Data; @@ -364,7 +364,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// ApiResponse of Order - public ApiResponse< Order > GetOrderByIdWithHttpInfo (long? orderId) + public ApiResponse GetOrderByIdWithHttpInfo (long orderId) { // verify the required parameter 'orderId' is set if (orderId == null) @@ -431,7 +431,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// order placed for purchasing the pet /// ApiResponse of Order - public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body) + public ApiResponse PlaceOrderWithHttpInfo (Order body) { // verify the required parameter 'body' is set if (body == null) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/UserApi.cs index 818fb173f61..c6a3044ece2 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Api/UserApi.cs @@ -600,7 +600,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// The name that needs to be fetched. Use user1 for testing. /// ApiResponse of User - public ApiResponse< User > GetUserByNameWithHttpInfo (string username) + public ApiResponse GetUserByNameWithHttpInfo (string username) { // verify the required parameter 'username' is set if (username == null) @@ -669,7 +669,7 @@ namespace Org.OpenAPITools.Api /// The user name for login /// The password for login in clear text /// ApiResponse of string - public ApiResponse< string > LoginUserWithHttpInfo (string username, string password) + public ApiResponse LoginUserWithHttpInfo (string username, string password) { // verify the required parameter 'username' is set if (username == null) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs index cc42cdc1d59..080909b2860 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs @@ -28,7 +28,7 @@ namespace Org.OpenAPITools.Model /// AdditionalPropertiesBoolean /// [DataContract] - public partial class AdditionalPropertiesBoolean : Dictionary, IEquatable + public partial class AdditionalPropertiesBoolean : Dictionary, IEquatable { /// /// Initializes a new instance of the class. diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 98b18506134..d56cf173ddf 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -44,7 +44,7 @@ namespace Org.OpenAPITools.Model /// anytype1. /// anytype2. /// anytype3. - public AdditionalPropertiesClass(Dictionary mapString = default(Dictionary), Dictionary mapNumber = default(Dictionary), Dictionary mapInteger = default(Dictionary), Dictionary mapBoolean = default(Dictionary), Dictionary> mapArrayInteger = default(Dictionary>), Dictionary> mapArrayAnytype = default(Dictionary>), Dictionary> mapMapString = default(Dictionary>), Dictionary> mapMapAnytype = default(Dictionary>), Object anytype1 = default(Object), Object anytype2 = default(Object), Object anytype3 = default(Object)) + public AdditionalPropertiesClass(Dictionary mapString = default(Dictionary), Dictionary mapNumber = default(Dictionary), Dictionary mapInteger = default(Dictionary), Dictionary mapBoolean = default(Dictionary), Dictionary> mapArrayInteger = default(Dictionary>), Dictionary> mapArrayAnytype = default(Dictionary>), Dictionary> mapMapString = default(Dictionary>), Dictionary> mapMapAnytype = default(Dictionary>), Object anytype1 = default(Object), Object anytype2 = default(Object), Object anytype3 = default(Object)) { this.MapString = mapString; this.MapNumber = mapNumber; @@ -69,25 +69,25 @@ namespace Org.OpenAPITools.Model /// Gets or Sets MapNumber /// [DataMember(Name="map_number", EmitDefaultValue=false)] - public Dictionary MapNumber { get; set; } + public Dictionary MapNumber { get; set; } /// /// Gets or Sets MapInteger /// [DataMember(Name="map_integer", EmitDefaultValue=false)] - public Dictionary MapInteger { get; set; } + public Dictionary MapInteger { get; set; } /// /// Gets or Sets MapBoolean /// [DataMember(Name="map_boolean", EmitDefaultValue=false)] - public Dictionary MapBoolean { get; set; } + public Dictionary MapBoolean { get; set; } /// /// Gets or Sets MapArrayInteger /// [DataMember(Name="map_array_integer", EmitDefaultValue=false)] - public Dictionary> MapArrayInteger { get; set; } + public Dictionary> MapArrayInteger { get; set; } /// /// Gets or Sets MapArrayAnytype diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs index 815d32d51a6..84bfecd9db5 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs @@ -28,7 +28,7 @@ namespace Org.OpenAPITools.Model /// AdditionalPropertiesInteger /// [DataContract] - public partial class AdditionalPropertiesInteger : Dictionary, IEquatable + public partial class AdditionalPropertiesInteger : Dictionary, IEquatable { /// /// Initializes a new instance of the class. diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs index 9e9437dbb79..08aeaad1d49 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs @@ -28,7 +28,7 @@ namespace Org.OpenAPITools.Model /// AdditionalPropertiesNumber /// [DataContract] - public partial class AdditionalPropertiesNumber : Dictionary, IEquatable + public partial class AdditionalPropertiesNumber : Dictionary, IEquatable { /// /// Initializes a new instance of the class. diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/ApiResponse.cs index 5792ae8a10d..049a80493a1 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -36,7 +36,7 @@ namespace Org.OpenAPITools.Model /// code. /// type. /// message. - public ApiResponse(int? code = default(int?), string type = default(string), string message = default(string)) + public ApiResponse(int code = default(int), string type = default(string), string message = default(string)) { this.Code = code; this.Type = type; @@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Code /// [DataMember(Name="code", EmitDefaultValue=false)] - public int? Code { get; set; } + public int Code { get; set; } /// /// Gets or Sets Type diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 809bec26765..3e8a9d91972 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -34,7 +34,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// arrayArrayNumber. - public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber = default(List>)) + public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber = default(List>)) { this.ArrayArrayNumber = arrayArrayNumber; } @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets ArrayArrayNumber /// [DataMember(Name="ArrayArrayNumber", EmitDefaultValue=false)] - public List> ArrayArrayNumber { get; set; } + public List> ArrayArrayNumber { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 169674bf0e2..1df8accf895 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -34,7 +34,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// arrayNumber. - public ArrayOfNumberOnly(List arrayNumber = default(List)) + public ArrayOfNumberOnly(List arrayNumber = default(List)) { this.ArrayNumber = arrayNumber; } @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets ArrayNumber /// [DataMember(Name="ArrayNumber", EmitDefaultValue=false)] - public List ArrayNumber { get; set; } + public List ArrayNumber { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/ArrayTest.cs index 1cd33865f72..0ad2d15a52f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -36,7 +36,7 @@ namespace Org.OpenAPITools.Model /// arrayOfString. /// arrayArrayOfInteger. /// arrayArrayOfModel. - public ArrayTest(List arrayOfString = default(List), List> arrayArrayOfInteger = default(List>), List> arrayArrayOfModel = default(List>)) + public ArrayTest(List arrayOfString = default(List), List> arrayArrayOfInteger = default(List>), List> arrayArrayOfModel = default(List>)) { this.ArrayOfString = arrayOfString; this.ArrayArrayOfInteger = arrayArrayOfInteger; @@ -53,7 +53,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets ArrayArrayOfInteger /// [DataMember(Name="array_array_of_integer", EmitDefaultValue=false)] - public List> ArrayArrayOfInteger { get; set; } + public List> ArrayArrayOfInteger { get; set; } /// /// Gets or Sets ArrayArrayOfModel diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Cat.cs index 4eed9cb028d..036ed97c89e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Cat.cs @@ -39,7 +39,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// declawed. - public Cat(bool? declawed = default(bool?), string className = default(string), string color = "red") : base(className, color) + public Cat(bool declawed = default(bool), string className = default(string), string color = "red") : base(className, color) { this.Declawed = declawed; } @@ -48,7 +48,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Declawed /// [DataMember(Name="declawed", EmitDefaultValue=false)] - public bool? Declawed { get; set; } + public bool Declawed { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/CatAllOf.cs index c29f4154b22..44294da9380 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/CatAllOf.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -34,7 +34,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// declawed. - public CatAllOf(bool? declawed = default(bool?)) + public CatAllOf(bool declawed = default(bool)) { this.Declawed = declawed; } @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Declawed /// [DataMember(Name="declawed", EmitDefaultValue=false)] - public bool? Declawed { get; set; } + public bool Declawed { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Category.cs index d80ae817b51..34612d86007 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Category.cs @@ -40,7 +40,7 @@ namespace Org.OpenAPITools.Model /// /// id. /// name (required) (default to "default-name"). - public Category(long? id = default(long?), string name = "default-name") + public Category(long id = default(long), string name = "default-name") { // to ensure "name" is required (not null) if (name == null) @@ -59,7 +59,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Name diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/FormatTest.cs index 25daf7c7743..41aa19a8acb 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/FormatTest.cs @@ -51,7 +51,7 @@ namespace Org.OpenAPITools.Model /// dateTime. /// uuid. /// password (required). - public FormatTest(int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), decimal? number = default(decimal?), float? _float = default(float?), double? _double = default(double?), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), Guid? uuid = default(Guid?), string password = default(string)) + public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string)) { // to ensure "number" is required (not null) if (number == null) @@ -108,37 +108,37 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Integer /// [DataMember(Name="integer", EmitDefaultValue=false)] - public int? Integer { get; set; } + public int Integer { get; set; } /// /// Gets or Sets Int32 /// [DataMember(Name="int32", EmitDefaultValue=false)] - public int? Int32 { get; set; } + public int Int32 { get; set; } /// /// Gets or Sets Int64 /// [DataMember(Name="int64", EmitDefaultValue=false)] - public long? Int64 { get; set; } + public long Int64 { get; set; } /// /// Gets or Sets Number /// [DataMember(Name="number", EmitDefaultValue=false)] - public decimal? Number { get; set; } + public decimal Number { get; set; } /// /// Gets or Sets Float /// [DataMember(Name="float", EmitDefaultValue=false)] - public float? Float { get; set; } + public float Float { get; set; } /// /// Gets or Sets Double /// [DataMember(Name="double", EmitDefaultValue=false)] - public double? Double { get; set; } + public double Double { get; set; } /// /// Gets or Sets String @@ -163,19 +163,19 @@ namespace Org.OpenAPITools.Model /// [DataMember(Name="date", EmitDefaultValue=false)] [JsonConverter(typeof(OpenAPIDateConverter))] - public DateTime? Date { get; set; } + public DateTime Date { get; set; } /// /// Gets or Sets DateTime /// [DataMember(Name="dateTime", EmitDefaultValue=false)] - public DateTime? DateTime { get; set; } + public DateTime DateTime { get; set; } /// /// Gets or Sets Uuid /// [DataMember(Name="uuid", EmitDefaultValue=false)] - public Guid? Uuid { get; set; } + public Guid Uuid { get; set; } /// /// Gets or Sets Password diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/MapTest.cs index 22a5518ea77..e1f51997533 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/MapTest.cs @@ -63,7 +63,7 @@ namespace Org.OpenAPITools.Model /// mapOfEnumString. /// directMap. /// indirectMap. - public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary), Dictionary directMap = default(Dictionary), Dictionary indirectMap = default(Dictionary)) + public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary), Dictionary directMap = default(Dictionary), Dictionary indirectMap = default(Dictionary)) { this.MapMapOfString = mapMapOfString; this.MapOfEnumString = mapOfEnumString; @@ -82,13 +82,13 @@ namespace Org.OpenAPITools.Model /// Gets or Sets DirectMap /// [DataMember(Name="direct_map", EmitDefaultValue=false)] - public Dictionary DirectMap { get; set; } + public Dictionary DirectMap { get; set; } /// /// Gets or Sets IndirectMap /// [DataMember(Name="indirect_map", EmitDefaultValue=false)] - public Dictionary IndirectMap { get; set; } + public Dictionary IndirectMap { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index aa3345e1d98..d93339d98d9 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -36,7 +36,7 @@ namespace Org.OpenAPITools.Model /// uuid. /// dateTime. /// map. - public MixedPropertiesAndAdditionalPropertiesClass(Guid? uuid = default(Guid?), DateTime? dateTime = default(DateTime?), Dictionary map = default(Dictionary)) + public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) { this.Uuid = uuid; this.DateTime = dateTime; @@ -47,13 +47,13 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Uuid /// [DataMember(Name="uuid", EmitDefaultValue=false)] - public Guid? Uuid { get; set; } + public Guid Uuid { get; set; } /// /// Gets or Sets DateTime /// [DataMember(Name="dateTime", EmitDefaultValue=false)] - public DateTime? DateTime { get; set; } + public DateTime DateTime { get; set; } /// /// Gets or Sets Map diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Model200Response.cs index 450c50836a4..d50997f9fe1 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Model200Response.cs @@ -35,7 +35,7 @@ namespace Org.OpenAPITools.Model /// /// name. /// _class. - public Model200Response(int? name = default(int?), string _class = default(string)) + public Model200Response(int name = default(int), string _class = default(string)) { this.Name = name; this.Class = _class; @@ -45,7 +45,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Name /// [DataMember(Name="name", EmitDefaultValue=false)] - public int? Name { get; set; } + public int Name { get; set; } /// /// Gets or Sets Class diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Name.cs index 164e7a4b991..948ed5889cc 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Name.cs @@ -40,7 +40,7 @@ namespace Org.OpenAPITools.Model /// /// name (required). /// property. - public Name(int? name = default(int?), string property = default(string)) + public Name(int name = default(int), string property = default(string)) { // to ensure "name" is required (not null) if (name == null) @@ -59,13 +59,13 @@ namespace Org.OpenAPITools.Model /// Gets or Sets _Name /// [DataMember(Name="name", EmitDefaultValue=false)] - public int? _Name { get; set; } + public int _Name { get; set; } /// /// Gets or Sets SnakeCase /// [DataMember(Name="snake_case", EmitDefaultValue=false)] - public int? SnakeCase { get; private set; } + public int SnakeCase { get; private set; } /// /// Gets or Sets Property @@ -77,7 +77,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets _123Number /// [DataMember(Name="123Number", EmitDefaultValue=false)] - public int? _123Number { get; private set; } + public int _123Number { get; private set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/NumberOnly.cs index 09e3dacc363..465fac92f9c 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -34,7 +34,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// justNumber. - public NumberOnly(decimal? justNumber = default(decimal?)) + public NumberOnly(decimal justNumber = default(decimal)) { this.JustNumber = justNumber; } @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets JustNumber /// [DataMember(Name="JustNumber", EmitDefaultValue=false)] - public decimal? JustNumber { get; set; } + public decimal JustNumber { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Order.cs index 4bee5ab82d4..927133c3f63 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Order.cs @@ -72,7 +72,7 @@ namespace Org.OpenAPITools.Model /// shipDate. /// Order Status. /// complete (default to false). - public Order(long? id = default(long?), long? petId = default(long?), int? quantity = default(int?), DateTime? shipDate = default(DateTime?), StatusEnum? status = default(StatusEnum?), bool? complete = false) + public Order(long id = default(long), long petId = default(long), int quantity = default(int), DateTime shipDate = default(DateTime), StatusEnum? status = default(StatusEnum?), bool complete = false) { this.Id = id; this.PetId = petId; @@ -94,32 +94,32 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets PetId /// [DataMember(Name="petId", EmitDefaultValue=false)] - public long? PetId { get; set; } + public long PetId { get; set; } /// /// Gets or Sets Quantity /// [DataMember(Name="quantity", EmitDefaultValue=false)] - public int? Quantity { get; set; } + public int Quantity { get; set; } /// /// Gets or Sets ShipDate /// [DataMember(Name="shipDate", EmitDefaultValue=false)] - public DateTime? ShipDate { get; set; } + public DateTime ShipDate { get; set; } /// /// Gets or Sets Complete /// [DataMember(Name="complete", EmitDefaultValue=false)] - public bool? Complete { get; set; } + public bool Complete { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/OuterComposite.cs index 90db696ba1d..e28ea0f8c13 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -36,7 +36,7 @@ namespace Org.OpenAPITools.Model /// myNumber. /// myString. /// myBoolean. - public OuterComposite(decimal? myNumber = default(decimal?), string myString = default(string), bool? myBoolean = default(bool?)) + public OuterComposite(decimal myNumber = default(decimal), string myString = default(string), bool myBoolean = default(bool)) { this.MyNumber = myNumber; this.MyString = myString; @@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets MyNumber /// [DataMember(Name="my_number", EmitDefaultValue=false)] - public decimal? MyNumber { get; set; } + public decimal MyNumber { get; set; } /// /// Gets or Sets MyString @@ -59,7 +59,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets MyBoolean /// [DataMember(Name="my_boolean", EmitDefaultValue=false)] - public bool? MyBoolean { get; set; } + public bool MyBoolean { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Pet.cs index 6438aab75fb..c9994c453aa 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Pet.cs @@ -77,7 +77,7 @@ namespace Org.OpenAPITools.Model /// photoUrls (required). /// tags. /// pet status in the store. - public Pet(long? id = default(long?), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) + public Pet(long id = default(long), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) { // to ensure "name" is required (not null) if (name == null) @@ -109,7 +109,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Category diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Return.cs index 6a8b71bd45d..2c74f50eddb 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Return.cs @@ -34,7 +34,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// _return. - public Return(int? _return = default(int?)) + public Return(int _return = default(int)) { this._Return = _return; } @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets _Return /// [DataMember(Name="return", EmitDefaultValue=false)] - public int? _Return { get; set; } + public int _Return { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/SpecialModelName.cs index 5528fbc994c..7e0ffbb1c26 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -34,7 +34,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// specialPropertyName. - public SpecialModelName(long? specialPropertyName = default(long?)) + public SpecialModelName(long specialPropertyName = default(long)) { this.SpecialPropertyName = specialPropertyName; } @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets SpecialPropertyName /// [DataMember(Name="$special[property.name]", EmitDefaultValue=false)] - public long? SpecialPropertyName { get; set; } + public long SpecialPropertyName { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Tag.cs index 281c4dc2dd9..9acc8c9a8df 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Tag.cs @@ -35,7 +35,7 @@ namespace Org.OpenAPITools.Model /// /// id. /// name. - public Tag(long? id = default(long?), string name = default(string)) + public Tag(long id = default(long), string name = default(string)) { this.Id = id; this.Name = name; @@ -45,7 +45,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Name diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/TypeHolderDefault.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/TypeHolderDefault.cs index e5002e562ed..00789fba4d7 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/TypeHolderDefault.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/TypeHolderDefault.cs @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// integerItem (required). /// boolItem (required) (default to true). /// arrayItem (required). - public TypeHolderDefault(string stringItem = "what", decimal? numberItem = default(decimal?), int? integerItem = default(int?), bool? boolItem = true, List arrayItem = default(List)) + public TypeHolderDefault(string stringItem = "what", decimal numberItem = default(decimal), int integerItem = default(int), bool boolItem = true, List arrayItem = default(List)) { // to ensure "stringItem" is required (not null) if (stringItem == null) @@ -107,25 +107,25 @@ namespace Org.OpenAPITools.Model /// Gets or Sets NumberItem /// [DataMember(Name="number_item", EmitDefaultValue=false)] - public decimal? NumberItem { get; set; } + public decimal NumberItem { get; set; } /// /// Gets or Sets IntegerItem /// [DataMember(Name="integer_item", EmitDefaultValue=false)] - public int? IntegerItem { get; set; } + public int IntegerItem { get; set; } /// /// Gets or Sets BoolItem /// [DataMember(Name="bool_item", EmitDefaultValue=false)] - public bool? BoolItem { get; set; } + public bool BoolItem { get; set; } /// /// Gets or Sets ArrayItem /// [DataMember(Name="array_item", EmitDefaultValue=false)] - public List ArrayItem { get; set; } + public List ArrayItem { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/TypeHolderExample.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/TypeHolderExample.cs index 78e317bdfe7..d25dd01e456 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/TypeHolderExample.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/TypeHolderExample.cs @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// integerItem (required). /// boolItem (required). /// arrayItem (required). - public TypeHolderExample(string stringItem = default(string), decimal? numberItem = default(decimal?), int? integerItem = default(int?), bool? boolItem = default(bool?), List arrayItem = default(List)) + public TypeHolderExample(string stringItem = default(string), decimal numberItem = default(decimal), int integerItem = default(int), bool boolItem = default(bool), List arrayItem = default(List)) { // to ensure "stringItem" is required (not null) if (stringItem == null) @@ -107,25 +107,25 @@ namespace Org.OpenAPITools.Model /// Gets or Sets NumberItem /// [DataMember(Name="number_item", EmitDefaultValue=false)] - public decimal? NumberItem { get; set; } + public decimal NumberItem { get; set; } /// /// Gets or Sets IntegerItem /// [DataMember(Name="integer_item", EmitDefaultValue=false)] - public int? IntegerItem { get; set; } + public int IntegerItem { get; set; } /// /// Gets or Sets BoolItem /// [DataMember(Name="bool_item", EmitDefaultValue=false)] - public bool? BoolItem { get; set; } + public bool BoolItem { get; set; } /// /// Gets or Sets ArrayItem /// [DataMember(Name="array_item", EmitDefaultValue=false)] - public List ArrayItem { get; set; } + public List ArrayItem { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/User.cs index d8b52ce4221..a4b150d971d 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/User.cs @@ -41,7 +41,7 @@ namespace Org.OpenAPITools.Model /// password. /// phone. /// User Status. - public User(long? id = default(long?), string username = default(string), string firstName = default(string), string lastName = default(string), string email = default(string), string password = default(string), string phone = default(string), int? userStatus = default(int?)) + public User(long id = default(long), string username = default(string), string firstName = default(string), string lastName = default(string), string email = default(string), string password = default(string), string phone = default(string), int userStatus = default(int)) { this.Id = id; this.Username = username; @@ -57,7 +57,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Username @@ -100,7 +100,7 @@ namespace Org.OpenAPITools.Model /// /// User Status [DataMember(Name="userStatus", EmitDefaultValue=false)] - public int? UserStatus { get; set; } + public int UserStatus { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/XmlItem.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/XmlItem.cs index c07a13af9d2..ee836a55fc9 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/XmlItem.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/XmlItem.cs @@ -62,7 +62,7 @@ namespace Org.OpenAPITools.Model /// prefixNsBoolean. /// prefixNsArray. /// prefixNsWrappedArray. - public XmlItem(string attributeString = default(string), decimal? attributeNumber = default(decimal?), int? attributeInteger = default(int?), bool? attributeBoolean = default(bool?), List wrappedArray = default(List), string nameString = default(string), decimal? nameNumber = default(decimal?), int? nameInteger = default(int?), bool? nameBoolean = default(bool?), List nameArray = default(List), List nameWrappedArray = default(List), string prefixString = default(string), decimal? prefixNumber = default(decimal?), int? prefixInteger = default(int?), bool? prefixBoolean = default(bool?), List prefixArray = default(List), List prefixWrappedArray = default(List), string namespaceString = default(string), decimal? namespaceNumber = default(decimal?), int? namespaceInteger = default(int?), bool? namespaceBoolean = default(bool?), List namespaceArray = default(List), List namespaceWrappedArray = default(List), string prefixNsString = default(string), decimal? prefixNsNumber = default(decimal?), int? prefixNsInteger = default(int?), bool? prefixNsBoolean = default(bool?), List prefixNsArray = default(List), List prefixNsWrappedArray = default(List)) + public XmlItem(string attributeString = default(string), decimal attributeNumber = default(decimal), int attributeInteger = default(int), bool attributeBoolean = default(bool), List wrappedArray = default(List), string nameString = default(string), decimal nameNumber = default(decimal), int nameInteger = default(int), bool nameBoolean = default(bool), List nameArray = default(List), List nameWrappedArray = default(List), string prefixString = default(string), decimal prefixNumber = default(decimal), int prefixInteger = default(int), bool prefixBoolean = default(bool), List prefixArray = default(List), List prefixWrappedArray = default(List), string namespaceString = default(string), decimal namespaceNumber = default(decimal), int namespaceInteger = default(int), bool namespaceBoolean = default(bool), List namespaceArray = default(List), List namespaceWrappedArray = default(List), string prefixNsString = default(string), decimal prefixNsNumber = default(decimal), int prefixNsInteger = default(int), bool prefixNsBoolean = default(bool), List prefixNsArray = default(List), List prefixNsWrappedArray = default(List)) { this.AttributeString = attributeString; this.AttributeNumber = attributeNumber; @@ -105,25 +105,25 @@ namespace Org.OpenAPITools.Model /// Gets or Sets AttributeNumber /// [DataMember(Name="attribute_number", EmitDefaultValue=false)] - public decimal? AttributeNumber { get; set; } + public decimal AttributeNumber { get; set; } /// /// Gets or Sets AttributeInteger /// [DataMember(Name="attribute_integer", EmitDefaultValue=false)] - public int? AttributeInteger { get; set; } + public int AttributeInteger { get; set; } /// /// Gets or Sets AttributeBoolean /// [DataMember(Name="attribute_boolean", EmitDefaultValue=false)] - public bool? AttributeBoolean { get; set; } + public bool AttributeBoolean { get; set; } /// /// Gets or Sets WrappedArray /// [DataMember(Name="wrapped_array", EmitDefaultValue=false)] - public List WrappedArray { get; set; } + public List WrappedArray { get; set; } /// /// Gets or Sets NameString @@ -135,31 +135,31 @@ namespace Org.OpenAPITools.Model /// Gets or Sets NameNumber /// [DataMember(Name="name_number", EmitDefaultValue=false)] - public decimal? NameNumber { get; set; } + public decimal NameNumber { get; set; } /// /// Gets or Sets NameInteger /// [DataMember(Name="name_integer", EmitDefaultValue=false)] - public int? NameInteger { get; set; } + public int NameInteger { get; set; } /// /// Gets or Sets NameBoolean /// [DataMember(Name="name_boolean", EmitDefaultValue=false)] - public bool? NameBoolean { get; set; } + public bool NameBoolean { get; set; } /// /// Gets or Sets NameArray /// [DataMember(Name="name_array", EmitDefaultValue=false)] - public List NameArray { get; set; } + public List NameArray { get; set; } /// /// Gets or Sets NameWrappedArray /// [DataMember(Name="name_wrapped_array", EmitDefaultValue=false)] - public List NameWrappedArray { get; set; } + public List NameWrappedArray { get; set; } /// /// Gets or Sets PrefixString @@ -171,31 +171,31 @@ namespace Org.OpenAPITools.Model /// Gets or Sets PrefixNumber /// [DataMember(Name="prefix_number", EmitDefaultValue=false)] - public decimal? PrefixNumber { get; set; } + public decimal PrefixNumber { get; set; } /// /// Gets or Sets PrefixInteger /// [DataMember(Name="prefix_integer", EmitDefaultValue=false)] - public int? PrefixInteger { get; set; } + public int PrefixInteger { get; set; } /// /// Gets or Sets PrefixBoolean /// [DataMember(Name="prefix_boolean", EmitDefaultValue=false)] - public bool? PrefixBoolean { get; set; } + public bool PrefixBoolean { get; set; } /// /// Gets or Sets PrefixArray /// [DataMember(Name="prefix_array", EmitDefaultValue=false)] - public List PrefixArray { get; set; } + public List PrefixArray { get; set; } /// /// Gets or Sets PrefixWrappedArray /// [DataMember(Name="prefix_wrapped_array", EmitDefaultValue=false)] - public List PrefixWrappedArray { get; set; } + public List PrefixWrappedArray { get; set; } /// /// Gets or Sets NamespaceString @@ -207,31 +207,31 @@ namespace Org.OpenAPITools.Model /// Gets or Sets NamespaceNumber /// [DataMember(Name="namespace_number", EmitDefaultValue=false)] - public decimal? NamespaceNumber { get; set; } + public decimal NamespaceNumber { get; set; } /// /// Gets or Sets NamespaceInteger /// [DataMember(Name="namespace_integer", EmitDefaultValue=false)] - public int? NamespaceInteger { get; set; } + public int NamespaceInteger { get; set; } /// /// Gets or Sets NamespaceBoolean /// [DataMember(Name="namespace_boolean", EmitDefaultValue=false)] - public bool? NamespaceBoolean { get; set; } + public bool NamespaceBoolean { get; set; } /// /// Gets or Sets NamespaceArray /// [DataMember(Name="namespace_array", EmitDefaultValue=false)] - public List NamespaceArray { get; set; } + public List NamespaceArray { get; set; } /// /// Gets or Sets NamespaceWrappedArray /// [DataMember(Name="namespace_wrapped_array", EmitDefaultValue=false)] - public List NamespaceWrappedArray { get; set; } + public List NamespaceWrappedArray { get; set; } /// /// Gets or Sets PrefixNsString @@ -243,31 +243,31 @@ namespace Org.OpenAPITools.Model /// Gets or Sets PrefixNsNumber /// [DataMember(Name="prefix_ns_number", EmitDefaultValue=false)] - public decimal? PrefixNsNumber { get; set; } + public decimal PrefixNsNumber { get; set; } /// /// Gets or Sets PrefixNsInteger /// [DataMember(Name="prefix_ns_integer", EmitDefaultValue=false)] - public int? PrefixNsInteger { get; set; } + public int PrefixNsInteger { get; set; } /// /// Gets or Sets PrefixNsBoolean /// [DataMember(Name="prefix_ns_boolean", EmitDefaultValue=false)] - public bool? PrefixNsBoolean { get; set; } + public bool PrefixNsBoolean { get; set; } /// /// Gets or Sets PrefixNsArray /// [DataMember(Name="prefix_ns_array", EmitDefaultValue=false)] - public List PrefixNsArray { get; set; } + public List PrefixNsArray { get; set; } /// /// Gets or Sets PrefixNsWrappedArray /// [DataMember(Name="prefix_ns_wrapped_array", EmitDefaultValue=false)] - public List PrefixNsWrappedArray { get; set; } + public List PrefixNsWrappedArray { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientNet40/.openapi-generator/VERSION index 06b5019af3f..83a328a9227 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/README.md b/samples/client/petstore/csharp/OpenAPIClientNet40/README.md index 6319d9193e9..dcdb39631c5 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/README.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/README.md @@ -64,7 +64,7 @@ Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-p ## Getting Started ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -74,10 +74,11 @@ namespace Example { public class Example { - public void main() + public static void Main() { - var apiInstance = new AnotherFakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(Configuration.Default); var body = new ModelClient(); // ModelClient | client model try @@ -86,9 +87,11 @@ namespace Example ModelClient result = apiInstance.Call123TestSpecialTags(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/AdditionalPropertiesClass.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/AdditionalPropertiesClass.md index 32d7ffc7653..d07f57619d5 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/AdditionalPropertiesClass.md @@ -6,10 +6,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **MapString** | **Dictionary<string, string>** | | [optional] -**MapNumber** | **Dictionary<string, decimal?>** | | [optional] -**MapInteger** | **Dictionary<string, int?>** | | [optional] -**MapBoolean** | **Dictionary<string, bool?>** | | [optional] -**MapArrayInteger** | **Dictionary<string, List<int?>>** | | [optional] +**MapNumber** | **Dictionary<string, decimal>** | | [optional] +**MapInteger** | **Dictionary<string, int>** | | [optional] +**MapBoolean** | **Dictionary<string, bool>** | | [optional] +**MapArrayInteger** | **Dictionary<string, List<int>>** | | [optional] **MapArrayAnytype** | **Dictionary<string, List<Object>>** | | [optional] **MapMapString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] **MapMapAnytype** | **Dictionary<string, Dictionary<string, Object>>** | | [optional] diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/AnotherFakeApi.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/AnotherFakeApi.md index d13566caf34..5af41a1862c 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/AnotherFakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/AnotherFakeApi.md @@ -19,7 +19,7 @@ To test special tags and operation ID starting with number ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -29,9 +29,10 @@ namespace Example { public class Call123TestSpecialTagsExample { - public void main() + public static void Main() { - var apiInstance = new AnotherFakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(Configuration.Default); var body = new ModelClient(); // ModelClient | client model try @@ -40,9 +41,11 @@ namespace Example ModelClient result = apiInstance.Call123TestSpecialTags(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -69,6 +72,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/ApiResponse.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/ApiResponse.md index e16dea75cc2..a3b916355fd 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/ApiResponse.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/ApiResponse.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Code** | **int?** | | [optional] +**Code** | **int** | | [optional] **Type** | **string** | | [optional] **Message** | **string** | | [optional] diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/ArrayOfArrayOfNumberOnly.md index 12616c6718b..e05ea7dc240 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/ArrayOfArrayOfNumberOnly.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ArrayArrayNumber** | **List<List<decimal?>>** | | [optional] +**ArrayArrayNumber** | **List<List<decimal>>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/ArrayOfNumberOnly.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/ArrayOfNumberOnly.md index 04facf7d5d1..5f593d42929 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/ArrayOfNumberOnly.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ArrayNumber** | **List<decimal?>** | | [optional] +**ArrayNumber** | **List<decimal>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/ArrayTest.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/ArrayTest.md index 9c297f062a9..593bc2d7386 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/ArrayTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/ArrayTest.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ArrayOfString** | **List<string>** | | [optional] -**ArrayArrayOfInteger** | **List<List<long?>>** | | [optional] +**ArrayArrayOfInteger** | **List<List<long>>** | | [optional] **ArrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Cat.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Cat.md index 4545a124369..6609de8e12a 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Cat.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Cat.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ClassName** | **string** | | **Color** | **string** | | [optional] [default to "red"] -**Declawed** | **bool?** | | [optional] +**Declawed** | **bool** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/CatAllOf.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/CatAllOf.md index 1a630760455..d623d2a0a6e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/CatAllOf.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/CatAllOf.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Declawed** | **bool?** | | [optional] +**Declawed** | **bool** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Category.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Category.md index 87ad855ca6f..42102d4e508 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Category.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Category.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Name** | **string** | | [default to "default-name"] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/EnumTest.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/EnumTest.md index 8e213c3335f..f8bc67baa6a 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/EnumTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/EnumTest.md @@ -7,8 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **EnumString** | **string** | | [optional] **EnumStringRequired** | **string** | | -**EnumInteger** | **int?** | | [optional] -**EnumNumber** | **double?** | | [optional] +**EnumInteger** | **int** | | [optional] +**EnumNumber** | **double** | | [optional] **OuterEnum** | **OuterEnum** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/FakeApi.md index a2284ba8f3e..2738b9e1853 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/FakeApi.md @@ -31,7 +31,7 @@ this route creates an XmlItem ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -41,9 +41,10 @@ namespace Example { public class CreateXmlItemExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var xmlItem = new XmlItem(); // XmlItem | XmlItem Body try @@ -51,9 +52,11 @@ namespace Example // creates an XmlItem apiInstance.CreateXmlItem(xmlItem); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.CreateXmlItem: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -80,6 +83,11 @@ No authorization required - **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 - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -88,7 +96,7 @@ No authorization required ## FakeOuterBooleanSerialize -> bool? FakeOuterBooleanSerialize (bool? body = null) +> bool FakeOuterBooleanSerialize (bool body = null) @@ -97,7 +105,7 @@ Test serialization of outer boolean types ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -107,19 +115,22 @@ namespace Example { public class FakeOuterBooleanSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var body = true; // bool? | Input boolean as post body (optional) + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var body = true; // bool | Input boolean as post body (optional) try { - bool? result = apiInstance.FakeOuterBooleanSerialize(body); + bool result = apiInstance.FakeOuterBooleanSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -131,11 +142,11 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **bool?**| Input boolean as post body | [optional] + **body** | **bool**| Input boolean as post body | [optional] ### Return type -**bool?** +**bool** ### Authorization @@ -146,6 +157,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -163,7 +179,7 @@ Test serialization of object with outer number type ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -173,9 +189,10 @@ namespace Example { public class FakeOuterCompositeSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = new OuterComposite(); // OuterComposite | Input composite as post body (optional) try @@ -183,9 +200,11 @@ namespace Example OuterComposite result = apiInstance.FakeOuterCompositeSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -212,6 +231,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -220,7 +244,7 @@ No authorization required ## FakeOuterNumberSerialize -> decimal? FakeOuterNumberSerialize (decimal? body = null) +> decimal FakeOuterNumberSerialize (decimal body = null) @@ -229,7 +253,7 @@ Test serialization of outer number types ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -239,19 +263,22 @@ namespace Example { public class FakeOuterNumberSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var body = 8.14; // decimal? | Input number as post body (optional) + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var body = 8.14; // decimal | Input number as post body (optional) try { - decimal? result = apiInstance.FakeOuterNumberSerialize(body); + decimal result = apiInstance.FakeOuterNumberSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -263,11 +290,11 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **decimal?**| Input number as post body | [optional] + **body** | **decimal**| Input number as post body | [optional] ### Return type -**decimal?** +**decimal** ### Authorization @@ -278,6 +305,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -295,7 +327,7 @@ Test serialization of outer string types ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -305,9 +337,10 @@ namespace Example { public class FakeOuterStringSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = body_example; // string | Input string as post body (optional) try @@ -315,9 +348,11 @@ namespace Example string result = apiInstance.FakeOuterStringSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -344,6 +379,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -361,7 +401,7 @@ For this test, the body for this request much reference a schema named `File`. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -371,18 +411,21 @@ namespace Example { public class TestBodyWithFileSchemaExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = new FileSchemaTestClass(); // FileSchemaTestClass | try { apiInstance.TestBodyWithFileSchema(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchema: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -409,6 +452,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -424,7 +472,7 @@ No authorization required ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -434,9 +482,10 @@ namespace Example { public class TestBodyWithQueryParamsExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var query = query_example; // string | var body = new User(); // User | @@ -444,9 +493,11 @@ namespace Example { apiInstance.TestBodyWithQueryParams(query, body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -474,6 +525,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -491,7 +547,7 @@ To test \"client\" model ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -501,9 +557,10 @@ namespace Example { public class TestClientModelExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = new ModelClient(); // ModelClient | client model try @@ -512,9 +569,11 @@ namespace Example ModelClient result = apiInstance.TestClientModel(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -541,6 +600,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -549,7 +613,7 @@ No authorization required ## TestEndpointParameters -> void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) +> void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = null, int int32 = null, long int64 = null, float _float = null, string _string = null, System.IO.Stream binary = null, DateTime date = null, DateTime dateTime = null, string password = null, string callback = null) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -558,7 +622,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -568,25 +632,26 @@ namespace Example { public class TestEndpointParametersExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure HTTP basic authorization: http_basic_test Configuration.Default.Username = "YOUR_USERNAME"; Configuration.Default.Password = "YOUR_PASSWORD"; - var apiInstance = new FakeApi(); - var number = 8.14; // decimal? | None - var _double = 1.2D; // double? | None + var apiInstance = new FakeApi(Configuration.Default); + var number = 8.14; // decimal | None + var _double = 1.2D; // double | None var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None var _byte = BYTE_ARRAY_DATA_HERE; // byte[] | None - var integer = 56; // int? | None (optional) - var int32 = 56; // int? | None (optional) - var int64 = 789; // long? | None (optional) - var _float = 3.4F; // float? | None (optional) + var integer = 56; // int | None (optional) + var int32 = 56; // int | None (optional) + var int64 = 789; // long | None (optional) + var _float = 3.4F; // float | None (optional) var _string = _string_example; // string | None (optional) var binary = BINARY_DATA_HERE; // System.IO.Stream | None (optional) - var date = 2013-10-20; // DateTime? | None (optional) - var dateTime = 2013-10-20T19:20:30+01:00; // DateTime? | None (optional) + var date = 2013-10-20; // DateTime | None (optional) + var dateTime = 2013-10-20T19:20:30+01:00; // DateTime | None (optional) var password = password_example; // string | None (optional) var callback = callback_example; // string | None (optional) @@ -595,9 +660,11 @@ namespace Example // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 apiInstance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -609,18 +676,18 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **number** | **decimal?**| None | - **_double** | **double?**| None | + **number** | **decimal**| None | + **_double** | **double**| None | **patternWithoutDelimiter** | **string**| None | **_byte** | **byte[]**| None | - **integer** | **int?**| None | [optional] - **int32** | **int?**| None | [optional] - **int64** | **long?**| None | [optional] - **_float** | **float?**| None | [optional] + **integer** | **int**| None | [optional] + **int32** | **int**| None | [optional] + **int64** | **long**| None | [optional] + **_float** | **float**| None | [optional] **_string** | **string**| None | [optional] **binary** | **System.IO.Stream**| None | [optional] - **date** | **DateTime?**| None | [optional] - **dateTime** | **DateTime?**| None | [optional] + **date** | **DateTime**| None | [optional] + **dateTime** | **DateTime**| None | [optional] **password** | **string**| None | [optional] **callback** | **string**| None | [optional] @@ -637,6 +704,12 @@ void (empty response body) - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -645,7 +718,7 @@ void (empty response body) ## TestEnumParameters -> void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) +> void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int enumQueryInteger = null, double enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) To test enum parameters @@ -654,7 +727,7 @@ To test enum parameters ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -664,15 +737,16 @@ namespace Example { public class TestEnumParametersExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var enumHeaderStringArray = enumHeaderStringArray_example; // List | Header parameter enum test (string array) (optional) var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg) var enumQueryStringArray = enumQueryStringArray_example; // List | Query parameter enum test (string array) (optional) var enumQueryString = enumQueryString_example; // string | Query parameter enum test (string) (optional) (default to -efg) - var enumQueryInteger = 56; // int? | Query parameter enum test (double) (optional) - var enumQueryDouble = 1.2D; // double? | Query parameter enum test (double) (optional) + var enumQueryInteger = 56; // int | Query parameter enum test (double) (optional) + var enumQueryDouble = 1.2D; // double | Query parameter enum test (double) (optional) var enumFormStringArray = new List(); // List | Form parameter enum test (string array) (optional) (default to $) var enumFormString = enumFormString_example; // string | Form parameter enum test (string) (optional) (default to -efg) @@ -681,9 +755,11 @@ namespace Example // To test enum parameters apiInstance.TestEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -699,8 +775,8 @@ Name | Type | Description | Notes **enumHeaderString** | **string**| Header parameter enum test (string) | [optional] [default to -efg] **enumQueryStringArray** | **List<string>**| Query parameter enum test (string array) | [optional] **enumQueryString** | **string**| Query parameter enum test (string) | [optional] [default to -efg] - **enumQueryInteger** | **int?**| Query parameter enum test (double) | [optional] - **enumQueryDouble** | **double?**| Query parameter enum test (double) | [optional] + **enumQueryInteger** | **int**| Query parameter enum test (double) | [optional] + **enumQueryDouble** | **double**| Query parameter enum test (double) | [optional] **enumFormStringArray** | [**List<string>**](string.md)| Form parameter enum test (string array) | [optional] [default to $] **enumFormString** | **string**| Form parameter enum test (string) | [optional] [default to -efg] @@ -717,6 +793,12 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -725,7 +807,7 @@ No authorization required ## TestGroupParameters -> void TestGroupParameters (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) +> void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = null, bool booleanGroup = null, long int64Group = null) Fake endpoint to test group parameters (optional) @@ -734,7 +816,7 @@ Fake endpoint to test group parameters (optional) ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -744,24 +826,27 @@ namespace Example { public class TestGroupParametersExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var requiredStringGroup = 56; // int? | Required String in group parameters - var requiredBooleanGroup = true; // bool? | Required Boolean in group parameters - var requiredInt64Group = 789; // long? | Required Integer in group parameters - var stringGroup = 56; // int? | String in group parameters (optional) - var booleanGroup = true; // bool? | Boolean in group parameters (optional) - var int64Group = 789; // long? | Integer in group parameters (optional) + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var requiredStringGroup = 56; // int | Required String in group parameters + var requiredBooleanGroup = true; // bool | Required Boolean in group parameters + var requiredInt64Group = 789; // long | Required Integer in group parameters + var stringGroup = 56; // int | String in group parameters (optional) + var booleanGroup = true; // bool | Boolean in group parameters (optional) + var int64Group = 789; // long | Integer in group parameters (optional) try { // Fake endpoint to test group parameters (optional) apiInstance.TestGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestGroupParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -773,12 +858,12 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **requiredStringGroup** | **int?**| Required String in group parameters | - **requiredBooleanGroup** | **bool?**| Required Boolean in group parameters | - **requiredInt64Group** | **long?**| Required Integer in group parameters | - **stringGroup** | **int?**| String in group parameters | [optional] - **booleanGroup** | **bool?**| Boolean in group parameters | [optional] - **int64Group** | **long?**| Integer in group parameters | [optional] + **requiredStringGroup** | **int**| Required String in group parameters | + **requiredBooleanGroup** | **bool**| Required Boolean in group parameters | + **requiredInt64Group** | **long**| Required Integer in group parameters | + **stringGroup** | **int**| String in group parameters | [optional] + **booleanGroup** | **bool**| Boolean in group parameters | [optional] + **int64Group** | **long**| Integer in group parameters | [optional] ### Return type @@ -793,6 +878,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Someting wrong | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -808,7 +898,7 @@ test inline additionalProperties ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -818,9 +908,10 @@ namespace Example { public class TestInlineAdditionalPropertiesExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var param = new Dictionary(); // Dictionary | request body try @@ -828,9 +919,11 @@ namespace Example // test inline additionalProperties apiInstance.TestInlineAdditionalProperties(param); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -857,6 +950,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -872,7 +970,7 @@ test json serialization of form data ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -882,9 +980,10 @@ namespace Example { public class TestJsonFormDataExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var param = param_example; // string | field1 var param2 = param2_example; // string | field2 @@ -893,9 +992,11 @@ namespace Example // test json serialization of form data apiInstance.TestJsonFormData(param, param2); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -923,6 +1024,11 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/FakeClassnameTags123Api.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/FakeClassnameTags123Api.md index cc0cd83d12c..deb97a27697 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/FakeClassnameTags123Api.md @@ -19,7 +19,7 @@ To test class name in snake case ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -29,14 +29,15 @@ namespace Example { public class TestClassnameExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key_query Configuration.Default.AddApiKey("api_key_query", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key_query", "Bearer"); - var apiInstance = new FakeClassnameTags123Api(); + var apiInstance = new FakeClassnameTags123Api(Configuration.Default); var body = new ModelClient(); // ModelClient | client model try @@ -45,9 +46,11 @@ namespace Example ModelClient result = apiInstance.TestClassname(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -74,6 +77,11 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/FormatTest.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/FormatTest.md index 519e940a7c8..0d921285ba1 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/FormatTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/FormatTest.md @@ -5,18 +5,18 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Integer** | **int?** | | [optional] -**Int32** | **int?** | | [optional] -**Int64** | **long?** | | [optional] -**Number** | **decimal?** | | -**Float** | **float?** | | [optional] -**Double** | **double?** | | [optional] +**Integer** | **int** | | [optional] +**Int32** | **int** | | [optional] +**Int64** | **long** | | [optional] +**Number** | **decimal** | | +**Float** | **float** | | [optional] +**Double** | **double** | | [optional] **String** | **string** | | [optional] **Byte** | **byte[]** | | **Binary** | **System.IO.Stream** | | [optional] -**Date** | **DateTime?** | | -**DateTime** | **DateTime?** | | [optional] -**Uuid** | **Guid?** | | [optional] +**Date** | **DateTime** | | +**DateTime** | **DateTime** | | [optional] +**Uuid** | **Guid** | | [optional] **Password** | **string** | | [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/MapTest.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/MapTest.md index 89be5aa12cf..79d499e2cf9 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/MapTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/MapTest.md @@ -7,8 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **MapMapOfString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] **MapOfEnumString** | **Dictionary<string, string>** | | [optional] -**DirectMap** | **Dictionary<string, bool?>** | | [optional] -**IndirectMap** | **Dictionary<string, bool?>** | | [optional] +**DirectMap** | **Dictionary<string, bool>** | | [optional] +**IndirectMap** | **Dictionary<string, bool>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 323933588de..dd7b01e49fe 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Uuid** | **Guid?** | | [optional] -**DateTime** | **DateTime?** | | [optional] +**Uuid** | **Guid** | | [optional] +**DateTime** | **DateTime** | | [optional] **Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Model200Response.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Model200Response.md index 59918913107..7d826bca1ec 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Model200Response.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Model200Response.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **int?** | | [optional] +**Name** | **int** | | [optional] **Class** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Name.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Name.md index 80d0a9f31f3..77b9b2e7501 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Name.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Name.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Name** | **int?** | | -**SnakeCase** | **int?** | | [optional] +**_Name** | **int** | | +**SnakeCase** | **int** | | [optional] **Property** | **string** | | [optional] -**_123Number** | **int?** | | [optional] +**_123Number** | **int** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/NumberOnly.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/NumberOnly.md index 8fd05997a93..e4b08467e08 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/NumberOnly.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/NumberOnly.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**JustNumber** | **decimal?** | | [optional] +**JustNumber** | **decimal** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Order.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Order.md index f28ee2ad006..875f43a30e5 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Order.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Order.md @@ -5,12 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] -**PetId** | **long?** | | [optional] -**Quantity** | **int?** | | [optional] -**ShipDate** | **DateTime?** | | [optional] +**Id** | **long** | | [optional] +**PetId** | **long** | | [optional] +**Quantity** | **int** | | [optional] +**ShipDate** | **DateTime** | | [optional] **Status** | **string** | Order Status | [optional] -**Complete** | **bool?** | | [optional] [default to false] +**Complete** | **bool** | | [optional] [default to false] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/OuterComposite.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/OuterComposite.md index e371f712633..f381fb7fd28 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/OuterComposite.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/OuterComposite.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MyNumber** | **decimal?** | | [optional] +**MyNumber** | **decimal** | | [optional] **MyString** | **string** | | [optional] -**MyBoolean** | **bool?** | | [optional] +**MyBoolean** | **bool** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Pet.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Pet.md index 51022249270..0bd5c40fc99 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Pet.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Pet.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Category** | [**Category**](Category.md) | | [optional] **Name** | **string** | | **PhotoUrls** | **List<string>** | | diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/PetApi.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/PetApi.md index d2e2075bfd7..1a9eba14868 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/PetApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/PetApi.md @@ -25,7 +25,7 @@ Add a new pet to the store ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -35,12 +35,13 @@ namespace Example { public class AddPetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var body = new Pet(); // Pet | Pet object that needs to be added to the store try @@ -48,9 +49,11 @@ namespace Example // Add a new pet to the store apiInstance.AddPet(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -77,6 +80,12 @@ void (empty response body) - **Content-Type**: application/json, application/xml - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **405** | Invalid input | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -85,14 +94,14 @@ void (empty response body) ## DeletePet -> void DeletePet (long? petId, string apiKey = null) +> void DeletePet (long petId, string apiKey = null) Deletes a pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -102,13 +111,14 @@ namespace Example { public class DeletePetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var petId = 789; // long? | Pet id to delete + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | Pet id to delete var apiKey = apiKey_example; // string | (optional) try @@ -116,9 +126,11 @@ namespace Example // Deletes a pet apiInstance.DeletePet(petId, apiKey); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -130,7 +142,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| Pet id to delete | + **petId** | **long**| Pet id to delete | **apiKey** | **string**| | [optional] ### Return type @@ -146,6 +158,12 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid pet value | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -154,7 +172,7 @@ void (empty response body) ## FindPetsByStatus -> List FindPetsByStatus (List status) +> List<Pet> FindPetsByStatus (List status) Finds Pets by status @@ -163,7 +181,7 @@ Multiple status values can be provided with comma separated strings ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -173,23 +191,26 @@ namespace Example { public class FindPetsByStatusExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var status = status_example; // List | Status values that need to be considered for filter try { // Finds Pets by status - List<Pet> result = apiInstance.FindPetsByStatus(status); + List result = apiInstance.FindPetsByStatus(status); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -205,7 +226,7 @@ Name | Type | Description | Notes ### Return type -[**List**](Pet.md) +[**List<Pet>**](Pet.md) ### Authorization @@ -216,6 +237,12 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -224,7 +251,7 @@ Name | Type | Description | Notes ## FindPetsByTags -> List FindPetsByTags (List tags) +> List<Pet> FindPetsByTags (List tags) Finds Pets by tags @@ -233,7 +260,7 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -243,23 +270,26 @@ namespace Example { public class FindPetsByTagsExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var tags = new List(); // List | Tags to filter by try { // Finds Pets by tags - List<Pet> result = apiInstance.FindPetsByTags(tags); + List result = apiInstance.FindPetsByTags(tags); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -275,7 +305,7 @@ Name | Type | Description | Notes ### Return type -[**List**](Pet.md) +[**List<Pet>**](Pet.md) ### Authorization @@ -286,6 +316,12 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -294,7 +330,7 @@ Name | Type | Description | Notes ## GetPetById -> Pet GetPetById (long? petId) +> Pet GetPetById (long petId) Find pet by ID @@ -303,7 +339,7 @@ Returns a single pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -313,15 +349,16 @@ namespace Example { public class GetPetByIdExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet to return + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | ID of pet to return try { @@ -329,9 +366,11 @@ namespace Example Pet result = apiInstance.GetPetById(petId); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -343,7 +382,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to return | + **petId** | **long**| ID of pet to return | ### Return type @@ -358,6 +397,13 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -373,7 +419,7 @@ Update an existing pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -383,12 +429,13 @@ namespace Example { public class UpdatePetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var body = new Pet(); // Pet | Pet object that needs to be added to the store try @@ -396,9 +443,11 @@ namespace Example // Update an existing pet apiInstance.UpdatePet(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -425,6 +474,14 @@ void (empty response body) - **Content-Type**: application/json, application/xml - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -433,14 +490,14 @@ void (empty response body) ## UpdatePetWithForm -> void UpdatePetWithForm (long? petId, string name = null, string status = null) +> void UpdatePetWithForm (long petId, string name = null, string status = null) Updates a pet in the store with form data ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -450,13 +507,14 @@ namespace Example { public class UpdatePetWithFormExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet that needs to be updated + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | ID of pet that needs to be updated var name = name_example; // string | Updated name of the pet (optional) var status = status_example; // string | Updated status of the pet (optional) @@ -465,9 +523,11 @@ namespace Example // Updates a pet in the store with form data apiInstance.UpdatePetWithForm(petId, name, status); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -479,7 +539,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet that needs to be updated | + **petId** | **long**| ID of pet that needs to be updated | **name** | **string**| Updated name of the pet | [optional] **status** | **string**| Updated status of the pet | [optional] @@ -496,6 +556,11 @@ void (empty response body) - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -504,14 +569,14 @@ void (empty response body) ## UploadFile -> ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null) +> ApiResponse UploadFile (long petId, string additionalMetadata = null, System.IO.Stream file = null) uploads an image ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -521,13 +586,14 @@ namespace Example { public class UploadFileExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet to update + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | ID of pet to update var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) var file = BINARY_DATA_HERE; // System.IO.Stream | file to upload (optional) @@ -537,9 +603,11 @@ namespace Example ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -551,7 +619,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to update | + **petId** | **long**| ID of pet to update | **additionalMetadata** | **string**| Additional data to pass to server | [optional] **file** | **System.IO.Stream**| file to upload | [optional] @@ -568,6 +636,11 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -576,14 +649,14 @@ Name | Type | Description | Notes ## UploadFileWithRequiredFile -> ApiResponse UploadFileWithRequiredFile (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) +> ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string additionalMetadata = null) uploads an image (required) ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -593,13 +666,14 @@ namespace Example { public class UploadFileWithRequiredFileExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet to update + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | ID of pet to update var requiredFile = BINARY_DATA_HERE; // System.IO.Stream | file to upload var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) @@ -609,9 +683,11 @@ namespace Example ApiResponse result = apiInstance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -623,7 +699,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to update | + **petId** | **long**| ID of pet to update | **requiredFile** | **System.IO.Stream**| file to upload | **additionalMetadata** | **string**| Additional data to pass to server | [optional] @@ -640,6 +716,11 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Return.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Return.md index 65481f45cf2..4761c70748e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Return.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Return.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Return** | **int?** | | [optional] +**_Return** | **int** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/SpecialModelName.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/SpecialModelName.md index c1154219ccc..ee6489524d0 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/SpecialModelName.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/SpecialModelName.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SpecialPropertyName** | **long?** | | [optional] +**SpecialPropertyName** | **long** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/StoreApi.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/StoreApi.md index 0f6d9e4e3dc..57247772d4f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/StoreApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/StoreApi.md @@ -22,7 +22,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -32,9 +32,10 @@ namespace Example { public class DeleteOrderExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); var orderId = orderId_example; // string | ID of the order that needs to be deleted try @@ -42,9 +43,11 @@ namespace Example // Delete purchase order by ID apiInstance.DeleteOrder(orderId); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -71,6 +74,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -79,7 +88,7 @@ No authorization required ## GetInventory -> Dictionary GetInventory () +> Dictionary<string, int> GetInventory () Returns pet inventories by status @@ -88,7 +97,7 @@ Returns a map of status codes to quantities ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -98,24 +107,27 @@ namespace Example { public class GetInventoryExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); - var apiInstance = new StoreApi(); + var apiInstance = new StoreApi(Configuration.Default); try { // Returns pet inventories by status - Dictionary<string, int?> result = apiInstance.GetInventory(); + Dictionary result = apiInstance.GetInventory(); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -128,7 +140,7 @@ This endpoint does not need any parameter. ### Return type -**Dictionary** +**Dictionary** ### Authorization @@ -139,6 +151,11 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -147,7 +164,7 @@ This endpoint does not need any parameter. ## GetOrderById -> Order GetOrderById (long? orderId) +> Order GetOrderById (long orderId) Find purchase order by ID @@ -156,7 +173,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -166,10 +183,11 @@ namespace Example { public class GetOrderByIdExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); - var orderId = 789; // long? | ID of pet that needs to be fetched + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); + var orderId = 789; // long | ID of pet that needs to be fetched try { @@ -177,9 +195,11 @@ namespace Example Order result = apiInstance.GetOrderById(orderId); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -191,7 +211,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **long?**| ID of pet that needs to be fetched | + **orderId** | **long**| ID of pet that needs to be fetched | ### Return type @@ -206,6 +226,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -221,7 +248,7 @@ Place an order for a pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -231,9 +258,10 @@ namespace Example { public class PlaceOrderExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); var body = new Order(); // Order | order placed for purchasing the pet try @@ -242,9 +270,11 @@ namespace Example Order result = apiInstance.PlaceOrder(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -271,6 +301,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Tag.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Tag.md index 864cac0c8d3..f781c26f017 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Tag.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/Tag.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Name** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/TypeHolderDefault.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/TypeHolderDefault.md index d336f567ab2..0945245b213 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/TypeHolderDefault.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/TypeHolderDefault.md @@ -6,10 +6,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **StringItem** | **string** | | [default to "what"] -**NumberItem** | **decimal?** | | -**IntegerItem** | **int?** | | -**BoolItem** | **bool?** | | [default to true] -**ArrayItem** | **List<int?>** | | +**NumberItem** | **decimal** | | +**IntegerItem** | **int** | | +**BoolItem** | **bool** | | [default to true] +**ArrayItem** | **List<int>** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/TypeHolderExample.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/TypeHolderExample.md index 8f9ec66939e..e92681b8cba 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/TypeHolderExample.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/TypeHolderExample.md @@ -6,10 +6,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **StringItem** | **string** | | -**NumberItem** | **decimal?** | | -**IntegerItem** | **int?** | | -**BoolItem** | **bool?** | | -**ArrayItem** | **List<int?>** | | +**NumberItem** | **decimal** | | +**IntegerItem** | **int** | | +**BoolItem** | **bool** | | +**ArrayItem** | **List<int>** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/User.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/User.md index 6faa1df688d..a25c25d1aa0 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/User.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/User.md @@ -5,14 +5,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Username** | **string** | | [optional] **FirstName** | **string** | | [optional] **LastName** | **string** | | [optional] **Email** | **string** | | [optional] **Password** | **string** | | [optional] **Phone** | **string** | | [optional] -**UserStatus** | **int?** | User Status | [optional] +**UserStatus** | **int** | User Status | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/UserApi.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/UserApi.md index b9f592bdd71..1385d840413 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/UserApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/UserApi.md @@ -26,7 +26,7 @@ This can only be done by the logged in user. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -36,9 +36,10 @@ namespace Example { public class CreateUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var body = new User(); // User | Created user object try @@ -46,9 +47,11 @@ namespace Example // Create user apiInstance.CreateUser(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -75,6 +78,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -90,7 +98,7 @@ Creates list of users with given input array ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -100,9 +108,10 @@ namespace Example { public class CreateUsersWithArrayInputExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var body = new List(); // List | List of user object try @@ -110,9 +119,11 @@ namespace Example // Creates list of users with given input array apiInstance.CreateUsersWithArrayInput(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -124,7 +135,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -139,6 +150,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -154,7 +170,7 @@ Creates list of users with given input array ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -164,9 +180,10 @@ namespace Example { public class CreateUsersWithListInputExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var body = new List(); // List | List of user object try @@ -174,9 +191,11 @@ namespace Example // Creates list of users with given input array apiInstance.CreateUsersWithListInput(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -188,7 +207,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -203,6 +222,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -220,7 +244,7 @@ This can only be done by the logged in user. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -230,9 +254,10 @@ namespace Example { public class DeleteUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The name that needs to be deleted try @@ -240,9 +265,11 @@ namespace Example // Delete user apiInstance.DeleteUser(username); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -269,6 +296,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -284,7 +317,7 @@ Get user by user name ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -294,9 +327,10 @@ namespace Example { public class GetUserByNameExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. try @@ -305,9 +339,11 @@ namespace Example User result = apiInstance.GetUserByName(username); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -334,6 +370,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -349,7 +392,7 @@ Logs user into the system ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -359,9 +402,10 @@ namespace Example { public class LoginUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The user name for login var password = password_example; // string | The password for login in clear text @@ -371,9 +415,11 @@ namespace Example string result = apiInstance.LoginUser(username, password); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -401,6 +447,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -416,7 +468,7 @@ Logs out current logged in user session ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -426,18 +478,21 @@ namespace Example { public class LogoutUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); try { // Logs out current logged in user session apiInstance.LogoutUser(); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -461,6 +516,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -478,7 +538,7 @@ This can only be done by the logged in user. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -488,9 +548,10 @@ namespace Example { public class UpdateUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | name that need to be deleted var body = new User(); // User | Updated user object @@ -499,9 +560,11 @@ namespace Example // Updated user apiInstance.UpdateUser(username, body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -529,6 +592,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/XmlItem.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/XmlItem.md index e96ea4b0de6..0dca90c706f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/XmlItem.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/XmlItem.md @@ -6,34 +6,34 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **AttributeString** | **string** | | [optional] -**AttributeNumber** | **decimal?** | | [optional] -**AttributeInteger** | **int?** | | [optional] -**AttributeBoolean** | **bool?** | | [optional] -**WrappedArray** | **List<int?>** | | [optional] +**AttributeNumber** | **decimal** | | [optional] +**AttributeInteger** | **int** | | [optional] +**AttributeBoolean** | **bool** | | [optional] +**WrappedArray** | **List<int>** | | [optional] **NameString** | **string** | | [optional] -**NameNumber** | **decimal?** | | [optional] -**NameInteger** | **int?** | | [optional] -**NameBoolean** | **bool?** | | [optional] -**NameArray** | **List<int?>** | | [optional] -**NameWrappedArray** | **List<int?>** | | [optional] +**NameNumber** | **decimal** | | [optional] +**NameInteger** | **int** | | [optional] +**NameBoolean** | **bool** | | [optional] +**NameArray** | **List<int>** | | [optional] +**NameWrappedArray** | **List<int>** | | [optional] **PrefixString** | **string** | | [optional] -**PrefixNumber** | **decimal?** | | [optional] -**PrefixInteger** | **int?** | | [optional] -**PrefixBoolean** | **bool?** | | [optional] -**PrefixArray** | **List<int?>** | | [optional] -**PrefixWrappedArray** | **List<int?>** | | [optional] +**PrefixNumber** | **decimal** | | [optional] +**PrefixInteger** | **int** | | [optional] +**PrefixBoolean** | **bool** | | [optional] +**PrefixArray** | **List<int>** | | [optional] +**PrefixWrappedArray** | **List<int>** | | [optional] **NamespaceString** | **string** | | [optional] -**NamespaceNumber** | **decimal?** | | [optional] -**NamespaceInteger** | **int?** | | [optional] -**NamespaceBoolean** | **bool?** | | [optional] -**NamespaceArray** | **List<int?>** | | [optional] -**NamespaceWrappedArray** | **List<int?>** | | [optional] +**NamespaceNumber** | **decimal** | | [optional] +**NamespaceInteger** | **int** | | [optional] +**NamespaceBoolean** | **bool** | | [optional] +**NamespaceArray** | **List<int>** | | [optional] +**NamespaceWrappedArray** | **List<int>** | | [optional] **PrefixNsString** | **string** | | [optional] -**PrefixNsNumber** | **decimal?** | | [optional] -**PrefixNsInteger** | **int?** | | [optional] -**PrefixNsBoolean** | **bool?** | | [optional] -**PrefixNsArray** | **List<int?>** | | [optional] -**PrefixNsWrappedArray** | **List<int?>** | | [optional] +**PrefixNsNumber** | **decimal** | | [optional] +**PrefixNsInteger** | **int** | | [optional] +**PrefixNsBoolean** | **bool** | | [optional] +**PrefixNsArray** | **List<int>** | | [optional] +**PrefixNsWrappedArray** | **List<int>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 8ea2b0befa4..cda08c363cd 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -174,7 +174,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > Call123TestSpecialTagsWithHttpInfo (ModelClient body) + public ApiResponse Call123TestSpecialTagsWithHttpInfo (ModelClient body) { // verify the required parameter 'body' is set if (body == null) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/FakeApi.cs index cf5d3eaf93c..bfc925356e0 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/FakeApi.cs @@ -53,8 +53,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// bool? - bool? FakeOuterBooleanSerialize (bool? body = null); + /// bool + bool FakeOuterBooleanSerialize (bool body = default(bool)); /// /// @@ -64,8 +64,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// ApiResponse of bool? - ApiResponse FakeOuterBooleanSerializeWithHttpInfo (bool? body = null); + /// ApiResponse of bool + ApiResponse FakeOuterBooleanSerializeWithHttpInfo (bool body = default(bool)); /// /// /// @@ -75,7 +75,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// OuterComposite - OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null); + OuterComposite FakeOuterCompositeSerialize (OuterComposite body = default(OuterComposite)); /// /// @@ -86,7 +86,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// ApiResponse of OuterComposite - ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null); + ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = default(OuterComposite)); /// /// /// @@ -95,8 +95,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// decimal? - decimal? FakeOuterNumberSerialize (decimal? body = null); + /// decimal + decimal FakeOuterNumberSerialize (decimal body = default(decimal)); /// /// @@ -106,8 +106,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// ApiResponse of decimal? - ApiResponse FakeOuterNumberSerializeWithHttpInfo (decimal? body = null); + /// ApiResponse of decimal + ApiResponse FakeOuterNumberSerializeWithHttpInfo (decimal body = default(decimal)); /// /// /// @@ -117,7 +117,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// string - string FakeOuterStringSerialize (string body = null); + string FakeOuterStringSerialize (string body = default(string)); /// /// @@ -128,7 +128,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// ApiResponse of string - ApiResponse FakeOuterStringSerializeWithHttpInfo (string body = null); + ApiResponse FakeOuterStringSerializeWithHttpInfo (string body = default(string)); /// /// /// @@ -216,7 +216,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// - void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -240,7 +240,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// ApiResponse of Object(void) - ApiResponse TestEndpointParametersWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + ApiResponse TestEndpointParametersWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)); /// /// To test enum parameters /// @@ -257,7 +257,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// - void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); + void TestEnumParameters (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)); /// /// To test enum parameters @@ -275,7 +275,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// ApiResponse of Object(void) - ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); + ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)); /// /// Fake endpoint to test group parameters (optional) /// @@ -290,7 +290,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// - void TestGroupParameters (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)); /// /// Fake endpoint to test group parameters (optional) @@ -306,7 +306,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// ApiResponse of Object(void) - ApiResponse TestGroupParametersWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + ApiResponse TestGroupParametersWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)); /// /// test inline additionalProperties /// @@ -544,10 +544,10 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// bool? - public bool? FakeOuterBooleanSerialize (bool? body = null) + /// bool + public bool FakeOuterBooleanSerialize (bool body = default(bool)) { - ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -556,8 +556,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// ApiResponse of bool? - public ApiResponse< bool? > FakeOuterBooleanSerializeWithHttpInfo (bool? body = null) + /// ApiResponse of bool + public ApiResponse FakeOuterBooleanSerializeWithHttpInfo (bool body = default(bool)) { var localVarPath = "/fake/outer/boolean"; @@ -604,9 +604,9 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (bool?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool?))); + (bool) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool))); } /// @@ -615,7 +615,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// OuterComposite - public OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) + public OuterComposite FakeOuterCompositeSerialize (OuterComposite body = default(OuterComposite)) { ApiResponse localVarResponse = FakeOuterCompositeSerializeWithHttpInfo(body); return localVarResponse.Data; @@ -627,7 +627,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// ApiResponse of OuterComposite - public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null) + public ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = default(OuterComposite)) { var localVarPath = "/fake/outer/composite"; @@ -684,10 +684,10 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// decimal? - public decimal? FakeOuterNumberSerialize (decimal? body = null) + /// decimal + public decimal FakeOuterNumberSerialize (decimal body = default(decimal)) { - ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -696,8 +696,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// ApiResponse of decimal? - public ApiResponse< decimal? > FakeOuterNumberSerializeWithHttpInfo (decimal? body = null) + /// ApiResponse of decimal + public ApiResponse FakeOuterNumberSerializeWithHttpInfo (decimal body = default(decimal)) { var localVarPath = "/fake/outer/number"; @@ -744,9 +744,9 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (decimal?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal?))); + (decimal) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal))); } /// @@ -755,7 +755,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// string - public string FakeOuterStringSerialize (string body = null) + public string FakeOuterStringSerialize (string body = default(string)) { ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); return localVarResponse.Data; @@ -767,7 +767,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// ApiResponse of string - public ApiResponse< string > FakeOuterStringSerializeWithHttpInfo (string body = null) + public ApiResponse FakeOuterStringSerializeWithHttpInfo (string body = default(string)) { var localVarPath = "/fake/outer/string"; @@ -987,7 +987,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient body) + public ApiResponse TestClientModelWithHttpInfo (ModelClient body) { // verify the required parameter 'body' is set if (body == null) @@ -1062,7 +1062,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// - public void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + public void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)) { TestEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); } @@ -1086,7 +1086,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// ApiResponse of Object(void) - public ApiResponse TestEndpointParametersWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + public ApiResponse TestEndpointParametersWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)) { // verify the required parameter 'number' is set if (number == null) @@ -1175,7 +1175,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// - public void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) + public void TestEnumParameters (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)) { TestEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } @@ -1193,7 +1193,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// ApiResponse of Object(void) - public ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) + public ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)) { var localVarPath = "/fake"; @@ -1256,7 +1256,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// - public void TestGroupParameters (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + public void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)) { TestGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } @@ -1272,7 +1272,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// ApiResponse of Object(void) - public ApiResponse TestGroupParametersWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + public ApiResponse TestGroupParametersWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)) { // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup == null) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 071bb0b27b8..51eefa8b10f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -174,7 +174,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient body) + public ApiResponse TestClassnameWithHttpInfo (ModelClient body) { // verify the required parameter 'body' is set if (body == null) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/PetApi.cs index 3fdb793b6cb..7d75b705a26 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/PetApi.cs @@ -55,7 +55,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// - void DeletePet (long? petId, string apiKey = null); + void DeletePet (long petId, string apiKey = default(string)); /// /// Deletes a pet @@ -67,7 +67,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// ApiResponse of Object(void) - ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = null); + ApiResponse DeletePetWithHttpInfo (long petId, string apiKey = default(string)); /// /// Finds Pets by status /// @@ -119,7 +119,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Pet - Pet GetPetById (long? petId); + Pet GetPetById (long petId); /// /// Find pet by ID @@ -130,7 +130,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// ApiResponse of Pet - ApiResponse GetPetByIdWithHttpInfo (long? petId); + ApiResponse GetPetByIdWithHttpInfo (long petId); /// /// Update an existing pet /// @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// - void UpdatePetWithForm (long? petId, string name = null, string status = null); + void UpdatePetWithForm (long petId, string name = default(string), string status = default(string)); /// /// Updates a pet in the store with form data @@ -176,7 +176,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// ApiResponse of Object(void) - ApiResponse UpdatePetWithFormWithHttpInfo (long? petId, string name = null, string status = null); + ApiResponse UpdatePetWithFormWithHttpInfo (long petId, string name = default(string), string status = default(string)); /// /// uploads an image /// @@ -188,7 +188,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse - ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + ApiResponse UploadFile (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); /// /// uploads an image @@ -201,7 +201,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse of ApiResponse - ApiResponse UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + ApiResponse UploadFileWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); /// /// uploads an image (required) /// @@ -213,7 +213,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// ApiResponse - ApiResponse UploadFileWithRequiredFile (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null); + ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); /// /// uploads an image (required) @@ -226,7 +226,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// ApiResponse of ApiResponse - ApiResponse UploadFileWithRequiredFileWithHttpInfo (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null); + ApiResponse UploadFileWithRequiredFileWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); #endregion Synchronous Operations } @@ -424,7 +424,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// - public void DeletePet (long? petId, string apiKey = null) + public void DeletePet (long petId, string apiKey = default(string)) { DeletePetWithHttpInfo(petId, apiKey); } @@ -436,7 +436,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// ApiResponse of Object(void) - public ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = null) + public ApiResponse DeletePetWithHttpInfo (long petId, string apiKey = default(string)) { // verify the required parameter 'petId' is set if (petId == null) @@ -508,7 +508,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Status values that need to be considered for filter /// ApiResponse of List<Pet> - public ApiResponse< List > FindPetsByStatusWithHttpInfo (List status) + public ApiResponse> FindPetsByStatusWithHttpInfo (List status) { // verify the required parameter 'status' is set if (status == null) @@ -581,7 +581,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Tags to filter by /// ApiResponse of List<Pet> - public ApiResponse< List > FindPetsByTagsWithHttpInfo (List tags) + public ApiResponse> FindPetsByTagsWithHttpInfo (List tags) { // verify the required parameter 'tags' is set if (tags == null) @@ -642,7 +642,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Pet - public Pet GetPetById (long? petId) + public Pet GetPetById (long petId) { ApiResponse localVarResponse = GetPetByIdWithHttpInfo(petId); return localVarResponse.Data; @@ -654,7 +654,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// ApiResponse of Pet - public ApiResponse< Pet > GetPetByIdWithHttpInfo (long? petId) + public ApiResponse GetPetByIdWithHttpInfo (long petId) { // verify the required parameter 'petId' is set if (petId == null) @@ -795,7 +795,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// - public void UpdatePetWithForm (long? petId, string name = null, string status = null) + public void UpdatePetWithForm (long petId, string name = default(string), string status = default(string)) { UpdatePetWithFormWithHttpInfo(petId, name, status); } @@ -808,7 +808,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// ApiResponse of Object(void) - public ApiResponse UpdatePetWithFormWithHttpInfo (long? petId, string name = null, string status = null) + public ApiResponse UpdatePetWithFormWithHttpInfo (long petId, string name = default(string), string status = default(string)) { // verify the required parameter 'petId' is set if (petId == null) @@ -872,7 +872,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse - public ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public ApiResponse UploadFile (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) { ApiResponse localVarResponse = UploadFileWithHttpInfo(petId, additionalMetadata, file); return localVarResponse.Data; @@ -886,7 +886,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse of ApiResponse - public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public ApiResponse UploadFileWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) { // verify the required parameter 'petId' is set if (petId == null) @@ -951,7 +951,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// ApiResponse - public ApiResponse UploadFileWithRequiredFile (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) + public ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) { ApiResponse localVarResponse = UploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata); return localVarResponse.Data; @@ -965,7 +965,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// ApiResponse of ApiResponse - public ApiResponse< ApiResponse > UploadFileWithRequiredFileWithHttpInfo (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) + public ApiResponse UploadFileWithRequiredFileWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) { // verify the required parameter 'petId' is set if (petId == null) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/StoreApi.cs index 6336580069d..e9062792e83 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/StoreApi.cs @@ -52,8 +52,8 @@ namespace Org.OpenAPITools.Api /// Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Dictionary<string, int?> - Dictionary GetInventory (); + /// Dictionary<string, int> + Dictionary GetInventory (); /// /// Returns pet inventories by status @@ -62,8 +62,8 @@ namespace Org.OpenAPITools.Api /// Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// ApiResponse of Dictionary<string, int?> - ApiResponse> GetInventoryWithHttpInfo (); + /// ApiResponse of Dictionary<string, int> + ApiResponse> GetInventoryWithHttpInfo (); /// /// Find purchase order by ID /// @@ -73,7 +73,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Order - Order GetOrderById (long? orderId); + Order GetOrderById (long orderId); /// /// Find purchase order by ID @@ -84,7 +84,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// ApiResponse of Order - ApiResponse GetOrderByIdWithHttpInfo (long? orderId); + ApiResponse GetOrderByIdWithHttpInfo (long orderId); /// /// Place an order for a pet /// @@ -285,10 +285,10 @@ namespace Org.OpenAPITools.Api /// Returns pet inventories by status Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Dictionary<string, int?> - public Dictionary GetInventory () + /// Dictionary<string, int> + public Dictionary GetInventory () { - ApiResponse> localVarResponse = GetInventoryWithHttpInfo(); + ApiResponse> localVarResponse = GetInventoryWithHttpInfo(); return localVarResponse.Data; } @@ -296,8 +296,8 @@ namespace Org.OpenAPITools.Api /// Returns pet inventories by status Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// ApiResponse of Dictionary<string, int?> - public ApiResponse< Dictionary > GetInventoryWithHttpInfo () + /// ApiResponse of Dictionary<string, int> + public ApiResponse> GetInventoryWithHttpInfo () { var localVarPath = "/store/inventory"; @@ -341,9 +341,9 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse>(localVarStatusCode, + return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); + (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); } /// @@ -352,7 +352,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Order - public Order GetOrderById (long? orderId) + public Order GetOrderById (long orderId) { ApiResponse localVarResponse = GetOrderByIdWithHttpInfo(orderId); return localVarResponse.Data; @@ -364,7 +364,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// ApiResponse of Order - public ApiResponse< Order > GetOrderByIdWithHttpInfo (long? orderId) + public ApiResponse GetOrderByIdWithHttpInfo (long orderId) { // verify the required parameter 'orderId' is set if (orderId == null) @@ -431,7 +431,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// order placed for purchasing the pet /// ApiResponse of Order - public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body) + public ApiResponse PlaceOrderWithHttpInfo (Order body) { // verify the required parameter 'body' is set if (body == null) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/UserApi.cs index ede5bff28b3..6ebf1d90e2b 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Api/UserApi.cs @@ -600,7 +600,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// The name that needs to be fetched. Use user1 for testing. /// ApiResponse of User - public ApiResponse< User > GetUserByNameWithHttpInfo (string username) + public ApiResponse GetUserByNameWithHttpInfo (string username) { // verify the required parameter 'username' is set if (username == null) @@ -669,7 +669,7 @@ namespace Org.OpenAPITools.Api /// The user name for login /// The password for login in clear text /// ApiResponse of string - public ApiResponse< string > LoginUserWithHttpInfo (string username, string password) + public ApiResponse LoginUserWithHttpInfo (string username, string password) { // verify the required parameter 'username' is set if (username == null) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs index bb8bb6475e0..239289ffaba 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs @@ -28,7 +28,7 @@ namespace Org.OpenAPITools.Model /// AdditionalPropertiesBoolean /// [DataContract] - public partial class AdditionalPropertiesBoolean : Dictionary, IEquatable, IValidatableObject + public partial class AdditionalPropertiesBoolean : Dictionary, IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 661333e1276..8a4e6b78b30 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -44,7 +44,7 @@ namespace Org.OpenAPITools.Model /// anytype1. /// anytype2. /// anytype3. - public AdditionalPropertiesClass(Dictionary mapString = default(Dictionary), Dictionary mapNumber = default(Dictionary), Dictionary mapInteger = default(Dictionary), Dictionary mapBoolean = default(Dictionary), Dictionary> mapArrayInteger = default(Dictionary>), Dictionary> mapArrayAnytype = default(Dictionary>), Dictionary> mapMapString = default(Dictionary>), Dictionary> mapMapAnytype = default(Dictionary>), Object anytype1 = default(Object), Object anytype2 = default(Object), Object anytype3 = default(Object)) + public AdditionalPropertiesClass(Dictionary mapString = default(Dictionary), Dictionary mapNumber = default(Dictionary), Dictionary mapInteger = default(Dictionary), Dictionary mapBoolean = default(Dictionary), Dictionary> mapArrayInteger = default(Dictionary>), Dictionary> mapArrayAnytype = default(Dictionary>), Dictionary> mapMapString = default(Dictionary>), Dictionary> mapMapAnytype = default(Dictionary>), Object anytype1 = default(Object), Object anytype2 = default(Object), Object anytype3 = default(Object)) { this.MapString = mapString; this.MapNumber = mapNumber; @@ -69,25 +69,25 @@ namespace Org.OpenAPITools.Model /// Gets or Sets MapNumber /// [DataMember(Name="map_number", EmitDefaultValue=false)] - public Dictionary MapNumber { get; set; } + public Dictionary MapNumber { get; set; } /// /// Gets or Sets MapInteger /// [DataMember(Name="map_integer", EmitDefaultValue=false)] - public Dictionary MapInteger { get; set; } + public Dictionary MapInteger { get; set; } /// /// Gets or Sets MapBoolean /// [DataMember(Name="map_boolean", EmitDefaultValue=false)] - public Dictionary MapBoolean { get; set; } + public Dictionary MapBoolean { get; set; } /// /// Gets or Sets MapArrayInteger /// [DataMember(Name="map_array_integer", EmitDefaultValue=false)] - public Dictionary> MapArrayInteger { get; set; } + public Dictionary> MapArrayInteger { get; set; } /// /// Gets or Sets MapArrayAnytype diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs index dacca87d552..c714e994e26 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs @@ -28,7 +28,7 @@ namespace Org.OpenAPITools.Model /// AdditionalPropertiesInteger /// [DataContract] - public partial class AdditionalPropertiesInteger : Dictionary, IEquatable, IValidatableObject + public partial class AdditionalPropertiesInteger : Dictionary, IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs index 316ac1b811c..d727b2f68f1 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs @@ -28,7 +28,7 @@ namespace Org.OpenAPITools.Model /// AdditionalPropertiesNumber /// [DataContract] - public partial class AdditionalPropertiesNumber : Dictionary, IEquatable, IValidatableObject + public partial class AdditionalPropertiesNumber : Dictionary, IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/ApiResponse.cs index ca5099c2e1a..8f5a5a0e5a9 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -36,7 +36,7 @@ namespace Org.OpenAPITools.Model /// code. /// type. /// message. - public ApiResponse(int? code = default(int?), string type = default(string), string message = default(string)) + public ApiResponse(int code = default(int), string type = default(string), string message = default(string)) { this.Code = code; this.Type = type; @@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Code /// [DataMember(Name="code", EmitDefaultValue=false)] - public int? Code { get; set; } + public int Code { get; set; } /// /// Gets or Sets Type diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 2ca48dc1b12..0342fb2ce66 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -34,7 +34,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// arrayArrayNumber. - public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber = default(List>)) + public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber = default(List>)) { this.ArrayArrayNumber = arrayArrayNumber; } @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets ArrayArrayNumber /// [DataMember(Name="ArrayArrayNumber", EmitDefaultValue=false)] - public List> ArrayArrayNumber { get; set; } + public List> ArrayArrayNumber { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 9b600f4a79b..1b87d630d20 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -34,7 +34,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// arrayNumber. - public ArrayOfNumberOnly(List arrayNumber = default(List)) + public ArrayOfNumberOnly(List arrayNumber = default(List)) { this.ArrayNumber = arrayNumber; } @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets ArrayNumber /// [DataMember(Name="ArrayNumber", EmitDefaultValue=false)] - public List ArrayNumber { get; set; } + public List ArrayNumber { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/ArrayTest.cs index 3738a4e4473..10886bb6af6 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -36,7 +36,7 @@ namespace Org.OpenAPITools.Model /// arrayOfString. /// arrayArrayOfInteger. /// arrayArrayOfModel. - public ArrayTest(List arrayOfString = default(List), List> arrayArrayOfInteger = default(List>), List> arrayArrayOfModel = default(List>)) + public ArrayTest(List arrayOfString = default(List), List> arrayArrayOfInteger = default(List>), List> arrayArrayOfModel = default(List>)) { this.ArrayOfString = arrayOfString; this.ArrayArrayOfInteger = arrayArrayOfInteger; @@ -53,7 +53,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets ArrayArrayOfInteger /// [DataMember(Name="array_array_of_integer", EmitDefaultValue=false)] - public List> ArrayArrayOfInteger { get; set; } + public List> ArrayArrayOfInteger { get; set; } /// /// Gets or Sets ArrayArrayOfModel diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Cat.cs index 8dd338b3e59..1c28fb2755f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Cat.cs @@ -39,7 +39,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// declawed. - public Cat(bool? declawed = default(bool?), string className = default(string), string color = "red") : base(className, color) + public Cat(bool declawed = default(bool), string className = default(string), string color = "red") : base(className, color) { this.Declawed = declawed; } @@ -48,7 +48,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Declawed /// [DataMember(Name="declawed", EmitDefaultValue=false)] - public bool? Declawed { get; set; } + public bool Declawed { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/CatAllOf.cs index e17ff89769c..3d452f64b38 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/CatAllOf.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -34,7 +34,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// declawed. - public CatAllOf(bool? declawed = default(bool?)) + public CatAllOf(bool declawed = default(bool)) { this.Declawed = declawed; } @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Declawed /// [DataMember(Name="declawed", EmitDefaultValue=false)] - public bool? Declawed { get; set; } + public bool Declawed { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Category.cs index e8827551b57..9cf54d7ea34 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Category.cs @@ -40,7 +40,7 @@ namespace Org.OpenAPITools.Model /// /// id. /// name (required) (default to "default-name"). - public Category(long? id = default(long?), string name = "default-name") + public Category(long id = default(long), string name = "default-name") { // to ensure "name" is required (not null) if (name == null) @@ -59,7 +59,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Name diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/FormatTest.cs index 4fd444a4e1a..b8735b8587d 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/FormatTest.cs @@ -51,7 +51,7 @@ namespace Org.OpenAPITools.Model /// dateTime. /// uuid. /// password (required). - public FormatTest(int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), decimal? number = default(decimal?), float? _float = default(float?), double? _double = default(double?), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), Guid? uuid = default(Guid?), string password = default(string)) + public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string)) { // to ensure "number" is required (not null) if (number == null) @@ -108,37 +108,37 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Integer /// [DataMember(Name="integer", EmitDefaultValue=false)] - public int? Integer { get; set; } + public int Integer { get; set; } /// /// Gets or Sets Int32 /// [DataMember(Name="int32", EmitDefaultValue=false)] - public int? Int32 { get; set; } + public int Int32 { get; set; } /// /// Gets or Sets Int64 /// [DataMember(Name="int64", EmitDefaultValue=false)] - public long? Int64 { get; set; } + public long Int64 { get; set; } /// /// Gets or Sets Number /// [DataMember(Name="number", EmitDefaultValue=false)] - public decimal? Number { get; set; } + public decimal Number { get; set; } /// /// Gets or Sets Float /// [DataMember(Name="float", EmitDefaultValue=false)] - public float? Float { get; set; } + public float Float { get; set; } /// /// Gets or Sets Double /// [DataMember(Name="double", EmitDefaultValue=false)] - public double? Double { get; set; } + public double Double { get; set; } /// /// Gets or Sets String @@ -163,19 +163,19 @@ namespace Org.OpenAPITools.Model /// [DataMember(Name="date", EmitDefaultValue=false)] [JsonConverter(typeof(OpenAPIDateConverter))] - public DateTime? Date { get; set; } + public DateTime Date { get; set; } /// /// Gets or Sets DateTime /// [DataMember(Name="dateTime", EmitDefaultValue=false)] - public DateTime? DateTime { get; set; } + public DateTime DateTime { get; set; } /// /// Gets or Sets Uuid /// [DataMember(Name="uuid", EmitDefaultValue=false)] - public Guid? Uuid { get; set; } + public Guid Uuid { get; set; } /// /// Gets or Sets Password @@ -351,62 +351,62 @@ namespace Org.OpenAPITools.Model /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - // Integer (int?) maximum - if(this.Integer > (int?)100) + // Integer (int) maximum + if(this.Integer > (int)100) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); } - // Integer (int?) minimum - if(this.Integer < (int?)10) + // Integer (int) minimum + if(this.Integer < (int)10) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); } - // Int32 (int?) maximum - if(this.Int32 > (int?)200) + // Int32 (int) maximum + if(this.Int32 > (int)200) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); } - // Int32 (int?) minimum - if(this.Int32 < (int?)20) + // Int32 (int) minimum + if(this.Int32 < (int)20) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } - // Number (decimal?) maximum - if(this.Number > (decimal?)543.2) + // Number (decimal) maximum + if(this.Number > (decimal)543.2) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); } - // Number (decimal?) minimum - if(this.Number < (decimal?)32.1) + // Number (decimal) minimum + if(this.Number < (decimal)32.1) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); } - // Float (float?) maximum - if(this.Float > (float?)987.6) + // Float (float) maximum + if(this.Float > (float)987.6) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); } - // Float (float?) minimum - if(this.Float < (float?)54.3) + // Float (float) minimum + if(this.Float < (float)54.3) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); } - // Double (double?) maximum - if(this.Double > (double?)123.4) + // Double (double) maximum + if(this.Double > (double)123.4) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); } - // Double (double?) minimum - if(this.Double < (double?)67.8) + // Double (double) minimum + if(this.Double < (double)67.8) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); } diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/MapTest.cs index 01f5a9b7840..71368b4b44d 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/MapTest.cs @@ -63,7 +63,7 @@ namespace Org.OpenAPITools.Model /// mapOfEnumString. /// directMap. /// indirectMap. - public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary), Dictionary directMap = default(Dictionary), Dictionary indirectMap = default(Dictionary)) + public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary), Dictionary directMap = default(Dictionary), Dictionary indirectMap = default(Dictionary)) { this.MapMapOfString = mapMapOfString; this.MapOfEnumString = mapOfEnumString; @@ -82,13 +82,13 @@ namespace Org.OpenAPITools.Model /// Gets or Sets DirectMap /// [DataMember(Name="direct_map", EmitDefaultValue=false)] - public Dictionary DirectMap { get; set; } + public Dictionary DirectMap { get; set; } /// /// Gets or Sets IndirectMap /// [DataMember(Name="indirect_map", EmitDefaultValue=false)] - public Dictionary IndirectMap { get; set; } + public Dictionary IndirectMap { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index c9cf10c0cb2..627a4d358b7 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -36,7 +36,7 @@ namespace Org.OpenAPITools.Model /// uuid. /// dateTime. /// map. - public MixedPropertiesAndAdditionalPropertiesClass(Guid? uuid = default(Guid?), DateTime? dateTime = default(DateTime?), Dictionary map = default(Dictionary)) + public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) { this.Uuid = uuid; this.DateTime = dateTime; @@ -47,13 +47,13 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Uuid /// [DataMember(Name="uuid", EmitDefaultValue=false)] - public Guid? Uuid { get; set; } + public Guid Uuid { get; set; } /// /// Gets or Sets DateTime /// [DataMember(Name="dateTime", EmitDefaultValue=false)] - public DateTime? DateTime { get; set; } + public DateTime DateTime { get; set; } /// /// Gets or Sets Map diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Model200Response.cs index 9abadca143f..58853af412d 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Model200Response.cs @@ -35,7 +35,7 @@ namespace Org.OpenAPITools.Model /// /// name. /// _class. - public Model200Response(int? name = default(int?), string _class = default(string)) + public Model200Response(int name = default(int), string _class = default(string)) { this.Name = name; this.Class = _class; @@ -45,7 +45,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Name /// [DataMember(Name="name", EmitDefaultValue=false)] - public int? Name { get; set; } + public int Name { get; set; } /// /// Gets or Sets Class diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Name.cs index 603c7d88707..2c76d68a122 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Name.cs @@ -40,7 +40,7 @@ namespace Org.OpenAPITools.Model /// /// name (required). /// property. - public Name(int? name = default(int?), string property = default(string)) + public Name(int name = default(int), string property = default(string)) { // to ensure "name" is required (not null) if (name == null) @@ -59,13 +59,13 @@ namespace Org.OpenAPITools.Model /// Gets or Sets _Name /// [DataMember(Name="name", EmitDefaultValue=false)] - public int? _Name { get; set; } + public int _Name { get; set; } /// /// Gets or Sets SnakeCase /// [DataMember(Name="snake_case", EmitDefaultValue=false)] - public int? SnakeCase { get; private set; } + public int SnakeCase { get; private set; } /// /// Gets or Sets Property @@ -77,7 +77,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets _123Number /// [DataMember(Name="123Number", EmitDefaultValue=false)] - public int? _123Number { get; private set; } + public int _123Number { get; private set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/NumberOnly.cs index 00a4f3281e3..62f401d8785 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -34,7 +34,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// justNumber. - public NumberOnly(decimal? justNumber = default(decimal?)) + public NumberOnly(decimal justNumber = default(decimal)) { this.JustNumber = justNumber; } @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets JustNumber /// [DataMember(Name="JustNumber", EmitDefaultValue=false)] - public decimal? JustNumber { get; set; } + public decimal JustNumber { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Order.cs index 6bc71d339cc..c46c951fd30 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Order.cs @@ -72,7 +72,7 @@ namespace Org.OpenAPITools.Model /// shipDate. /// Order Status. /// complete (default to false). - public Order(long? id = default(long?), long? petId = default(long?), int? quantity = default(int?), DateTime? shipDate = default(DateTime?), StatusEnum? status = default(StatusEnum?), bool? complete = false) + public Order(long id = default(long), long petId = default(long), int quantity = default(int), DateTime shipDate = default(DateTime), StatusEnum? status = default(StatusEnum?), bool complete = false) { this.Id = id; this.PetId = petId; @@ -94,32 +94,32 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets PetId /// [DataMember(Name="petId", EmitDefaultValue=false)] - public long? PetId { get; set; } + public long PetId { get; set; } /// /// Gets or Sets Quantity /// [DataMember(Name="quantity", EmitDefaultValue=false)] - public int? Quantity { get; set; } + public int Quantity { get; set; } /// /// Gets or Sets ShipDate /// [DataMember(Name="shipDate", EmitDefaultValue=false)] - public DateTime? ShipDate { get; set; } + public DateTime ShipDate { get; set; } /// /// Gets or Sets Complete /// [DataMember(Name="complete", EmitDefaultValue=false)] - public bool? Complete { get; set; } + public bool Complete { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/OuterComposite.cs index 7a1aaea94e3..eef811e7299 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -36,7 +36,7 @@ namespace Org.OpenAPITools.Model /// myNumber. /// myString. /// myBoolean. - public OuterComposite(decimal? myNumber = default(decimal?), string myString = default(string), bool? myBoolean = default(bool?)) + public OuterComposite(decimal myNumber = default(decimal), string myString = default(string), bool myBoolean = default(bool)) { this.MyNumber = myNumber; this.MyString = myString; @@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets MyNumber /// [DataMember(Name="my_number", EmitDefaultValue=false)] - public decimal? MyNumber { get; set; } + public decimal MyNumber { get; set; } /// /// Gets or Sets MyString @@ -59,7 +59,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets MyBoolean /// [DataMember(Name="my_boolean", EmitDefaultValue=false)] - public bool? MyBoolean { get; set; } + public bool MyBoolean { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Pet.cs index 83103aaf28e..4616c023097 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Pet.cs @@ -77,7 +77,7 @@ namespace Org.OpenAPITools.Model /// photoUrls (required). /// tags. /// pet status in the store. - public Pet(long? id = default(long?), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) + public Pet(long id = default(long), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) { // to ensure "name" is required (not null) if (name == null) @@ -109,7 +109,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Category diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Return.cs index f66b4ae50fb..c12d15c0a65 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Return.cs @@ -34,7 +34,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// _return. - public Return(int? _return = default(int?)) + public Return(int _return = default(int)) { this._Return = _return; } @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets _Return /// [DataMember(Name="return", EmitDefaultValue=false)] - public int? _Return { get; set; } + public int _Return { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/SpecialModelName.cs index 32c04672a4f..0cd2939c9e1 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -34,7 +34,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// specialPropertyName. - public SpecialModelName(long? specialPropertyName = default(long?)) + public SpecialModelName(long specialPropertyName = default(long)) { this.SpecialPropertyName = specialPropertyName; } @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets SpecialPropertyName /// [DataMember(Name="$special[property.name]", EmitDefaultValue=false)] - public long? SpecialPropertyName { get; set; } + public long SpecialPropertyName { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Tag.cs index 9929598f0e6..4ed40c915d2 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Tag.cs @@ -35,7 +35,7 @@ namespace Org.OpenAPITools.Model /// /// id. /// name. - public Tag(long? id = default(long?), string name = default(string)) + public Tag(long id = default(long), string name = default(string)) { this.Id = id; this.Name = name; @@ -45,7 +45,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Name diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/TypeHolderDefault.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/TypeHolderDefault.cs index ae501fb3acf..5cce95ad3a0 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/TypeHolderDefault.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/TypeHolderDefault.cs @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// integerItem (required). /// boolItem (required) (default to true). /// arrayItem (required). - public TypeHolderDefault(string stringItem = "what", decimal? numberItem = default(decimal?), int? integerItem = default(int?), bool? boolItem = true, List arrayItem = default(List)) + public TypeHolderDefault(string stringItem = "what", decimal numberItem = default(decimal), int integerItem = default(int), bool boolItem = true, List arrayItem = default(List)) { // to ensure "stringItem" is required (not null) if (stringItem == null) @@ -107,25 +107,25 @@ namespace Org.OpenAPITools.Model /// Gets or Sets NumberItem /// [DataMember(Name="number_item", EmitDefaultValue=false)] - public decimal? NumberItem { get; set; } + public decimal NumberItem { get; set; } /// /// Gets or Sets IntegerItem /// [DataMember(Name="integer_item", EmitDefaultValue=false)] - public int? IntegerItem { get; set; } + public int IntegerItem { get; set; } /// /// Gets or Sets BoolItem /// [DataMember(Name="bool_item", EmitDefaultValue=false)] - public bool? BoolItem { get; set; } + public bool BoolItem { get; set; } /// /// Gets or Sets ArrayItem /// [DataMember(Name="array_item", EmitDefaultValue=false)] - public List ArrayItem { get; set; } + public List ArrayItem { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/TypeHolderExample.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/TypeHolderExample.cs index f6ef807487e..384b5dbbc95 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/TypeHolderExample.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/TypeHolderExample.cs @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// integerItem (required). /// boolItem (required). /// arrayItem (required). - public TypeHolderExample(string stringItem = default(string), decimal? numberItem = default(decimal?), int? integerItem = default(int?), bool? boolItem = default(bool?), List arrayItem = default(List)) + public TypeHolderExample(string stringItem = default(string), decimal numberItem = default(decimal), int integerItem = default(int), bool boolItem = default(bool), List arrayItem = default(List)) { // to ensure "stringItem" is required (not null) if (stringItem == null) @@ -107,25 +107,25 @@ namespace Org.OpenAPITools.Model /// Gets or Sets NumberItem /// [DataMember(Name="number_item", EmitDefaultValue=false)] - public decimal? NumberItem { get; set; } + public decimal NumberItem { get; set; } /// /// Gets or Sets IntegerItem /// [DataMember(Name="integer_item", EmitDefaultValue=false)] - public int? IntegerItem { get; set; } + public int IntegerItem { get; set; } /// /// Gets or Sets BoolItem /// [DataMember(Name="bool_item", EmitDefaultValue=false)] - public bool? BoolItem { get; set; } + public bool BoolItem { get; set; } /// /// Gets or Sets ArrayItem /// [DataMember(Name="array_item", EmitDefaultValue=false)] - public List ArrayItem { get; set; } + public List ArrayItem { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/User.cs index 173ac15c2dc..d59b7b04132 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/User.cs @@ -41,7 +41,7 @@ namespace Org.OpenAPITools.Model /// password. /// phone. /// User Status. - public User(long? id = default(long?), string username = default(string), string firstName = default(string), string lastName = default(string), string email = default(string), string password = default(string), string phone = default(string), int? userStatus = default(int?)) + public User(long id = default(long), string username = default(string), string firstName = default(string), string lastName = default(string), string email = default(string), string password = default(string), string phone = default(string), int userStatus = default(int)) { this.Id = id; this.Username = username; @@ -57,7 +57,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Username @@ -100,7 +100,7 @@ namespace Org.OpenAPITools.Model /// /// User Status [DataMember(Name="userStatus", EmitDefaultValue=false)] - public int? UserStatus { get; set; } + public int UserStatus { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/XmlItem.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/XmlItem.cs index 2fc1cda565c..5cebfb5f5a2 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/XmlItem.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/XmlItem.cs @@ -62,7 +62,7 @@ namespace Org.OpenAPITools.Model /// prefixNsBoolean. /// prefixNsArray. /// prefixNsWrappedArray. - public XmlItem(string attributeString = default(string), decimal? attributeNumber = default(decimal?), int? attributeInteger = default(int?), bool? attributeBoolean = default(bool?), List wrappedArray = default(List), string nameString = default(string), decimal? nameNumber = default(decimal?), int? nameInteger = default(int?), bool? nameBoolean = default(bool?), List nameArray = default(List), List nameWrappedArray = default(List), string prefixString = default(string), decimal? prefixNumber = default(decimal?), int? prefixInteger = default(int?), bool? prefixBoolean = default(bool?), List prefixArray = default(List), List prefixWrappedArray = default(List), string namespaceString = default(string), decimal? namespaceNumber = default(decimal?), int? namespaceInteger = default(int?), bool? namespaceBoolean = default(bool?), List namespaceArray = default(List), List namespaceWrappedArray = default(List), string prefixNsString = default(string), decimal? prefixNsNumber = default(decimal?), int? prefixNsInteger = default(int?), bool? prefixNsBoolean = default(bool?), List prefixNsArray = default(List), List prefixNsWrappedArray = default(List)) + public XmlItem(string attributeString = default(string), decimal attributeNumber = default(decimal), int attributeInteger = default(int), bool attributeBoolean = default(bool), List wrappedArray = default(List), string nameString = default(string), decimal nameNumber = default(decimal), int nameInteger = default(int), bool nameBoolean = default(bool), List nameArray = default(List), List nameWrappedArray = default(List), string prefixString = default(string), decimal prefixNumber = default(decimal), int prefixInteger = default(int), bool prefixBoolean = default(bool), List prefixArray = default(List), List prefixWrappedArray = default(List), string namespaceString = default(string), decimal namespaceNumber = default(decimal), int namespaceInteger = default(int), bool namespaceBoolean = default(bool), List namespaceArray = default(List), List namespaceWrappedArray = default(List), string prefixNsString = default(string), decimal prefixNsNumber = default(decimal), int prefixNsInteger = default(int), bool prefixNsBoolean = default(bool), List prefixNsArray = default(List), List prefixNsWrappedArray = default(List)) { this.AttributeString = attributeString; this.AttributeNumber = attributeNumber; @@ -105,25 +105,25 @@ namespace Org.OpenAPITools.Model /// Gets or Sets AttributeNumber /// [DataMember(Name="attribute_number", EmitDefaultValue=false)] - public decimal? AttributeNumber { get; set; } + public decimal AttributeNumber { get; set; } /// /// Gets or Sets AttributeInteger /// [DataMember(Name="attribute_integer", EmitDefaultValue=false)] - public int? AttributeInteger { get; set; } + public int AttributeInteger { get; set; } /// /// Gets or Sets AttributeBoolean /// [DataMember(Name="attribute_boolean", EmitDefaultValue=false)] - public bool? AttributeBoolean { get; set; } + public bool AttributeBoolean { get; set; } /// /// Gets or Sets WrappedArray /// [DataMember(Name="wrapped_array", EmitDefaultValue=false)] - public List WrappedArray { get; set; } + public List WrappedArray { get; set; } /// /// Gets or Sets NameString @@ -135,31 +135,31 @@ namespace Org.OpenAPITools.Model /// Gets or Sets NameNumber /// [DataMember(Name="name_number", EmitDefaultValue=false)] - public decimal? NameNumber { get; set; } + public decimal NameNumber { get; set; } /// /// Gets or Sets NameInteger /// [DataMember(Name="name_integer", EmitDefaultValue=false)] - public int? NameInteger { get; set; } + public int NameInteger { get; set; } /// /// Gets or Sets NameBoolean /// [DataMember(Name="name_boolean", EmitDefaultValue=false)] - public bool? NameBoolean { get; set; } + public bool NameBoolean { get; set; } /// /// Gets or Sets NameArray /// [DataMember(Name="name_array", EmitDefaultValue=false)] - public List NameArray { get; set; } + public List NameArray { get; set; } /// /// Gets or Sets NameWrappedArray /// [DataMember(Name="name_wrapped_array", EmitDefaultValue=false)] - public List NameWrappedArray { get; set; } + public List NameWrappedArray { get; set; } /// /// Gets or Sets PrefixString @@ -171,31 +171,31 @@ namespace Org.OpenAPITools.Model /// Gets or Sets PrefixNumber /// [DataMember(Name="prefix_number", EmitDefaultValue=false)] - public decimal? PrefixNumber { get; set; } + public decimal PrefixNumber { get; set; } /// /// Gets or Sets PrefixInteger /// [DataMember(Name="prefix_integer", EmitDefaultValue=false)] - public int? PrefixInteger { get; set; } + public int PrefixInteger { get; set; } /// /// Gets or Sets PrefixBoolean /// [DataMember(Name="prefix_boolean", EmitDefaultValue=false)] - public bool? PrefixBoolean { get; set; } + public bool PrefixBoolean { get; set; } /// /// Gets or Sets PrefixArray /// [DataMember(Name="prefix_array", EmitDefaultValue=false)] - public List PrefixArray { get; set; } + public List PrefixArray { get; set; } /// /// Gets or Sets PrefixWrappedArray /// [DataMember(Name="prefix_wrapped_array", EmitDefaultValue=false)] - public List PrefixWrappedArray { get; set; } + public List PrefixWrappedArray { get; set; } /// /// Gets or Sets NamespaceString @@ -207,31 +207,31 @@ namespace Org.OpenAPITools.Model /// Gets or Sets NamespaceNumber /// [DataMember(Name="namespace_number", EmitDefaultValue=false)] - public decimal? NamespaceNumber { get; set; } + public decimal NamespaceNumber { get; set; } /// /// Gets or Sets NamespaceInteger /// [DataMember(Name="namespace_integer", EmitDefaultValue=false)] - public int? NamespaceInteger { get; set; } + public int NamespaceInteger { get; set; } /// /// Gets or Sets NamespaceBoolean /// [DataMember(Name="namespace_boolean", EmitDefaultValue=false)] - public bool? NamespaceBoolean { get; set; } + public bool NamespaceBoolean { get; set; } /// /// Gets or Sets NamespaceArray /// [DataMember(Name="namespace_array", EmitDefaultValue=false)] - public List NamespaceArray { get; set; } + public List NamespaceArray { get; set; } /// /// Gets or Sets NamespaceWrappedArray /// [DataMember(Name="namespace_wrapped_array", EmitDefaultValue=false)] - public List NamespaceWrappedArray { get; set; } + public List NamespaceWrappedArray { get; set; } /// /// Gets or Sets PrefixNsString @@ -243,31 +243,31 @@ namespace Org.OpenAPITools.Model /// Gets or Sets PrefixNsNumber /// [DataMember(Name="prefix_ns_number", EmitDefaultValue=false)] - public decimal? PrefixNsNumber { get; set; } + public decimal PrefixNsNumber { get; set; } /// /// Gets or Sets PrefixNsInteger /// [DataMember(Name="prefix_ns_integer", EmitDefaultValue=false)] - public int? PrefixNsInteger { get; set; } + public int PrefixNsInteger { get; set; } /// /// Gets or Sets PrefixNsBoolean /// [DataMember(Name="prefix_ns_boolean", EmitDefaultValue=false)] - public bool? PrefixNsBoolean { get; set; } + public bool PrefixNsBoolean { get; set; } /// /// Gets or Sets PrefixNsArray /// [DataMember(Name="prefix_ns_array", EmitDefaultValue=false)] - public List PrefixNsArray { get; set; } + public List PrefixNsArray { get; set; } /// /// Gets or Sets PrefixNsWrappedArray /// [DataMember(Name="prefix_ns_wrapped_array", EmitDefaultValue=false)] - public List PrefixNsWrappedArray { get; set; } + public List PrefixNsWrappedArray { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/.openapi-generator/VERSION index 096bf47efe3..83a328a9227 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/README.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/README.md index 2676c56acc9..260c3df449a 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/README.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/README.md @@ -8,34 +8,39 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap - SDK version: 1.0.0 - Build package: org.openapitools.codegen.languages.CSharpClientCodegen - ## Frameworks supported + + - .NET Core >=1.0 - .NET Framework >=4.6 - Mono/Xamarin >=vNext - UWP >=10.0 - ## Dependencies + + - FubarCoder.RestSharp.Portable.Core >=4.0.7 - FubarCoder.RestSharp.Portable.HttpClient >=4.0.7 - Newtonsoft.Json >=10.0.3 - ## Installation + Generate the DLL using your preferred tool Then include the DLL (under the `bin` folder) in the C# project, and use the namespaces: + ```csharp using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; using Org.OpenAPITools.Model; + ``` - + + ## Getting Started ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -45,21 +50,24 @@ namespace Example { public class Example { - public void main() + public static void Main() { - var apiInstance = new AnotherFakeApi(); - var modelClient = new ModelClient(); // ModelClient | client model + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(Configuration.Default); + var body = new ModelClient(); // ModelClient | client model try { // To test special tags - ModelClient result = apiInstance.TestSpecialTags(modelClient); + ModelClient result = apiInstance.Call123TestSpecialTags(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { - Debug.Print("Exception when calling AnotherFakeApi.TestSpecialTags: " + e.Message ); + Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } @@ -67,22 +75,24 @@ namespace Example } ``` - ## Documentation for API Endpoints All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*AnotherFakeApi* | [**TestSpecialTags**](docs/AnotherFakeApi.md#testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +*AnotherFakeApi* | [**Call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +*FakeApi* | [**CreateXmlItem**](docs/FakeApi.md#createxmlitem) | **POST** /fake/create_xml_item | creates an XmlItem *FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | *FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | *FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | *FakeApi* | [**FakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +*FakeApi* | [**TestBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeApi* | [**TestBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeApi* | [**TestClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data *FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case @@ -94,6 +104,7 @@ Class | Method | HTTP request | Description *PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet *PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*PetApi* | [**UploadFileWithRequiredFile**](docs/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) *StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status *StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID @@ -108,24 +119,33 @@ Class | Method | HTTP request | Description *UserApi* | [**UpdateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user - ## Documentation for Models + - [Model.AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) + - [Model.AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) + - [Model.AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) - [Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [Model.AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) + - [Model.AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) + - [Model.AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) + - [Model.AdditionalPropertiesString](docs/AdditionalPropertiesString.md) - [Model.Animal](docs/Animal.md) - - [Model.AnimalFarm](docs/AnimalFarm.md) - [Model.ApiResponse](docs/ApiResponse.md) - [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [Model.ArrayTest](docs/ArrayTest.md) - [Model.Capitalization](docs/Capitalization.md) - [Model.Cat](docs/Cat.md) + - [Model.CatAllOf](docs/CatAllOf.md) - [Model.Category](docs/Category.md) - [Model.ClassModel](docs/ClassModel.md) - [Model.Dog](docs/Dog.md) + - [Model.DogAllOf](docs/DogAllOf.md) - [Model.EnumArrays](docs/EnumArrays.md) - [Model.EnumClass](docs/EnumClass.md) - [Model.EnumTest](docs/EnumTest.md) + - [Model.File](docs/File.md) + - [Model.FileSchemaTestClass](docs/FileSchemaTestClass.md) - [Model.FormatTest](docs/FormatTest.md) - [Model.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - [Model.List](docs/List.md) @@ -143,34 +163,40 @@ Class | Method | HTTP request | Description - [Model.Return](docs/Return.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) + - [Model.TypeHolderDefault](docs/TypeHolderDefault.md) + - [Model.TypeHolderExample](docs/TypeHolderExample.md) - [Model.User](docs/User.md) + - [Model.XmlItem](docs/XmlItem.md) - ## Documentation for Authorization - + ### api_key - **Type**: API key + - **API key parameter name**: api_key - **Location**: HTTP header - + ### api_key_query - **Type**: API key + - **API key parameter name**: api_key_query - **Location**: URL query string - + ### http_basic_test + - **Type**: HTTP basic authentication - + ### petstore_auth + - **Type**: OAuth - **Flow**: implicit - **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesAnyType.md new file mode 100644 index 00000000000..fd118d3bfc5 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesAnyType.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.AdditionalPropertiesAnyType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesArray.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesArray.md new file mode 100644 index 00000000000..3d0606cea5f --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesArray.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.AdditionalPropertiesArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesBoolean.md new file mode 100644 index 00000000000..bb4b2498263 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesBoolean.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.AdditionalPropertiesBoolean + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesClass.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesClass.md index 057f5bd65df..d07f57619d5 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesClass.md @@ -1,10 +1,23 @@ + # Org.OpenAPITools.Model.AdditionalPropertiesClass + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MapProperty** | **Dictionary<string, string>** | | [optional] -**MapOfMapProperty** | **Dictionary<string, Dictionary<string, string>>** | | [optional] +**MapString** | **Dictionary<string, string>** | | [optional] +**MapNumber** | **Dictionary<string, decimal>** | | [optional] +**MapInteger** | **Dictionary<string, int>** | | [optional] +**MapBoolean** | **Dictionary<string, bool>** | | [optional] +**MapArrayInteger** | **Dictionary<string, List<int>>** | | [optional] +**MapArrayAnytype** | **Dictionary<string, List<Object>>** | | [optional] +**MapMapString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] +**MapMapAnytype** | **Dictionary<string, Dictionary<string, Object>>** | | [optional] +**Anytype1** | [**Object**](.md) | | [optional] +**Anytype2** | [**Object**](.md) | | [optional] +**Anytype3** | [**Object**](.md) | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesInteger.md new file mode 100644 index 00000000000..86a6259ecc9 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesInteger.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.AdditionalPropertiesInteger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesNumber.md new file mode 100644 index 00000000000..8dc46024e03 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesNumber.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.AdditionalPropertiesNumber + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesObject.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesObject.md new file mode 100644 index 00000000000..455456fe6dd --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesObject.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.AdditionalPropertiesObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesString.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesString.md new file mode 100644 index 00000000000..0f7cf804167 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AdditionalPropertiesString.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.AdditionalPropertiesString + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Animal.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Animal.md index a97ce49b801..0a05bcdf061 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Animal.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Animal.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.Animal + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **ClassName** | **string** | | **Color** | **string** | | [optional] [default to "red"] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AnotherFakeApi.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AnotherFakeApi.md index 2dca444f276..5af41a1862c 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AnotherFakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/AnotherFakeApi.md @@ -4,20 +4,22 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**TestSpecialTags**](AnotherFakeApi.md#testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +[**Call123TestSpecialTags**](AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags - -# **TestSpecialTags** -> ModelClient TestSpecialTags (ModelClient modelClient) + +## Call123TestSpecialTags + +> ModelClient Call123TestSpecialTags (ModelClient body) To test special tags -To test special tags +To test special tags and operation ID starting with number ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -25,22 +27,25 @@ using Org.OpenAPITools.Model; namespace Example { - public class TestSpecialTagsExample + public class Call123TestSpecialTagsExample { - public void main() + public static void Main() { - var apiInstance = new AnotherFakeApi(); - var modelClient = new ModelClient(); // ModelClient | client model + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(Configuration.Default); + var body = new ModelClient(); // ModelClient | client model try { // To test special tags - ModelClient result = apiInstance.TestSpecialTags(modelClient); + ModelClient result = apiInstance.Call123TestSpecialTags(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { - Debug.Print("Exception when calling AnotherFakeApi.TestSpecialTags: " + e.Message ); + Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -49,9 +54,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **modelClient** | [**ModelClient**](ModelClient.md)| client model | + **body** | [**ModelClient**](ModelClient.md)| client model | ### Return type @@ -63,8 +69,16 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ApiResponse.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ApiResponse.md index 01b35815bd4..a3b916355fd 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ApiResponse.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ApiResponse.md @@ -1,11 +1,15 @@ + # Org.OpenAPITools.Model.ApiResponse + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Code** | **int?** | | [optional] +**Code** | **int** | | [optional] **Type** | **string** | | [optional] **Message** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ArrayOfArrayOfNumberOnly.md index 614546d3256..e05ea7dc240 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ArrayOfArrayOfNumberOnly.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.ArrayOfArrayOfNumberOnly + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ArrayArrayNumber** | **List<List<decimal?>>** | | [optional] +**ArrayArrayNumber** | **List<List<decimal>>** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ArrayOfNumberOnly.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ArrayOfNumberOnly.md index 1886a6edcb4..5f593d42929 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ArrayOfNumberOnly.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.ArrayOfNumberOnly + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ArrayNumber** | **List<decimal?>** | | [optional] +**ArrayNumber** | **List<decimal>** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ArrayTest.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ArrayTest.md index ff6a6cb24b0..593bc2d7386 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ArrayTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ArrayTest.md @@ -1,11 +1,15 @@ + # Org.OpenAPITools.Model.ArrayTest + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ArrayOfString** | **List<string>** | | [optional] -**ArrayArrayOfInteger** | **List<List<long?>>** | | [optional] +**ArrayArrayOfInteger** | **List<List<long>>** | | [optional] **ArrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Capitalization.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Capitalization.md index 74c1ab66db2..0c66f2d2d44 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Capitalization.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Capitalization.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.Capitalization + ## Properties Name | Type | Description | Notes @@ -10,5 +12,7 @@ Name | Type | Description | Notes **SCAETHFlowPoints** | **string** | | [optional] **ATT_NAME** | **string** | Name of the pet | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Cat.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Cat.md index 4b79315204f..6609de8e12a 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Cat.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Cat.md @@ -1,11 +1,15 @@ + # Org.OpenAPITools.Model.Cat + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ClassName** | **string** | | **Color** | **string** | | [optional] [default to "red"] -**Declawed** | **bool?** | | [optional] +**Declawed** | **bool** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/CatAllOf.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/CatAllOf.md new file mode 100644 index 00000000000..d623d2a0a6e --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/CatAllOf.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.CatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Declawed** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Category.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Category.md index 860a468e35c..42102d4e508 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Category.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Category.md @@ -1,10 +1,14 @@ + # Org.OpenAPITools.Model.Category + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] -**Name** | **string** | | [optional] +**Id** | **long** | | [optional] +**Name** | **string** | | [default to "default-name"] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ClassModel.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ClassModel.md index 556b05db241..b2b42407d2b 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ClassModel.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ClassModel.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.ClassModel + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Class** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Dog.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Dog.md index aa5df1a927a..1f39769d2b9 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Dog.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Dog.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.Dog + ## Properties Name | Type | Description | Notes @@ -7,5 +9,7 @@ Name | Type | Description | Notes **Color** | **string** | | [optional] [default to "red"] **Breed** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/DogAllOf.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/DogAllOf.md new file mode 100644 index 00000000000..d72134a0f5f --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/DogAllOf.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.DogAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Breed** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/EnumArrays.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/EnumArrays.md index 2dfe0e22388..9d58d25f972 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/EnumArrays.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/EnumArrays.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.EnumArrays + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **JustSymbol** | **string** | | [optional] **ArrayEnum** | **List<string>** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/EnumClass.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/EnumClass.md index 4fb1eae9c06..16d21587b4c 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/EnumClass.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/EnumClass.md @@ -1,8 +1,12 @@ + # Org.OpenAPITools.Model.EnumClass + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/EnumTest.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/EnumTest.md index 65bc4d2cb04..f8bc67baa6a 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/EnumTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/EnumTest.md @@ -1,13 +1,17 @@ + # Org.OpenAPITools.Model.EnumTest + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **EnumString** | **string** | | [optional] **EnumStringRequired** | **string** | | -**EnumInteger** | **int?** | | [optional] -**EnumNumber** | **double?** | | [optional] +**EnumInteger** | **int** | | [optional] +**EnumNumber** | **double** | | [optional] **OuterEnum** | **OuterEnum** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FakeApi.md index 2a4fb6094ae..2738b9e1853 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FakeApi.md @@ -4,29 +4,108 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**CreateXmlItem**](FakeApi.md#createxmlitem) | **POST** /fake/create_xml_item | creates an XmlItem [**FakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | [**FakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | [**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | [**FakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +[**TestBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**TestBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | [**TestClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model [**TestEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**TestEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +[**TestGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**TestInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties [**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data - -# **FakeOuterBooleanSerialize** -> bool? FakeOuterBooleanSerialize (bool? body = null) + +## CreateXmlItem + +> void CreateXmlItem (XmlItem xmlItem) + +creates an XmlItem + +this route creates an XmlItem + +### Example + +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class CreateXmlItemExample + { + public static void Main() + { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var xmlItem = new XmlItem(); // XmlItem | XmlItem Body + + try + { + // creates an XmlItem + apiInstance.CreateXmlItem(xmlItem); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.CreateXmlItem: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xmlItem** | [**XmlItem**](XmlItem.md)| XmlItem Body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### 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 +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FakeOuterBooleanSerialize + +> bool FakeOuterBooleanSerialize (bool body = null) Test serialization of outer boolean types ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -36,19 +115,22 @@ namespace Example { public class FakeOuterBooleanSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var body = true; // bool? | Input boolean as post body (optional) + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var body = true; // bool | Input boolean as post body (optional) try { - bool? result = apiInstance.FakeOuterBooleanSerialize(body); + bool result = apiInstance.FakeOuterBooleanSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -57,13 +139,14 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **bool?**| Input boolean as post body | [optional] + **body** | **bool**| Input boolean as post body | [optional] ### Return type -**bool?** +**bool** ### Authorization @@ -71,22 +154,32 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: */* +- **Content-Type**: Not defined +- **Accept**: */* -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | - -# **FakeOuterCompositeSerialize** -> OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FakeOuterCompositeSerialize + +> OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) Test serialization of object with outer number type ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -96,19 +189,22 @@ namespace Example { public class FakeOuterCompositeSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body (optional) + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var body = new OuterComposite(); // OuterComposite | Input composite as post body (optional) try { - OuterComposite result = apiInstance.FakeOuterCompositeSerialize(outerComposite); + OuterComposite result = apiInstance.FakeOuterCompositeSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -117,9 +213,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -131,22 +228,32 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: */* +- **Content-Type**: Not defined +- **Accept**: */* -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | - -# **FakeOuterNumberSerialize** -> decimal? FakeOuterNumberSerialize (decimal? body = null) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FakeOuterNumberSerialize + +> decimal FakeOuterNumberSerialize (decimal body = null) Test serialization of outer number types ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -156,19 +263,22 @@ namespace Example { public class FakeOuterNumberSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var body = 1.2; // decimal? | Input number as post body (optional) + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var body = 8.14; // decimal | Input number as post body (optional) try { - decimal? result = apiInstance.FakeOuterNumberSerialize(body); + decimal result = apiInstance.FakeOuterNumberSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -177,13 +287,14 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **decimal?**| Input number as post body | [optional] + **body** | **decimal**| Input number as post body | [optional] ### Return type -**decimal?** +**decimal** ### Authorization @@ -191,13 +302,22 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: */* +- **Content-Type**: Not defined +- **Accept**: */* -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FakeOuterStringSerialize - -# **FakeOuterStringSerialize** > string FakeOuterStringSerialize (string body = null) @@ -205,8 +325,9 @@ No authorization required Test serialization of outer string types ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -216,9 +337,10 @@ namespace Example { public class FakeOuterStringSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = body_example; // string | Input string as post body (optional) try @@ -226,9 +348,11 @@ namespace Example string result = apiInstance.FakeOuterStringSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -237,6 +361,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | **string**| Input string as post body | [optional] @@ -251,20 +376,32 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: */* +- **Content-Type**: Not defined +- **Accept**: */* -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | - -# **TestBodyWithQueryParams** -> void TestBodyWithQueryParams (string query, User user) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) +## TestBodyWithFileSchema + +> void TestBodyWithFileSchema (FileSchemaTestClass body) + + + +For this test, the body for this request much reference a schema named `File`. ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -272,21 +409,23 @@ using Org.OpenAPITools.Model; namespace Example { - public class TestBodyWithQueryParamsExample + public class TestBodyWithFileSchemaExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var query = query_example; // string | - var user = new User(); // User | + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var body = new FileSchemaTestClass(); // FileSchemaTestClass | try { - apiInstance.TestBodyWithQueryParams(query, user); + apiInstance.TestBodyWithFileSchema(body); } - catch (Exception e) + catch (ApiException e) { - Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message ); + Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchema: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -295,10 +434,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **query** | **string**| | - **user** | [**User**](User.md)| | + **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | ### Return type @@ -310,22 +449,105 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | - -# **TestClientModel** -> ModelClient TestClientModel (ModelClient modelClient) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestBodyWithQueryParams + +> void TestBodyWithQueryParams (string query, User body) + + + +### Example + +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestBodyWithQueryParamsExample + { + public static void Main() + { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var query = query_example; // string | + var body = new User(); // User | + + try + { + apiInstance.TestBodyWithQueryParams(query, body); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **string**| | + **body** | [**User**](User.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestClientModel + +> ModelClient TestClientModel (ModelClient body) To test \"client\" model To test \"client\" model ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -335,20 +557,23 @@ namespace Example { public class TestClientModelExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var modelClient = new ModelClient(); // ModelClient | client model + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var body = new ModelClient(); // ModelClient | client model try { // To test \"client\" model - ModelClient result = apiInstance.TestClientModel(modelClient); + ModelClient result = apiInstance.TestClientModel(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -357,9 +582,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **modelClient** | [**ModelClient**](ModelClient.md)| client model | + **body** | [**ModelClient**](ModelClient.md)| client model | ### Return type @@ -371,22 +597,32 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | - -# **TestEndpointParameters** -> void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestEndpointParameters + +> void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = null, int int32 = null, long int64 = null, float _float = null, string _string = null, System.IO.Stream binary = null, DateTime date = null, DateTime dateTime = null, string password = null, string callback = null) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -396,25 +632,26 @@ namespace Example { public class TestEndpointParametersExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure HTTP basic authorization: http_basic_test Configuration.Default.Username = "YOUR_USERNAME"; Configuration.Default.Password = "YOUR_PASSWORD"; - var apiInstance = new FakeApi(); - var number = 8.14; // decimal? | None - var _double = 1.2; // double? | None + var apiInstance = new FakeApi(Configuration.Default); + var number = 8.14; // decimal | None + var _double = 1.2D; // double | None var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None var _byte = BYTE_ARRAY_DATA_HERE; // byte[] | None - var integer = 56; // int? | None (optional) - var int32 = 56; // int? | None (optional) - var int64 = 789; // long? | None (optional) - var _float = 3.4; // float? | None (optional) + var integer = 56; // int | None (optional) + var int32 = 56; // int | None (optional) + var int64 = 789; // long | None (optional) + var _float = 3.4F; // float | None (optional) var _string = _string_example; // string | None (optional) var binary = BINARY_DATA_HERE; // System.IO.Stream | None (optional) - var date = 2013-10-20; // DateTime? | None (optional) - var dateTime = 2013-10-20T19:20:30+01:00; // DateTime? | None (optional) + var date = 2013-10-20; // DateTime | None (optional) + var dateTime = 2013-10-20T19:20:30+01:00; // DateTime | None (optional) var password = password_example; // string | None (optional) var callback = callback_example; // string | None (optional) @@ -423,9 +660,11 @@ namespace Example // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 apiInstance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -434,20 +673,21 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **number** | **decimal?**| None | - **_double** | **double?**| None | + **number** | **decimal**| None | + **_double** | **double**| None | **patternWithoutDelimiter** | **string**| None | **_byte** | **byte[]**| None | - **integer** | **int?**| None | [optional] - **int32** | **int?**| None | [optional] - **int64** | **long?**| None | [optional] - **_float** | **float?**| None | [optional] + **integer** | **int**| None | [optional] + **int32** | **int**| None | [optional] + **int64** | **long**| None | [optional] + **_float** | **float**| None | [optional] **_string** | **string**| None | [optional] **binary** | **System.IO.Stream**| None | [optional] - **date** | **DateTime?**| None | [optional] - **dateTime** | **DateTime?**| None | [optional] + **date** | **DateTime**| None | [optional] + **dateTime** | **DateTime**| None | [optional] **password** | **string**| None | [optional] **callback** | **string**| None | [optional] @@ -461,22 +701,33 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | - -# **TestEnumParameters** -> void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestEnumParameters + +> void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int enumQueryInteger = null, double enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) To test enum parameters To test enum parameters ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -486,16 +737,17 @@ namespace Example { public class TestEnumParametersExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var enumHeaderStringArray = enumHeaderStringArray_example; // List | Header parameter enum test (string array) (optional) var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg) var enumQueryStringArray = enumQueryStringArray_example; // List | Query parameter enum test (string array) (optional) var enumQueryString = enumQueryString_example; // string | Query parameter enum test (string) (optional) (default to -efg) - var enumQueryInteger = 56; // int? | Query parameter enum test (double) (optional) - var enumQueryDouble = 1.2; // double? | Query parameter enum test (double) (optional) - var enumFormStringArray = enumFormStringArray_example; // List | Form parameter enum test (string array) (optional) (default to $) + var enumQueryInteger = 56; // int | Query parameter enum test (double) (optional) + var enumQueryDouble = 1.2D; // double | Query parameter enum test (double) (optional) + var enumFormStringArray = new List(); // List | Form parameter enum test (string array) (optional) (default to $) var enumFormString = enumFormString_example; // string | Form parameter enum test (string) (optional) (default to -efg) try @@ -503,9 +755,11 @@ namespace Example // To test enum parameters apiInstance.TestEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -514,15 +768,16 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **enumHeaderStringArray** | **List<string>**| Header parameter enum test (string array) | [optional] **enumHeaderString** | **string**| Header parameter enum test (string) | [optional] [default to -efg] **enumQueryStringArray** | **List<string>**| Query parameter enum test (string array) | [optional] **enumQueryString** | **string**| Query parameter enum test (string) | [optional] [default to -efg] - **enumQueryInteger** | **int?**| Query parameter enum test (double) | [optional] - **enumQueryDouble** | **double?**| Query parameter enum test (double) | [optional] - **enumFormStringArray** | **List<string>**| Form parameter enum test (string array) | [optional] [default to $] + **enumQueryInteger** | **int**| Query parameter enum test (double) | [optional] + **enumQueryDouble** | **double**| Query parameter enum test (double) | [optional] + **enumFormStringArray** | [**List<string>**](string.md)| Form parameter enum test (string array) | [optional] [default to $] **enumFormString** | **string**| Form parameter enum test (string) | [optional] [default to -efg] ### Return type @@ -535,20 +790,33 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | - -# **TestInlineAdditionalProperties** -> void TestInlineAdditionalProperties (Dictionary requestBody) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) -test inline additionalProperties + +## TestGroupParameters + +> void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = null, bool booleanGroup = null, long int64Group = null) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -556,21 +824,29 @@ using Org.OpenAPITools.Model; namespace Example { - public class TestInlineAdditionalPropertiesExample + public class TestGroupParametersExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var requestBody = new Dictionary(); // Dictionary | request body + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var requiredStringGroup = 56; // int | Required String in group parameters + var requiredBooleanGroup = true; // bool | Required Boolean in group parameters + var requiredInt64Group = 789; // long | Required Integer in group parameters + var stringGroup = 56; // int | String in group parameters (optional) + var booleanGroup = true; // bool | Boolean in group parameters (optional) + var int64Group = 789; // long | Integer in group parameters (optional) try { - // test inline additionalProperties - apiInstance.TestInlineAdditionalProperties(requestBody); + // Fake endpoint to test group parameters (optional) + apiInstance.TestGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } - catch (Exception e) + catch (ApiException e) { - Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message ); + Debug.Print("Exception when calling FakeApi.TestGroupParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -579,9 +855,15 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **requestBody** | [**Dictionary<string, string>**](string.md)| request body | + **requiredStringGroup** | **int**| Required String in group parameters | + **requiredBooleanGroup** | **bool**| Required Boolean in group parameters | + **requiredInt64Group** | **long**| Required Integer in group parameters | + **stringGroup** | **int**| String in group parameters | [optional] + **booleanGroup** | **bool**| Boolean in group parameters | [optional] + **int64Group** | **long**| Integer in group parameters | [optional] ### Return type @@ -593,20 +875,102 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Someting wrong | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestInlineAdditionalProperties + +> void TestInlineAdditionalProperties (Dictionary param) + +test inline additionalProperties + +### Example + +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class TestInlineAdditionalPropertiesExample + { + public static void Main() + { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var param = new Dictionary(); // Dictionary | request body + + try + { + // test inline additionalProperties + apiInstance.TestInlineAdditionalProperties(param); + } + catch (ApiException e) + { + Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | [**Dictionary<string, string>**](string.md)| request body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestJsonFormData - -# **TestJsonFormData** > void TestJsonFormData (string param, string param2) test json serialization of form data ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -616,9 +980,10 @@ namespace Example { public class TestJsonFormDataExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var param = param_example; // string | field1 var param2 = param2_example; // string | field2 @@ -627,9 +992,11 @@ namespace Example // test json serialization of form data apiInstance.TestJsonFormData(param, param2); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -638,6 +1005,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **param** | **string**| field1 | @@ -653,8 +1021,16 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FakeClassnameTags123Api.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FakeClassnameTags123Api.md index f069b098399..deb97a27697 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FakeClassnameTags123Api.md @@ -7,17 +7,19 @@ Method | HTTP request | Description [**TestClassname**](FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case - -# **TestClassname** -> ModelClient TestClassname (ModelClient modelClient) + +## TestClassname + +> ModelClient TestClassname (ModelClient body) To test class name in snake case To test class name in snake case ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -27,25 +29,28 @@ namespace Example { public class TestClassnameExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key_query Configuration.Default.AddApiKey("api_key_query", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key_query", "Bearer"); - var apiInstance = new FakeClassnameTags123Api(); - var modelClient = new ModelClient(); // ModelClient | client model + var apiInstance = new FakeClassnameTags123Api(Configuration.Default); + var body = new ModelClient(); // ModelClient | client model try { // To test class name in snake case - ModelClient result = apiInstance.TestClassname(modelClient); + ModelClient result = apiInstance.TestClassname(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -54,9 +59,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **modelClient** | [**ModelClient**](ModelClient.md)| client model | + **body** | [**ModelClient**](ModelClient.md)| client model | ### Return type @@ -68,8 +74,16 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/File.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/File.md new file mode 100644 index 00000000000..b7105102579 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/File.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.File + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SourceURI** | **string** | Test capitalization | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FileSchemaTestClass.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FileSchemaTestClass.md new file mode 100644 index 00000000000..df1453f686b --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FileSchemaTestClass.md @@ -0,0 +1,14 @@ + +# Org.OpenAPITools.Model.FileSchemaTestClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**File** | [**File**](File.md) | | [optional] +**Files** | [**List<File>**](File.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FormatTest.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FormatTest.md index f82c08bd75b..0d921285ba1 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FormatTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/FormatTest.md @@ -1,21 +1,25 @@ + # Org.OpenAPITools.Model.FormatTest + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Integer** | **int?** | | [optional] -**Int32** | **int?** | | [optional] -**Int64** | **long?** | | [optional] -**Number** | **decimal?** | | -**Float** | **float?** | | [optional] -**Double** | **double?** | | [optional] +**Integer** | **int** | | [optional] +**Int32** | **int** | | [optional] +**Int64** | **long** | | [optional] +**Number** | **decimal** | | +**Float** | **float** | | [optional] +**Double** | **double** | | [optional] **String** | **string** | | [optional] **Byte** | **byte[]** | | **Binary** | **System.IO.Stream** | | [optional] -**Date** | **DateTime?** | | -**DateTime** | **DateTime?** | | [optional] -**Uuid** | **Guid?** | | [optional] +**Date** | **DateTime** | | +**DateTime** | **DateTime** | | [optional] +**Uuid** | **Guid** | | [optional] **Password** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/HasOnlyReadOnly.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/HasOnlyReadOnly.md index 95f49de194c..4a2624f1118 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/HasOnlyReadOnly.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/HasOnlyReadOnly.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.HasOnlyReadOnly + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **Bar** | **string** | | [optional] **Foo** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/List.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/List.md index 484c2a0992c..cb41193b43e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/List.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/List.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.List + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **_123List** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/MapTest.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/MapTest.md index 2baba08d855..79d499e2cf9 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/MapTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/MapTest.md @@ -1,10 +1,16 @@ + # Org.OpenAPITools.Model.MapTest + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **MapMapOfString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] **MapOfEnumString** | **Dictionary<string, string>** | | [optional] +**DirectMap** | **Dictionary<string, bool>** | | [optional] +**IndirectMap** | **Dictionary<string, bool>** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 9b8e2e3434c..dd7b01e49fe 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -1,11 +1,15 @@ + # Org.OpenAPITools.Model.MixedPropertiesAndAdditionalPropertiesClass + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Uuid** | **Guid?** | | [optional] -**DateTime** | **DateTime?** | | [optional] +**Uuid** | **Guid** | | [optional] +**DateTime** | **DateTime** | | [optional] **Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Model200Response.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Model200Response.md index 16337f9b6b2..7d826bca1ec 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Model200Response.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Model200Response.md @@ -1,10 +1,14 @@ + # Org.OpenAPITools.Model.Model200Response + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **int?** | | [optional] +**Name** | **int** | | [optional] **Class** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ModelClient.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ModelClient.md index ecc7b60ce55..e36e1fad802 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ModelClient.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ModelClient.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.ModelClient + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **__Client** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Name.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Name.md index e22fef95673..77b9b2e7501 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Name.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Name.md @@ -1,12 +1,16 @@ + # Org.OpenAPITools.Model.Name + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Name** | **int?** | | -**SnakeCase** | **int?** | | [optional] +**_Name** | **int** | | +**SnakeCase** | **int** | | [optional] **Property** | **string** | | [optional] -**_123Number** | **int?** | | [optional] +**_123Number** | **int** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/NumberOnly.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/NumberOnly.md index 5f00dedf1c3..e4b08467e08 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/NumberOnly.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/NumberOnly.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.NumberOnly + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**JustNumber** | **decimal?** | | [optional] +**JustNumber** | **decimal** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Order.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Order.md index 984bd5ca063..875f43a30e5 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Order.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Order.md @@ -1,14 +1,18 @@ + # Org.OpenAPITools.Model.Order + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] -**PetId** | **long?** | | [optional] -**Quantity** | **int?** | | [optional] -**ShipDate** | **DateTime?** | | [optional] +**Id** | **long** | | [optional] +**PetId** | **long** | | [optional] +**Quantity** | **int** | | [optional] +**ShipDate** | **DateTime** | | [optional] **Status** | **string** | Order Status | [optional] -**Complete** | **bool?** | | [optional] [default to false] +**Complete** | **bool** | | [optional] [default to false] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/OuterComposite.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/OuterComposite.md index 4091cd23f2e..f381fb7fd28 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/OuterComposite.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/OuterComposite.md @@ -1,11 +1,15 @@ + # Org.OpenAPITools.Model.OuterComposite + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MyNumber** | **decimal?** | | [optional] +**MyNumber** | **decimal** | | [optional] **MyString** | **string** | | [optional] -**MyBoolean** | **bool?** | | [optional] +**MyBoolean** | **bool** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/OuterEnum.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/OuterEnum.md index 22713352ca0..edc2300684d 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/OuterEnum.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/OuterEnum.md @@ -1,8 +1,12 @@ + # Org.OpenAPITools.Model.OuterEnum + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Pet.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Pet.md index 0ac711337aa..0bd5c40fc99 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Pet.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Pet.md @@ -1,14 +1,18 @@ + # Org.OpenAPITools.Model.Pet + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Category** | [**Category**](Category.md) | | [optional] **Name** | **string** | | **PhotoUrls** | **List<string>** | | **Tags** | [**List<Tag>**](Tag.md) | | [optional] **Status** | **string** | pet status in the store | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/PetApi.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/PetApi.md index 244ece53a31..1a9eba14868 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/PetApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/PetApi.md @@ -12,17 +12,20 @@ Method | HTTP request | Description [**UpdatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet [**UpdatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data [**UploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +[**UploadFileWithRequiredFile**](PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) - -# **AddPet** -> void AddPet (Pet pet) + +## AddPet + +> void AddPet (Pet body) Add a new pet to the store ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -32,22 +35,25 @@ namespace Example { public class AddPetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var pet = new Pet(); // Pet | Pet object that needs to be added to the store + var apiInstance = new PetApi(Configuration.Default); + var body = new Pet(); // Pet | Pet object that needs to be added to the store try { // Add a new pet to the store - apiInstance.AddPet(pet); + apiInstance.AddPet(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -56,9 +62,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -70,20 +77,31 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **405** | Invalid input | - | - -# **DeletePet** -> void DeletePet (long? petId, string apiKey = null) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeletePet + +> void DeletePet (long petId, string apiKey = null) Deletes a pet ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -93,13 +111,14 @@ namespace Example { public class DeletePetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var petId = 789; // long? | Pet id to delete + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | Pet id to delete var apiKey = apiKey_example; // string | (optional) try @@ -107,9 +126,11 @@ namespace Example // Deletes a pet apiInstance.DeletePet(petId, apiKey); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -118,9 +139,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| Pet id to delete | + **petId** | **long**| Pet id to delete | **apiKey** | **string**| | [optional] ### Return type @@ -133,22 +155,33 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid pet value | - | - -# **FindPetsByStatus** -> List FindPetsByStatus (List status) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindPetsByStatus + +> List<Pet> FindPetsByStatus (List status) Finds Pets by status Multiple status values can be provided with comma separated strings ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -158,23 +191,26 @@ namespace Example { public class FindPetsByStatusExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var status = status_example; // List | Status values that need to be considered for filter try { // Finds Pets by status - List<Pet> result = apiInstance.FindPetsByStatus(status); + List result = apiInstance.FindPetsByStatus(status); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -183,13 +219,14 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **status** | **List<string>**| Status values that need to be considered for filter | ### Return type -[**List**](Pet.md) +[**List<Pet>**](Pet.md) ### Authorization @@ -197,22 +234,33 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | - -# **FindPetsByTags** -> List FindPetsByTags (List tags) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindPetsByTags + +> List<Pet> FindPetsByTags (List tags) Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -222,23 +270,26 @@ namespace Example { public class FindPetsByTagsExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var tags = new List(); // List | Tags to filter by try { // Finds Pets by tags - List<Pet> result = apiInstance.FindPetsByTags(tags); + List result = apiInstance.FindPetsByTags(tags); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -247,13 +298,14 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<string>**](string.md)| Tags to filter by | ### Return type -[**List**](Pet.md) +[**List<Pet>**](Pet.md) ### Authorization @@ -261,22 +313,33 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | - -# **GetPetById** -> Pet GetPetById (long? petId) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetPetById + +> Pet GetPetById (long petId) Find pet by ID Returns a single pet ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -286,15 +349,16 @@ namespace Example { public class GetPetByIdExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet to return + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | ID of pet to return try { @@ -302,9 +366,11 @@ namespace Example Pet result = apiInstance.GetPetById(petId); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -313,9 +379,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to return | + **petId** | **long**| ID of pet to return | ### Return type @@ -327,20 +394,32 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | - -# **UpdatePet** -> void UpdatePet (Pet pet) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdatePet + +> void UpdatePet (Pet body) Update an existing pet ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -350,22 +429,25 @@ namespace Example { public class UpdatePetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var pet = new Pet(); // Pet | Pet object that needs to be added to the store + var apiInstance = new PetApi(Configuration.Default); + var body = new Pet(); // Pet | Pet object that needs to be added to the store try { // Update an existing pet - apiInstance.UpdatePet(pet); + apiInstance.UpdatePet(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -374,9 +456,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -388,20 +471,33 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | - -# **UpdatePetWithForm** -> void UpdatePetWithForm (long? petId, string name = null, string status = null) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdatePetWithForm + +> void UpdatePetWithForm (long petId, string name = null, string status = null) Updates a pet in the store with form data ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -411,13 +507,14 @@ namespace Example { public class UpdatePetWithFormExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet that needs to be updated + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | ID of pet that needs to be updated var name = name_example; // string | Updated name of the pet (optional) var status = status_example; // string | Updated status of the pet (optional) @@ -426,9 +523,11 @@ namespace Example // Updates a pet in the store with form data apiInstance.UpdatePetWithForm(petId, name, status); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -437,9 +536,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet that needs to be updated | + **petId** | **long**| ID of pet that needs to be updated | **name** | **string**| Updated name of the pet | [optional] **status** | **string**| Updated status of the pet | [optional] @@ -453,20 +553,30 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | - -# **UploadFile** -> ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UploadFile + +> ApiResponse UploadFile (long petId, string additionalMetadata = null, System.IO.Stream file = null) uploads an image ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -476,13 +586,14 @@ namespace Example { public class UploadFileExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet to update + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | ID of pet to update var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) var file = BINARY_DATA_HERE; // System.IO.Stream | file to upload (optional) @@ -492,9 +603,11 @@ namespace Example ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -503,9 +616,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to update | + **petId** | **long**| ID of pet to update | **additionalMetadata** | **string**| Additional data to pass to server | [optional] **file** | **System.IO.Stream**| file to upload | [optional] @@ -519,8 +633,96 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: multipart/form-data - - **Accept**: application/json +- **Content-Type**: multipart/form-data +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UploadFileWithRequiredFile + +> ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string additionalMetadata = null) + +uploads an image (required) + +### Example + +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Model; + +namespace Example +{ + public class UploadFileWithRequiredFileExample + { + public static void Main() + { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + // Configure OAuth2 access token for authorization: petstore_auth + Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; + + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | ID of pet to update + var requiredFile = BINARY_DATA_HERE; // System.IO.Stream | file to upload + var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) + + try + { + // uploads an image (required) + ApiResponse result = apiInstance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **long**| ID of pet to update | + **requiredFile** | **System.IO.Stream**| file to upload | + **additionalMetadata** | **string**| Additional data to pass to server | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ReadOnlyFirst.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ReadOnlyFirst.md index 6c2571cb48f..f4581ec1051 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ReadOnlyFirst.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/ReadOnlyFirst.md @@ -1,4 +1,6 @@ + # Org.OpenAPITools.Model.ReadOnlyFirst + ## Properties Name | Type | Description | Notes @@ -6,5 +8,7 @@ Name | Type | Description | Notes **Bar** | **string** | | [optional] **Baz** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Return.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Return.md index 21a269c63f4..4761c70748e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Return.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Return.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.Return + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Return** | **int?** | | [optional] +**_Return** | **int** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/SpecialModelName.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/SpecialModelName.md index 306e65392a2..ee6489524d0 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/SpecialModelName.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/SpecialModelName.md @@ -1,9 +1,13 @@ + # Org.OpenAPITools.Model.SpecialModelName + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SpecialPropertyName** | **long?** | | [optional] +**SpecialPropertyName** | **long** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/StoreApi.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/StoreApi.md index ff7608854f8..57247772d4f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/StoreApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/StoreApi.md @@ -10,8 +10,9 @@ Method | HTTP request | Description [**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet - -# **DeleteOrder** + +## DeleteOrder + > void DeleteOrder (string orderId) Delete purchase order by ID @@ -19,8 +20,9 @@ Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -30,9 +32,10 @@ namespace Example { public class DeleteOrderExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); var orderId = orderId_example; // string | ID of the order that needs to be deleted try @@ -40,9 +43,11 @@ namespace Example // Delete purchase order by ID apiInstance.DeleteOrder(orderId); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -51,6 +56,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **string**| ID of the order that needs to be deleted | @@ -65,22 +71,33 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | - -# **GetInventory** -> Dictionary GetInventory () +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetInventory + +> Dictionary<string, int> GetInventory () Returns pet inventories by status Returns a map of status codes to quantities ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -90,24 +107,27 @@ namespace Example { public class GetInventoryExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); - var apiInstance = new StoreApi(); + var apiInstance = new StoreApi(Configuration.Default); try { // Returns pet inventories by status - Dictionary<string, int?> result = apiInstance.GetInventory(); + Dictionary result = apiInstance.GetInventory(); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -115,11 +135,12 @@ namespace Example ``` ### Parameters + This endpoint does not need any parameter. ### Return type -**Dictionary** +**Dictionary** ### Authorization @@ -127,22 +148,32 @@ This endpoint does not need any parameter. ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | - -# **GetOrderById** -> Order GetOrderById (long? orderId) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetOrderById + +> Order GetOrderById (long orderId) Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -152,10 +183,11 @@ namespace Example { public class GetOrderByIdExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); - var orderId = 789; // long? | ID of pet that needs to be fetched + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); + var orderId = 789; // long | ID of pet that needs to be fetched try { @@ -163,9 +195,11 @@ namespace Example Order result = apiInstance.GetOrderById(orderId); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -174,9 +208,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **long?**| ID of pet that needs to be fetched | + **orderId** | **long**| ID of pet that needs to be fetched | ### Return type @@ -188,20 +223,32 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | - -# **PlaceOrder** -> Order PlaceOrder (Order order) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## PlaceOrder + +> Order PlaceOrder (Order body) Place an order for a pet ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -211,20 +258,23 @@ namespace Example { public class PlaceOrderExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); - var order = new Order(); // Order | order placed for purchasing the pet + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); + var body = new Order(); // Order | order placed for purchasing the pet try { // Place an order for a pet - Order result = apiInstance.PlaceOrder(order); + Order result = apiInstance.PlaceOrder(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -233,9 +283,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | + **body** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -247,8 +298,17 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Tag.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Tag.md index 6a76c28595f..f781c26f017 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Tag.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/Tag.md @@ -1,10 +1,14 @@ + # Org.OpenAPITools.Model.Tag + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Name** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/TypeHolderDefault.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/TypeHolderDefault.md new file mode 100644 index 00000000000..0945245b213 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/TypeHolderDefault.md @@ -0,0 +1,17 @@ + +# Org.OpenAPITools.Model.TypeHolderDefault + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**StringItem** | **string** | | [default to "what"] +**NumberItem** | **decimal** | | +**IntegerItem** | **int** | | +**BoolItem** | **bool** | | [default to true] +**ArrayItem** | **List<int>** | | + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/TypeHolderExample.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/TypeHolderExample.md new file mode 100644 index 00000000000..e92681b8cba --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/TypeHolderExample.md @@ -0,0 +1,17 @@ + +# Org.OpenAPITools.Model.TypeHolderExample + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**StringItem** | **string** | | +**NumberItem** | **decimal** | | +**IntegerItem** | **int** | | +**BoolItem** | **bool** | | +**ArrayItem** | **List<int>** | | + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/User.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/User.md index 04dd24a3423..a25c25d1aa0 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/User.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/User.md @@ -1,16 +1,20 @@ + # Org.OpenAPITools.Model.User + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Username** | **string** | | [optional] **FirstName** | **string** | | [optional] **LastName** | **string** | | [optional] **Email** | **string** | | [optional] **Password** | **string** | | [optional] **Phone** | **string** | | [optional] -**UserStatus** | **int?** | User Status | [optional] +**UserStatus** | **int** | User Status | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/UserApi.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/UserApi.md index 857ab27084c..1385d840413 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/UserApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/UserApi.md @@ -14,17 +14,19 @@ Method | HTTP request | Description [**UpdateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user - -# **CreateUser** -> void CreateUser (User user) + +## CreateUser + +> void CreateUser (User body) Create user This can only be done by the logged in user. ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -34,19 +36,22 @@ namespace Example { public class CreateUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); - var user = new User(); // User | Created user object + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); + var body = new User(); // User | Created user object try { // Create user - apiInstance.CreateUser(user); + apiInstance.CreateUser(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -55,9 +60,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | + **body** | [**User**](User.md)| Created user object | ### Return type @@ -69,20 +75,30 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | - -# **CreateUsersWithArrayInput** -> void CreateUsersWithArrayInput (List user) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateUsersWithArrayInput + +> void CreateUsersWithArrayInput (List body) Creates list of users with given input array ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -92,19 +108,22 @@ namespace Example { public class CreateUsersWithArrayInputExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); - var user = new List(); // List | List of user object + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); + var body = new List(); // List | List of user object try { // Creates list of users with given input array - apiInstance.CreateUsersWithArrayInput(user); + apiInstance.CreateUsersWithArrayInput(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -113,9 +132,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -127,20 +147,30 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | - -# **CreateUsersWithListInput** -> void CreateUsersWithListInput (List user) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateUsersWithListInput + +> void CreateUsersWithListInput (List body) Creates list of users with given input array ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -150,19 +180,22 @@ namespace Example { public class CreateUsersWithListInputExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); - var user = new List(); // List | List of user object + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); + var body = new List(); // List | List of user object try { // Creates list of users with given input array - apiInstance.CreateUsersWithListInput(user); + apiInstance.CreateUsersWithListInput(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -171,9 +204,10 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -185,13 +219,22 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteUser - -# **DeleteUser** > void DeleteUser (string username) Delete user @@ -199,8 +242,9 @@ Delete user This can only be done by the logged in user. ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -210,9 +254,10 @@ namespace Example { public class DeleteUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The name that needs to be deleted try @@ -220,9 +265,11 @@ namespace Example // Delete user apiInstance.DeleteUser(username); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -231,6 +278,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string**| The name that needs to be deleted | @@ -245,20 +293,31 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetUserByName - -# **GetUserByName** > User GetUserByName (string username) Get user by user name ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -268,9 +327,10 @@ namespace Example { public class GetUserByNameExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. try @@ -279,9 +339,11 @@ namespace Example User result = apiInstance.GetUserByName(username); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -290,6 +352,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string**| The name that needs to be fetched. Use user1 for testing. | @@ -304,20 +367,32 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## LoginUser - -# **LoginUser** > string LoginUser (string username, string password) Logs user into the system ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -327,9 +402,10 @@ namespace Example { public class LoginUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The user name for login var password = password_example; // string | The password for login in clear text @@ -339,9 +415,11 @@ namespace Example string result = apiInstance.LoginUser(username, password); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -350,6 +428,7 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string**| The user name for login | @@ -365,20 +444,31 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## LogoutUser - -# **LogoutUser** > void LogoutUser () Logs out current logged in user session ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -388,18 +478,21 @@ namespace Example { public class LogoutUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); try { // Logs out current logged in user session apiInstance.LogoutUser(); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -407,6 +500,7 @@ namespace Example ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -419,22 +513,32 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | - -# **UpdateUser** -> void UpdateUser (string username, User user) +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateUser + +> void UpdateUser (string username, User body) Updated user This can only be done by the logged in user. ### Example + ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -444,20 +548,23 @@ namespace Example { public class UpdateUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | name that need to be deleted - var user = new User(); // User | Updated user object + var body = new User(); // User | Updated user object try { // Updated user - apiInstance.UpdateUser(username, user); + apiInstance.UpdateUser(username, body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -466,10 +573,11 @@ namespace Example ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string**| name that need to be deleted | - **user** | [**User**](User.md)| Updated user object | + **body** | [**User**](User.md)| Updated user object | ### Return type @@ -481,8 +589,17 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/XmlItem.md b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/XmlItem.md new file mode 100644 index 00000000000..0dca90c706f --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/docs/XmlItem.md @@ -0,0 +1,41 @@ + +# Org.OpenAPITools.Model.XmlItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AttributeString** | **string** | | [optional] +**AttributeNumber** | **decimal** | | [optional] +**AttributeInteger** | **int** | | [optional] +**AttributeBoolean** | **bool** | | [optional] +**WrappedArray** | **List<int>** | | [optional] +**NameString** | **string** | | [optional] +**NameNumber** | **decimal** | | [optional] +**NameInteger** | **int** | | [optional] +**NameBoolean** | **bool** | | [optional] +**NameArray** | **List<int>** | | [optional] +**NameWrappedArray** | **List<int>** | | [optional] +**PrefixString** | **string** | | [optional] +**PrefixNumber** | **decimal** | | [optional] +**PrefixInteger** | **int** | | [optional] +**PrefixBoolean** | **bool** | | [optional] +**PrefixArray** | **List<int>** | | [optional] +**PrefixWrappedArray** | **List<int>** | | [optional] +**NamespaceString** | **string** | | [optional] +**NamespaceNumber** | **decimal** | | [optional] +**NamespaceInteger** | **int** | | [optional] +**NamespaceBoolean** | **bool** | | [optional] +**NamespaceArray** | **List<int>** | | [optional] +**NamespaceWrappedArray** | **List<int>** | | [optional] +**PrefixNsString** | **string** | | [optional] +**PrefixNsNumber** | **decimal** | | [optional] +**PrefixNsInteger** | **int** | | [optional] +**PrefixNsBoolean** | **bool** | | [optional] +**PrefixNsArray** | **List<int>** | | [optional] +**PrefixNsWrappedArray** | **List<int>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 586ead5d200..76d5194e5a1 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -28,46 +28,46 @@ namespace Org.OpenAPITools.Api /// To test special tags ///
/// - /// To test special tags + /// To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - ModelClient TestSpecialTags (ModelClient modelClient); + ModelClient Call123TestSpecialTags (ModelClient body); /// /// To test special tags /// /// - /// To test special tags + /// To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - ApiResponse TestSpecialTagsWithHttpInfo (ModelClient modelClient); + ApiResponse Call123TestSpecialTagsWithHttpInfo (ModelClient body); #endregion Synchronous Operations #region Asynchronous Operations /// /// To test special tags /// /// - /// To test special tags + /// To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - System.Threading.Tasks.Task TestSpecialTagsAsync (ModelClient modelClient); + System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient body); /// /// To test special tags /// /// - /// To test special tags + /// To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - System.Threading.Tasks.Task> TestSpecialTagsAsyncWithHttpInfo (ModelClient modelClient); + System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body); #endregion Asynchronous Operations } @@ -89,6 +89,17 @@ namespace Org.OpenAPITools.Api ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; } + /// + /// Initializes a new instance of the class + /// + /// + public AnotherFakeApi() + { + this.Configuration = Org.OpenAPITools.Client.Configuration.Default; + + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + /// /// Initializes a new instance of the class /// using Configuration object @@ -169,28 +180,28 @@ namespace Org.OpenAPITools.Api } /// - /// To test special tags To test special tags + /// To test special tags To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - public ModelClient TestSpecialTags (ModelClient modelClient) + public ModelClient Call123TestSpecialTags (ModelClient body) { - ApiResponse localVarResponse = TestSpecialTagsWithHttpInfo(modelClient); + ApiResponse localVarResponse = Call123TestSpecialTagsWithHttpInfo(body); return localVarResponse.Data; } /// - /// To test special tags To test special tags + /// To test special tags To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > TestSpecialTagsWithHttpInfo (ModelClient modelClient) + public ApiResponse< ModelClient > Call123TestSpecialTagsWithHttpInfo (ModelClient body) { - // verify the required parameter 'modelClient' is set - if (modelClient == null) - throw new ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->TestSpecialTags"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling AnotherFakeApi->Call123TestSpecialTags"); var localVarPath = "./another-fake/dummy"; var localVarPathParams = new Dictionary(); @@ -214,13 +225,13 @@ namespace Org.OpenAPITools.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (modelClient != null && modelClient.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = modelClient; // byte array + localVarPostBody = body; // byte array } @@ -233,39 +244,39 @@ namespace Org.OpenAPITools.Api if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("TestSpecialTags", localVarResponse); + Exception exception = ExceptionFactory("Call123TestSpecialTags", localVarResponse); if (exception != null) throw exception; } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (ModelClient) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); } /// - /// To test special tags To test special tags + /// To test special tags To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - public async System.Threading.Tasks.Task TestSpecialTagsAsync (ModelClient modelClient) + public async System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient body) { - ApiResponse localVarResponse = await TestSpecialTagsAsyncWithHttpInfo(modelClient); + ApiResponse localVarResponse = await Call123TestSpecialTagsAsyncWithHttpInfo(body); return localVarResponse.Data; } /// - /// To test special tags To test special tags + /// To test special tags To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - public async System.Threading.Tasks.Task> TestSpecialTagsAsyncWithHttpInfo (ModelClient modelClient) + public async System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body) { - // verify the required parameter 'modelClient' is set - if (modelClient == null) - throw new ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->TestSpecialTags"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling AnotherFakeApi->Call123TestSpecialTags"); var localVarPath = "./another-fake/dummy"; var localVarPathParams = new Dictionary(); @@ -289,13 +300,13 @@ namespace Org.OpenAPITools.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (modelClient != null && modelClient.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = modelClient; // byte array + localVarPostBody = body; // byte array } @@ -308,12 +319,12 @@ namespace Org.OpenAPITools.Api if (ExceptionFactory != null) { - Exception exception = ExceptionFactory("TestSpecialTags", localVarResponse); + Exception exception = ExceptionFactory("Call123TestSpecialTags", localVarResponse); if (exception != null) throw exception; } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (ModelClient) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeApi.cs index 234c794dd41..28964720a9a 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeApi.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -25,6 +25,27 @@ namespace Org.OpenAPITools.Api { #region Synchronous Operations /// + /// creates an XmlItem + /// + /// + /// this route creates an XmlItem + /// + /// Thrown when fails to make API call + /// XmlItem Body + /// + void CreateXmlItem (XmlItem xmlItem); + + /// + /// creates an XmlItem + /// + /// + /// this route creates an XmlItem + /// + /// Thrown when fails to make API call + /// XmlItem Body + /// ApiResponse of Object(void) + ApiResponse CreateXmlItemWithHttpInfo (XmlItem xmlItem); + /// /// /// /// @@ -32,8 +53,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// bool? - bool? FakeOuterBooleanSerialize (bool? body = null); + /// bool + bool FakeOuterBooleanSerialize (bool body = null); /// /// @@ -43,8 +64,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// ApiResponse of bool? - ApiResponse FakeOuterBooleanSerializeWithHttpInfo (bool? body = null); + /// ApiResponse of bool + ApiResponse FakeOuterBooleanSerializeWithHttpInfo (bool body = null); /// /// /// @@ -52,9 +73,9 @@ namespace Org.OpenAPITools.Api /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// OuterComposite - OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null); + OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null); /// /// @@ -63,9 +84,9 @@ namespace Org.OpenAPITools.Api /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// ApiResponse of OuterComposite - ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite outerComposite = null); + ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null); /// /// /// @@ -74,8 +95,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// decimal? - decimal? FakeOuterNumberSerialize (decimal? body = null); + /// decimal + decimal FakeOuterNumberSerialize (decimal body = null); /// /// @@ -85,8 +106,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// ApiResponse of decimal? - ApiResponse FakeOuterNumberSerializeWithHttpInfo (decimal? body = null); + /// ApiResponse of decimal + ApiResponse FakeOuterNumberSerializeWithHttpInfo (decimal body = null); /// /// /// @@ -112,13 +133,34 @@ namespace Org.OpenAPITools.Api /// /// /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// + void TestBodyWithFileSchema (FileSchemaTestClass body); + + /// + /// + /// + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object(void) + ApiResponse TestBodyWithFileSchemaWithHttpInfo (FileSchemaTestClass body); + /// + /// + /// + /// /// /// /// Thrown when fails to make API call /// - /// + /// /// - void TestBodyWithQueryParams (string query, User user); + void TestBodyWithQueryParams (string query, User body); /// /// @@ -128,9 +170,9 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// - /// + /// /// ApiResponse of Object(void) - ApiResponse TestBodyWithQueryParamsWithHttpInfo (string query, User user); + ApiResponse TestBodyWithQueryParamsWithHttpInfo (string query, User body); /// /// To test \"client\" model /// @@ -138,9 +180,9 @@ namespace Org.OpenAPITools.Api /// To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - ModelClient TestClientModel (ModelClient modelClient); + ModelClient TestClientModel (ModelClient body); /// /// To test \"client\" model @@ -149,9 +191,9 @@ namespace Org.OpenAPITools.Api /// To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - ApiResponse TestClientModelWithHttpInfo (ModelClient modelClient); + ApiResponse TestClientModelWithHttpInfo (ModelClient body); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// @@ -174,7 +216,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// - void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = null, int int32 = null, long int64 = null, float _float = null, string _string = null, System.IO.Stream binary = null, DateTime date = null, DateTime dateTime = null, string password = null, string callback = null); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -198,7 +240,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// ApiResponse of Object(void) - ApiResponse TestEndpointParametersWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + ApiResponse TestEndpointParametersWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = null, int int32 = null, long int64 = null, float _float = null, string _string = null, System.IO.Stream binary = null, DateTime date = null, DateTime dateTime = null, string password = null, string callback = null); /// /// To test enum parameters /// @@ -215,7 +257,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// - void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); + void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int enumQueryInteger = null, double enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); /// /// To test enum parameters @@ -233,7 +275,38 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// ApiResponse of Object(void) - ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); + ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int enumQueryInteger = null, double enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); + /// + /// Fake endpoint to test group parameters (optional) + /// + /// + /// Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// + void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = null, bool booleanGroup = null, long int64Group = null); + + /// + /// Fake endpoint to test group parameters (optional) + /// + /// + /// Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// ApiResponse of Object(void) + ApiResponse TestGroupParametersWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = null, bool booleanGroup = null, long int64Group = null); /// /// test inline additionalProperties /// @@ -241,9 +314,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// request body + /// request body /// - void TestInlineAdditionalProperties (Dictionary requestBody); + void TestInlineAdditionalProperties (Dictionary param); /// /// test inline additionalProperties @@ -252,9 +325,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// request body + /// request body /// ApiResponse of Object(void) - ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Dictionary requestBody); + ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Dictionary param); /// /// test json serialization of form data /// @@ -281,6 +354,27 @@ namespace Org.OpenAPITools.Api #endregion Synchronous Operations #region Asynchronous Operations /// + /// creates an XmlItem + /// + /// + /// this route creates an XmlItem + /// + /// Thrown when fails to make API call + /// XmlItem Body + /// Task of void + System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem); + + /// + /// creates an XmlItem + /// + /// + /// this route creates an XmlItem + /// + /// Thrown when fails to make API call + /// XmlItem Body + /// Task of ApiResponse + System.Threading.Tasks.Task> CreateXmlItemAsyncWithHttpInfo (XmlItem xmlItem); + /// /// /// /// @@ -288,8 +382,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of bool? - System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = null); + /// Task of bool + System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool body = null); /// /// @@ -299,8 +393,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of ApiResponse (bool?) - System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = null); + /// Task of ApiResponse (bool) + System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool body = null); /// /// /// @@ -308,9 +402,9 @@ namespace Org.OpenAPITools.Api /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// Task of OuterComposite - System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite outerComposite = null); + System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null); /// /// @@ -319,9 +413,9 @@ namespace Org.OpenAPITools.Api /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// Task of ApiResponse (OuterComposite) - System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite outerComposite = null); + System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null); /// /// /// @@ -330,8 +424,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of decimal? - System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = null); + /// Task of decimal + System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal body = null); /// /// @@ -341,8 +435,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of ApiResponse (decimal?) - System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = null); + /// Task of ApiResponse (decimal) + System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal body = null); /// /// /// @@ -368,13 +462,34 @@ namespace Org.OpenAPITools.Api /// /// /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Task of void + System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body); + + /// + /// + /// + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Task of ApiResponse + System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body); + /// + /// + /// + /// /// /// /// Thrown when fails to make API call /// - /// + /// /// Task of void - System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User user); + System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body); /// /// @@ -384,9 +499,9 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// - /// + /// /// Task of ApiResponse - System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User user); + System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body); /// /// To test \"client\" model /// @@ -394,9 +509,9 @@ namespace Org.OpenAPITools.Api /// To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - System.Threading.Tasks.Task TestClientModelAsync (ModelClient modelClient); + System.Threading.Tasks.Task TestClientModelAsync (ModelClient body); /// /// To test \"client\" model @@ -405,9 +520,9 @@ namespace Org.OpenAPITools.Api /// To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient modelClient); + System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// @@ -430,7 +545,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// Task of void - System.Threading.Tasks.Task TestEndpointParametersAsync (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = null, int int32 = null, long int64 = null, float _float = null, string _string = null, System.IO.Stream binary = null, DateTime date = null, DateTime dateTime = null, string password = null, string callback = null); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -454,7 +569,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// Task of ApiResponse - System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = null, int int32 = null, long int64 = null, float _float = null, string _string = null, System.IO.Stream binary = null, DateTime date = null, DateTime dateTime = null, string password = null, string callback = null); /// /// To test enum parameters /// @@ -471,7 +586,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// Task of void - System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); + System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int enumQueryInteger = null, double enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); /// /// To test enum parameters @@ -489,7 +604,38 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// Task of ApiResponse - System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); + System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int enumQueryInteger = null, double enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); + /// + /// Fake endpoint to test group parameters (optional) + /// + /// + /// Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Task of void + System.Threading.Tasks.Task TestGroupParametersAsync (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = null, bool booleanGroup = null, long int64Group = null); + + /// + /// Fake endpoint to test group parameters (optional) + /// + /// + /// Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Task of ApiResponse + System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = null, bool booleanGroup = null, long int64Group = null); /// /// test inline additionalProperties /// @@ -497,9 +643,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// request body + /// request body /// Task of void - System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary requestBody); + System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary param); /// /// test inline additionalProperties @@ -508,9 +654,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// request body + /// request body /// Task of ApiResponse - System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary requestBody); + System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary param); /// /// test json serialization of form data /// @@ -555,6 +701,17 @@ namespace Org.OpenAPITools.Api ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; } + /// + /// Initializes a new instance of the class + /// + /// + public FakeApi() + { + this.Configuration = Org.OpenAPITools.Client.Configuration.Default; + + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + /// /// Initializes a new instance of the class /// using Configuration object @@ -634,15 +791,170 @@ namespace Org.OpenAPITools.Api this.Configuration.AddDefaultHeader(key, value); } + /// + /// creates an XmlItem this route creates an XmlItem + /// + /// Thrown when fails to make API call + /// XmlItem Body + /// + public void CreateXmlItem (XmlItem xmlItem) + { + CreateXmlItemWithHttpInfo(xmlItem); + } + + /// + /// creates an XmlItem this route creates an XmlItem + /// + /// Thrown when fails to make API call + /// XmlItem Body + /// ApiResponse of Object(void) + public ApiResponse CreateXmlItemWithHttpInfo (XmlItem xmlItem) + { + // verify the required parameter 'xmlItem' is set + if (xmlItem == null) + throw new ApiException(400, "Missing required parameter 'xmlItem' when calling FakeApi->CreateXmlItem"); + + var localVarPath = "./fake/create_xml_item"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/xml", + "application/xml; charset=utf-8", + "application/xml; charset=utf-16", + "text/xml", + "text/xml; charset=utf-8", + "text/xml; charset=utf-16" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (xmlItem != null && xmlItem.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(xmlItem); // http body (model) parameter + } + else + { + localVarPostBody = xmlItem; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("CreateXmlItem", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + null); + } + + /// + /// creates an XmlItem this route creates an XmlItem + /// + /// Thrown when fails to make API call + /// XmlItem Body + /// Task of void + public async System.Threading.Tasks.Task CreateXmlItemAsync (XmlItem xmlItem) + { + await CreateXmlItemAsyncWithHttpInfo(xmlItem); + + } + + /// + /// creates an XmlItem this route creates an XmlItem + /// + /// Thrown when fails to make API call + /// XmlItem Body + /// Task of ApiResponse + public async System.Threading.Tasks.Task> CreateXmlItemAsyncWithHttpInfo (XmlItem xmlItem) + { + // verify the required parameter 'xmlItem' is set + if (xmlItem == null) + throw new ApiException(400, "Missing required parameter 'xmlItem' when calling FakeApi->CreateXmlItem"); + + var localVarPath = "./fake/create_xml_item"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/xml", + "application/xml; charset=utf-8", + "application/xml; charset=utf-16", + "text/xml", + "text/xml; charset=utf-8", + "text/xml; charset=utf-16" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (xmlItem != null && xmlItem.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(xmlItem); // http body (model) parameter + } + else + { + localVarPostBody = xmlItem; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("CreateXmlItem", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + null); + } + /// /// Test serialization of outer boolean types /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// bool? - public bool? FakeOuterBooleanSerialize (bool? body = null) + /// bool + public bool FakeOuterBooleanSerialize (bool body = null) { - ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -651,8 +963,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// ApiResponse of bool? - public ApiResponse< bool? > FakeOuterBooleanSerializeWithHttpInfo (bool? body = null) + /// ApiResponse of bool + public ApiResponse< bool > FakeOuterBooleanSerializeWithHttpInfo (bool body = null) { var localVarPath = "./fake/outer/boolean"; @@ -699,9 +1011,9 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (bool?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool?))); + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (bool) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool))); } /// @@ -709,10 +1021,10 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of bool? - public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = null) + /// Task of bool + public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool body = null) { - ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -722,8 +1034,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of ApiResponse (bool?) - public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = null) + /// Task of ApiResponse (bool) + public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool body = null) { var localVarPath = "./fake/outer/boolean"; @@ -770,20 +1082,20 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (bool?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool?))); + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (bool) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool))); } /// /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// OuterComposite - public OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null) + public OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) { - ApiResponse localVarResponse = FakeOuterCompositeSerializeWithHttpInfo(outerComposite); + ApiResponse localVarResponse = FakeOuterCompositeSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -791,9 +1103,9 @@ namespace Org.OpenAPITools.Api /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// ApiResponse of OuterComposite - public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (OuterComposite outerComposite = null) + public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null) { var localVarPath = "./fake/outer/composite"; @@ -817,13 +1129,13 @@ namespace Org.OpenAPITools.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (outerComposite != null && outerComposite.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(outerComposite); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = outerComposite; // byte array + localVarPostBody = body; // byte array } @@ -841,7 +1153,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (OuterComposite) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterComposite))); } @@ -849,11 +1161,11 @@ namespace Org.OpenAPITools.Api /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// Task of OuterComposite - public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite outerComposite = null) + public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null) { - ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(outerComposite); + ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -862,9 +1174,9 @@ namespace Org.OpenAPITools.Api /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// Task of ApiResponse (OuterComposite) - public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite outerComposite = null) + public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null) { var localVarPath = "./fake/outer/composite"; @@ -888,13 +1200,13 @@ namespace Org.OpenAPITools.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (outerComposite != null && outerComposite.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(outerComposite); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = outerComposite; // byte array + localVarPostBody = body; // byte array } @@ -912,7 +1224,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (OuterComposite) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterComposite))); } @@ -921,10 +1233,10 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// decimal? - public decimal? FakeOuterNumberSerialize (decimal? body = null) + /// decimal + public decimal FakeOuterNumberSerialize (decimal body = null) { - ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -933,8 +1245,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// ApiResponse of decimal? - public ApiResponse< decimal? > FakeOuterNumberSerializeWithHttpInfo (decimal? body = null) + /// ApiResponse of decimal + public ApiResponse< decimal > FakeOuterNumberSerializeWithHttpInfo (decimal body = null) { var localVarPath = "./fake/outer/number"; @@ -981,9 +1293,9 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (decimal?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal?))); + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (decimal) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal))); } /// @@ -991,10 +1303,10 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of decimal? - public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = null) + /// Task of decimal + public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal body = null) { - ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -1004,8 +1316,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of ApiResponse (decimal?) - public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = null) + /// Task of ApiResponse (decimal) + public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal body = null) { var localVarPath = "./fake/outer/number"; @@ -1052,9 +1364,9 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (decimal?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal?))); + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (decimal) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal))); } /// @@ -1123,7 +1435,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (string) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); } @@ -1194,20 +1506,153 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (string) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); } /// - /// + /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// - /// + /// /// - public void TestBodyWithQueryParams (string query, User user) + public void TestBodyWithFileSchema (FileSchemaTestClass body) { - TestBodyWithQueryParamsWithHttpInfo(query, user); + TestBodyWithFileSchemaWithHttpInfo(body); + } + + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// ApiResponse of Object(void) + public ApiResponse TestBodyWithFileSchemaWithHttpInfo (FileSchemaTestClass body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithFileSchema"); + + var localVarPath = "./fake/body-with-file-schema"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestBodyWithFileSchema", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + null); + } + + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Task of void + public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body) + { + await TestBodyWithFileSchemaAsyncWithHttpInfo(body); + + } + + /// + /// For this test, the body for this request much reference a schema named `File`. + /// + /// Thrown when fails to make API call + /// + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body) + { + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithFileSchema"); + + var localVarPath = "./fake/body-with-file-schema"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "application/json" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (body != null && body.GetType() != typeof(byte[])) + { + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + localVarPostBody = body; // byte array + } + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestBodyWithFileSchema", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + null); } /// @@ -1215,16 +1660,28 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// - /// + /// + /// + public void TestBodyWithQueryParams (string query, User body) + { + TestBodyWithQueryParamsWithHttpInfo(query, body); + } + + /// + /// + /// + /// Thrown when fails to make API call + /// + /// /// ApiResponse of Object(void) - public ApiResponse TestBodyWithQueryParamsWithHttpInfo (string query, User user) + public ApiResponse TestBodyWithQueryParamsWithHttpInfo (string query, User body) { // verify the required parameter 'query' is set if (query == null) throw new ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); - // verify the required parameter 'user' is set - if (user == null) - throw new ApiException(400, "Missing required parameter 'user' when calling FakeApi->TestBodyWithQueryParams"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithQueryParams"); var localVarPath = "./fake/body-with-query-params"; var localVarPathParams = new Dictionary(); @@ -1248,13 +1705,13 @@ namespace Org.OpenAPITools.Api localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); if (query != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "query", query)); // query parameter - if (user != null && user.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = user; // byte array + localVarPostBody = body; // byte array } @@ -1272,7 +1729,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1281,11 +1738,11 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// - /// + /// /// Task of void - public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User user) + public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body) { - await TestBodyWithQueryParamsAsyncWithHttpInfo(query, user); + await TestBodyWithQueryParamsAsyncWithHttpInfo(query, body); } @@ -1294,16 +1751,16 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// - /// + /// /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User user) + public async System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body) { // verify the required parameter 'query' is set if (query == null) throw new ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); - // verify the required parameter 'user' is set - if (user == null) - throw new ApiException(400, "Missing required parameter 'user' when calling FakeApi->TestBodyWithQueryParams"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithQueryParams"); var localVarPath = "./fake/body-with-query-params"; var localVarPathParams = new Dictionary(); @@ -1327,13 +1784,13 @@ namespace Org.OpenAPITools.Api localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); if (query != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "query", query)); // query parameter - if (user != null && user.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = user; // byte array + localVarPostBody = body; // byte array } @@ -1351,7 +1808,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1359,11 +1816,11 @@ namespace Org.OpenAPITools.Api /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - public ModelClient TestClientModel (ModelClient modelClient) + public ModelClient TestClientModel (ModelClient body) { - ApiResponse localVarResponse = TestClientModelWithHttpInfo(modelClient); + ApiResponse localVarResponse = TestClientModelWithHttpInfo(body); return localVarResponse.Data; } @@ -1371,13 +1828,13 @@ namespace Org.OpenAPITools.Api /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient modelClient) + public ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient body) { - // verify the required parameter 'modelClient' is set - if (modelClient == null) - throw new ApiException(400, "Missing required parameter 'modelClient' when calling FakeApi->TestClientModel"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestClientModel"); var localVarPath = "./fake"; var localVarPathParams = new Dictionary(); @@ -1401,13 +1858,13 @@ namespace Org.OpenAPITools.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (modelClient != null && modelClient.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = modelClient; // byte array + localVarPostBody = body; // byte array } @@ -1425,7 +1882,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (ModelClient) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); } @@ -1433,11 +1890,11 @@ namespace Org.OpenAPITools.Api /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - public async System.Threading.Tasks.Task TestClientModelAsync (ModelClient modelClient) + public async System.Threading.Tasks.Task TestClientModelAsync (ModelClient body) { - ApiResponse localVarResponse = await TestClientModelAsyncWithHttpInfo(modelClient); + ApiResponse localVarResponse = await TestClientModelAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -1446,13 +1903,13 @@ namespace Org.OpenAPITools.Api /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - public async System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient modelClient) + public async System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body) { - // verify the required parameter 'modelClient' is set - if (modelClient == null) - throw new ApiException(400, "Missing required parameter 'modelClient' when calling FakeApi->TestClientModel"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestClientModel"); var localVarPath = "./fake"; var localVarPathParams = new Dictionary(); @@ -1476,13 +1933,13 @@ namespace Org.OpenAPITools.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (modelClient != null && modelClient.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = modelClient; // byte array + localVarPostBody = body; // byte array } @@ -1500,7 +1957,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (ModelClient) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); } @@ -1523,7 +1980,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// - public void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + public void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = null, int int32 = null, long int64 = null, float _float = null, string _string = null, System.IO.Stream binary = null, DateTime date = null, DateTime dateTime = null, string password = null, string callback = null) { TestEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); } @@ -1547,7 +2004,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// ApiResponse of Object(void) - public ApiResponse TestEndpointParametersWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + public ApiResponse TestEndpointParametersWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = null, int int32 = null, long int64 = null, float _float = null, string _string = null, System.IO.Stream binary = null, DateTime date = null, DateTime dateTime = null, string password = null, string callback = null) { // verify the required parameter 'number' is set if (number == null) @@ -1619,7 +2076,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1642,7 +2099,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// Task of void - public async System.Threading.Tasks.Task TestEndpointParametersAsync (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + public async System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = null, int int32 = null, long int64 = null, float _float = null, string _string = null, System.IO.Stream binary = null, DateTime date = null, DateTime dateTime = null, string password = null, string callback = null) { await TestEndpointParametersAsyncWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); @@ -1667,7 +2124,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + public async System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = null, int int32 = null, long int64 = null, float _float = null, string _string = null, System.IO.Stream binary = null, DateTime date = null, DateTime dateTime = null, string password = null, string callback = null) { // verify the required parameter 'number' is set if (number == null) @@ -1739,7 +2196,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1756,7 +2213,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// - public void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) + public void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int enumQueryInteger = null, double enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) { TestEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } @@ -1774,7 +2231,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// ApiResponse of Object(void) - public ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) + public ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int enumQueryInteger = null, double enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) { var localVarPath = "./fake"; @@ -1822,7 +2279,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1839,7 +2296,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// Task of void - public async System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) + public async System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int enumQueryInteger = null, double enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) { await TestEnumParametersAsyncWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); @@ -1858,7 +2315,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) + public async System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int enumQueryInteger = null, double enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) { var localVarPath = "./fake"; @@ -1906,7 +2363,178 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + null); + } + + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// + public void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = null, bool booleanGroup = null, long int64Group = null) + { + TestGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// ApiResponse of Object(void) + public ApiResponse TestGroupParametersWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = null, bool booleanGroup = null, long int64Group = null) + { + // verify the required parameter 'requiredStringGroup' is set + if (requiredStringGroup == null) + throw new ApiException(400, "Missing required parameter 'requiredStringGroup' when calling FakeApi->TestGroupParameters"); + // verify the required parameter 'requiredBooleanGroup' is set + if (requiredBooleanGroup == null) + throw new ApiException(400, "Missing required parameter 'requiredBooleanGroup' when calling FakeApi->TestGroupParameters"); + // verify the required parameter 'requiredInt64Group' is set + if (requiredInt64Group == null) + throw new ApiException(400, "Missing required parameter 'requiredInt64Group' when calling FakeApi->TestGroupParameters"); + + var localVarPath = "./fake"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (requiredStringGroup != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "required_string_group", requiredStringGroup)); // query parameter + if (requiredInt64Group != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "required_int64_group", requiredInt64Group)); // query parameter + if (stringGroup != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "string_group", stringGroup)); // query parameter + if (int64Group != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "int64_group", int64Group)); // query parameter + if (requiredBooleanGroup != null) localVarHeaderParams.Add("required_boolean_group", this.Configuration.ApiClient.ParameterToString(requiredBooleanGroup)); // header parameter + if (booleanGroup != null) localVarHeaderParams.Add("boolean_group", this.Configuration.ApiClient.ParameterToString(booleanGroup)); // header parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestGroupParameters", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + null); + } + + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Task of void + public async System.Threading.Tasks.Task TestGroupParametersAsync (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = null, bool booleanGroup = null, long int64Group = null) + { + await TestGroupParametersAsyncWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + + } + + /// + /// Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters (optional) + /// + /// Thrown when fails to make API call + /// Required String in group parameters + /// Required Boolean in group parameters + /// Required Integer in group parameters + /// String in group parameters (optional) + /// Boolean in group parameters (optional) + /// Integer in group parameters (optional) + /// Task of ApiResponse + public async System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = null, bool booleanGroup = null, long int64Group = null) + { + // verify the required parameter 'requiredStringGroup' is set + if (requiredStringGroup == null) + throw new ApiException(400, "Missing required parameter 'requiredStringGroup' when calling FakeApi->TestGroupParameters"); + // verify the required parameter 'requiredBooleanGroup' is set + if (requiredBooleanGroup == null) + throw new ApiException(400, "Missing required parameter 'requiredBooleanGroup' when calling FakeApi->TestGroupParameters"); + // verify the required parameter 'requiredInt64Group' is set + if (requiredInt64Group == null) + throw new ApiException(400, "Missing required parameter 'requiredInt64Group' when calling FakeApi->TestGroupParameters"); + + var localVarPath = "./fake"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (requiredStringGroup != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "required_string_group", requiredStringGroup)); // query parameter + if (requiredInt64Group != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "required_int64_group", requiredInt64Group)); // query parameter + if (stringGroup != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "string_group", stringGroup)); // query parameter + if (int64Group != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "int64_group", int64Group)); // query parameter + if (requiredBooleanGroup != null) localVarHeaderParams.Add("required_boolean_group", this.Configuration.ApiClient.ParameterToString(requiredBooleanGroup)); // header parameter + if (booleanGroup != null) localVarHeaderParams.Add("boolean_group", this.Configuration.ApiClient.ParameterToString(booleanGroup)); // header parameter + + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.DELETE, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("TestGroupParameters", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1914,24 +2542,24 @@ namespace Org.OpenAPITools.Api /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body /// - public void TestInlineAdditionalProperties (Dictionary requestBody) + public void TestInlineAdditionalProperties (Dictionary param) { - TestInlineAdditionalPropertiesWithHttpInfo(requestBody); + TestInlineAdditionalPropertiesWithHttpInfo(param); } /// /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body /// ApiResponse of Object(void) - public ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Dictionary requestBody) + public ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Dictionary param) { - // verify the required parameter 'requestBody' is set - if (requestBody == null) - throw new ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestInlineAdditionalProperties"); + // verify the required parameter 'param' is set + if (param == null) + throw new ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestInlineAdditionalProperties"); var localVarPath = "./fake/inline-additionalProperties"; var localVarPathParams = new Dictionary(); @@ -1954,13 +2582,13 @@ namespace Org.OpenAPITools.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (requestBody != null && requestBody.GetType() != typeof(byte[])) + if (param != null && param.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(requestBody); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(param); // http body (model) parameter } else { - localVarPostBody = requestBody; // byte array + localVarPostBody = param; // byte array } @@ -1978,7 +2606,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1986,11 +2614,11 @@ namespace Org.OpenAPITools.Api /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body /// Task of void - public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary requestBody) + public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary param) { - await TestInlineAdditionalPropertiesAsyncWithHttpInfo(requestBody); + await TestInlineAdditionalPropertiesAsyncWithHttpInfo(param); } @@ -1998,13 +2626,13 @@ namespace Org.OpenAPITools.Api /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary requestBody) + public async System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary param) { - // verify the required parameter 'requestBody' is set - if (requestBody == null) - throw new ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestInlineAdditionalProperties"); + // verify the required parameter 'param' is set + if (param == null) + throw new ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestInlineAdditionalProperties"); var localVarPath = "./fake/inline-additionalProperties"; var localVarPathParams = new Dictionary(); @@ -2027,13 +2655,13 @@ namespace Org.OpenAPITools.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (requestBody != null && requestBody.GetType() != typeof(byte[])) + if (param != null && param.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(requestBody); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(param); // http body (model) parameter } else { - localVarPostBody = requestBody; // byte array + localVarPostBody = param; // byte array } @@ -2051,7 +2679,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -2122,7 +2750,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -2194,7 +2822,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 56e8adf1933..15a124d69b3 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -31,9 +31,9 @@ namespace Org.OpenAPITools.Api /// To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - ModelClient TestClassname (ModelClient modelClient); + ModelClient TestClassname (ModelClient body); /// /// To test class name in snake case @@ -42,9 +42,9 @@ namespace Org.OpenAPITools.Api /// To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - ApiResponse TestClassnameWithHttpInfo (ModelClient modelClient); + ApiResponse TestClassnameWithHttpInfo (ModelClient body); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -54,9 +54,9 @@ namespace Org.OpenAPITools.Api /// To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - System.Threading.Tasks.Task TestClassnameAsync (ModelClient modelClient); + System.Threading.Tasks.Task TestClassnameAsync (ModelClient body); /// /// To test class name in snake case @@ -65,9 +65,9 @@ namespace Org.OpenAPITools.Api /// To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient modelClient); + System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body); #endregion Asynchronous Operations } @@ -89,6 +89,17 @@ namespace Org.OpenAPITools.Api ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; } + /// + /// Initializes a new instance of the class + /// + /// + public FakeClassnameTags123Api() + { + this.Configuration = Org.OpenAPITools.Client.Configuration.Default; + + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + /// /// Initializes a new instance of the class /// using Configuration object @@ -172,11 +183,11 @@ namespace Org.OpenAPITools.Api /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - public ModelClient TestClassname (ModelClient modelClient) + public ModelClient TestClassname (ModelClient body) { - ApiResponse localVarResponse = TestClassnameWithHttpInfo(modelClient); + ApiResponse localVarResponse = TestClassnameWithHttpInfo(body); return localVarResponse.Data; } @@ -184,13 +195,13 @@ namespace Org.OpenAPITools.Api /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient modelClient) + public ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient body) { - // verify the required parameter 'modelClient' is set - if (modelClient == null) - throw new ApiException(400, "Missing required parameter 'modelClient' when calling FakeClassnameTags123Api->TestClassname"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeClassnameTags123Api->TestClassname"); var localVarPath = "./fake_classname_test"; var localVarPathParams = new Dictionary(); @@ -214,13 +225,13 @@ namespace Org.OpenAPITools.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (modelClient != null && modelClient.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = modelClient; // byte array + localVarPostBody = body; // byte array } // authentication (api_key_query) required @@ -243,7 +254,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (ModelClient) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); } @@ -251,11 +262,11 @@ namespace Org.OpenAPITools.Api /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - public async System.Threading.Tasks.Task TestClassnameAsync (ModelClient modelClient) + public async System.Threading.Tasks.Task TestClassnameAsync (ModelClient body) { - ApiResponse localVarResponse = await TestClassnameAsyncWithHttpInfo(modelClient); + ApiResponse localVarResponse = await TestClassnameAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -264,13 +275,13 @@ namespace Org.OpenAPITools.Api /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - public async System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient modelClient) + public async System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body) { - // verify the required parameter 'modelClient' is set - if (modelClient == null) - throw new ApiException(400, "Missing required parameter 'modelClient' when calling FakeClassnameTags123Api->TestClassname"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling FakeClassnameTags123Api->TestClassname"); var localVarPath = "./fake_classname_test"; var localVarPathParams = new Dictionary(); @@ -294,13 +305,13 @@ namespace Org.OpenAPITools.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (modelClient != null && modelClient.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = modelClient; // byte array + localVarPostBody = body; // byte array } // authentication (api_key_query) required @@ -323,7 +334,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (ModelClient) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ModelClient))); } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/PetApi.cs index f34cfb4d6a3..661edb06173 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/PetApi.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -31,9 +31,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - void AddPet (Pet pet); + void AddPet (Pet body); /// /// Add a new pet to the store @@ -42,9 +42,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// ApiResponse of Object(void) - ApiResponse AddPetWithHttpInfo (Pet pet); + ApiResponse AddPetWithHttpInfo (Pet body); /// /// Deletes a pet /// @@ -55,7 +55,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// - void DeletePet (long? petId, string apiKey = null); + void DeletePet (long petId, string apiKey = null); /// /// Deletes a pet @@ -67,7 +67,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// ApiResponse of Object(void) - ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = null); + ApiResponse DeletePetWithHttpInfo (long petId, string apiKey = null); /// /// Finds Pets by status /// @@ -119,7 +119,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Pet - Pet GetPetById (long? petId); + Pet GetPetById (long petId); /// /// Find pet by ID @@ -130,7 +130,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// ApiResponse of Pet - ApiResponse GetPetByIdWithHttpInfo (long? petId); + ApiResponse GetPetByIdWithHttpInfo (long petId); /// /// Update an existing pet /// @@ -138,9 +138,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - void UpdatePet (Pet pet); + void UpdatePet (Pet body); /// /// Update an existing pet @@ -149,9 +149,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// ApiResponse of Object(void) - ApiResponse UpdatePetWithHttpInfo (Pet pet); + ApiResponse UpdatePetWithHttpInfo (Pet body); /// /// Updates a pet in the store with form data /// @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// - void UpdatePetWithForm (long? petId, string name = null, string status = null); + void UpdatePetWithForm (long petId, string name = null, string status = null); /// /// Updates a pet in the store with form data @@ -176,7 +176,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// ApiResponse of Object(void) - ApiResponse UpdatePetWithFormWithHttpInfo (long? petId, string name = null, string status = null); + ApiResponse UpdatePetWithFormWithHttpInfo (long petId, string name = null, string status = null); /// /// uploads an image /// @@ -188,7 +188,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse - ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + ApiResponse UploadFile (long petId, string additionalMetadata = null, System.IO.Stream file = null); /// /// uploads an image @@ -201,7 +201,32 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse of ApiResponse - ApiResponse UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + ApiResponse UploadFileWithHttpInfo (long petId, string additionalMetadata = null, System.IO.Stream file = null); + /// + /// uploads an image (required) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// ApiResponse + ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string additionalMetadata = null); + + /// + /// uploads an image (required) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// ApiResponse of ApiResponse + ApiResponse UploadFileWithRequiredFileWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = null); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -211,9 +236,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of void - System.Threading.Tasks.Task AddPetAsync (Pet pet); + System.Threading.Tasks.Task AddPetAsync (Pet body); /// /// Add a new pet to the store @@ -222,9 +247,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of ApiResponse - System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet pet); + System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body); /// /// Deletes a pet /// @@ -235,7 +260,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// Task of void - System.Threading.Tasks.Task DeletePetAsync (long? petId, string apiKey = null); + System.Threading.Tasks.Task DeletePetAsync (long petId, string apiKey = null); /// /// Deletes a pet @@ -247,7 +272,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// Task of ApiResponse - System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long? petId, string apiKey = null); + System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = null); /// /// Finds Pets by status /// @@ -299,7 +324,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Task of Pet - System.Threading.Tasks.Task GetPetByIdAsync (long? petId); + System.Threading.Tasks.Task GetPetByIdAsync (long petId); /// /// Find pet by ID @@ -310,7 +335,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Task of ApiResponse (Pet) - System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long? petId); + System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId); /// /// Update an existing pet /// @@ -318,9 +343,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of void - System.Threading.Tasks.Task UpdatePetAsync (Pet pet); + System.Threading.Tasks.Task UpdatePetAsync (Pet body); /// /// Update an existing pet @@ -329,9 +354,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of ApiResponse - System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet pet); + System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body); /// /// Updates a pet in the store with form data /// @@ -343,7 +368,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// Task of void - System.Threading.Tasks.Task UpdatePetWithFormAsync (long? petId, string name = null, string status = null); + System.Threading.Tasks.Task UpdatePetWithFormAsync (long petId, string name = null, string status = null); /// /// Updates a pet in the store with form data @@ -356,7 +381,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// Task of ApiResponse - System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long? petId, string name = null, string status = null); + System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = null, string status = null); /// /// uploads an image /// @@ -368,7 +393,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// Task of ApiResponse - System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + System.Threading.Tasks.Task UploadFileAsync (long petId, string additionalMetadata = null, System.IO.Stream file = null); /// /// uploads an image @@ -381,7 +406,32 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// Task of ApiResponse (ApiResponse) - System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = null, System.IO.Stream file = null); + /// + /// uploads an image (required) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Task of ApiResponse + System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long petId, System.IO.Stream requiredFile, string additionalMetadata = null); + + /// + /// uploads an image (required) + /// + /// + /// + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Task of ApiResponse (ApiResponse) + System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = null); #endregion Asynchronous Operations } @@ -403,6 +453,17 @@ namespace Org.OpenAPITools.Api ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; } + /// + /// Initializes a new instance of the class + /// + /// + public PetApi() + { + this.Configuration = Org.OpenAPITools.Client.Configuration.Default; + + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + /// /// Initializes a new instance of the class /// using Configuration object @@ -486,24 +547,24 @@ namespace Org.OpenAPITools.Api /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - public void AddPet (Pet pet) + public void AddPet (Pet body) { - AddPetWithHttpInfo(pet); + AddPetWithHttpInfo(body); } /// /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// ApiResponse of Object(void) - public ApiResponse AddPetWithHttpInfo (Pet pet) + public ApiResponse AddPetWithHttpInfo (Pet body) { - // verify the required parameter 'pet' is set - if (pet == null) - throw new ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->AddPet"); var localVarPath = "./pet"; var localVarPathParams = new Dictionary(); @@ -527,13 +588,13 @@ namespace Org.OpenAPITools.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (pet != null && pet.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(pet); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = pet; // byte array + localVarPostBody = body; // byte array } // authentication (petstore_auth) required @@ -557,7 +618,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -565,11 +626,11 @@ namespace Org.OpenAPITools.Api /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of void - public async System.Threading.Tasks.Task AddPetAsync (Pet pet) + public async System.Threading.Tasks.Task AddPetAsync (Pet body) { - await AddPetAsyncWithHttpInfo(pet); + await AddPetAsyncWithHttpInfo(body); } @@ -577,13 +638,13 @@ namespace Org.OpenAPITools.Api /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of ApiResponse - public async System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet pet) + public async System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body) { - // verify the required parameter 'pet' is set - if (pet == null) - throw new ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->AddPet"); var localVarPath = "./pet"; var localVarPathParams = new Dictionary(); @@ -607,13 +668,13 @@ namespace Org.OpenAPITools.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (pet != null && pet.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(pet); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = pet; // byte array + localVarPostBody = body; // byte array } // authentication (petstore_auth) required @@ -637,7 +698,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -648,7 +709,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// - public void DeletePet (long? petId, string apiKey = null) + public void DeletePet (long petId, string apiKey = null) { DeletePetWithHttpInfo(petId, apiKey); } @@ -660,7 +721,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// ApiResponse of Object(void) - public ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = null) + public ApiResponse DeletePetWithHttpInfo (long petId, string apiKey = null) { // verify the required parameter 'petId' is set if (petId == null) @@ -710,7 +771,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -721,7 +782,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// Task of void - public async System.Threading.Tasks.Task DeletePetAsync (long? petId, string apiKey = null) + public async System.Threading.Tasks.Task DeletePetAsync (long petId, string apiKey = null) { await DeletePetAsyncWithHttpInfo(petId, apiKey); @@ -734,7 +795,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long? petId, string apiKey = null) + public async System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = null) { // verify the required parameter 'petId' is set if (petId == null) @@ -784,7 +845,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -857,7 +918,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse>(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (List) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); } @@ -931,7 +992,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse>(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (List) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); } @@ -1004,7 +1065,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse>(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (List) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); } @@ -1078,7 +1139,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse>(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (List) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(List))); } @@ -1088,7 +1149,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Pet - public Pet GetPetById (long? petId) + public Pet GetPetById (long petId) { ApiResponse localVarResponse = GetPetByIdWithHttpInfo(petId); return localVarResponse.Data; @@ -1100,7 +1161,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// ApiResponse of Pet - public ApiResponse< Pet > GetPetByIdWithHttpInfo (long? petId) + public ApiResponse< Pet > GetPetByIdWithHttpInfo (long petId) { // verify the required parameter 'petId' is set if (petId == null) @@ -1150,7 +1211,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (Pet) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Pet))); } @@ -1160,7 +1221,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Task of Pet - public async System.Threading.Tasks.Task GetPetByIdAsync (long? petId) + public async System.Threading.Tasks.Task GetPetByIdAsync (long petId) { ApiResponse localVarResponse = await GetPetByIdAsyncWithHttpInfo(petId); return localVarResponse.Data; @@ -1173,7 +1234,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Task of ApiResponse (Pet) - public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long? petId) + public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId) { // verify the required parameter 'petId' is set if (petId == null) @@ -1223,7 +1284,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (Pet) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Pet))); } @@ -1231,24 +1292,24 @@ namespace Org.OpenAPITools.Api /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - public void UpdatePet (Pet pet) + public void UpdatePet (Pet body) { - UpdatePetWithHttpInfo(pet); + UpdatePetWithHttpInfo(body); } /// /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// ApiResponse of Object(void) - public ApiResponse UpdatePetWithHttpInfo (Pet pet) + public ApiResponse UpdatePetWithHttpInfo (Pet body) { - // verify the required parameter 'pet' is set - if (pet == null) - throw new ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->UpdatePet"); var localVarPath = "./pet"; var localVarPathParams = new Dictionary(); @@ -1272,13 +1333,13 @@ namespace Org.OpenAPITools.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (pet != null && pet.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(pet); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = pet; // byte array + localVarPostBody = body; // byte array } // authentication (petstore_auth) required @@ -1302,7 +1363,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1310,11 +1371,11 @@ namespace Org.OpenAPITools.Api /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of void - public async System.Threading.Tasks.Task UpdatePetAsync (Pet pet) + public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) { - await UpdatePetAsyncWithHttpInfo(pet); + await UpdatePetAsyncWithHttpInfo(body); } @@ -1322,13 +1383,13 @@ namespace Org.OpenAPITools.Api /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet pet) + public async System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body) { - // verify the required parameter 'pet' is set - if (pet == null) - throw new ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->UpdatePet"); var localVarPath = "./pet"; var localVarPathParams = new Dictionary(); @@ -1352,13 +1413,13 @@ namespace Org.OpenAPITools.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (pet != null && pet.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(pet); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = pet; // byte array + localVarPostBody = body; // byte array } // authentication (petstore_auth) required @@ -1382,7 +1443,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1394,7 +1455,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// - public void UpdatePetWithForm (long? petId, string name = null, string status = null) + public void UpdatePetWithForm (long petId, string name = null, string status = null) { UpdatePetWithFormWithHttpInfo(petId, name, status); } @@ -1407,7 +1468,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// ApiResponse of Object(void) - public ApiResponse UpdatePetWithFormWithHttpInfo (long? petId, string name = null, string status = null) + public ApiResponse UpdatePetWithFormWithHttpInfo (long petId, string name = null, string status = null) { // verify the required parameter 'petId' is set if (petId == null) @@ -1459,7 +1520,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1471,7 +1532,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// Task of void - public async System.Threading.Tasks.Task UpdatePetWithFormAsync (long? petId, string name = null, string status = null) + public async System.Threading.Tasks.Task UpdatePetWithFormAsync (long petId, string name = null, string status = null) { await UpdatePetWithFormAsyncWithHttpInfo(petId, name, status); @@ -1485,7 +1546,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long? petId, string name = null, string status = null) + public async System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = null, string status = null) { // verify the required parameter 'petId' is set if (petId == null) @@ -1537,7 +1598,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1549,7 +1610,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse - public ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public ApiResponse UploadFile (long petId, string additionalMetadata = null, System.IO.Stream file = null) { ApiResponse localVarResponse = UploadFileWithHttpInfo(petId, additionalMetadata, file); return localVarResponse.Data; @@ -1563,7 +1624,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse of ApiResponse - public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long petId, string additionalMetadata = null, System.IO.Stream file = null) { // verify the required parameter 'petId' is set if (petId == null) @@ -1616,7 +1677,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (ApiResponse) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ApiResponse))); } @@ -1628,7 +1689,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public async System.Threading.Tasks.Task UploadFileAsync (long petId, string additionalMetadata = null, System.IO.Stream file = null) { ApiResponse localVarResponse = await UploadFileAsyncWithHttpInfo(petId, additionalMetadata, file); return localVarResponse.Data; @@ -1643,7 +1704,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// Task of ApiResponse (ApiResponse) - public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = null, System.IO.Stream file = null) { // verify the required parameter 'petId' is set if (petId == null) @@ -1696,7 +1757,172 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (ApiResponse) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ApiResponse))); + } + + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// ApiResponse + public ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string additionalMetadata = null) + { + ApiResponse localVarResponse = UploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata); + return localVarResponse.Data; + } + + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// ApiResponse of ApiResponse + public ApiResponse< ApiResponse > UploadFileWithRequiredFileWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = null) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFileWithRequiredFile"); + // verify the required parameter 'requiredFile' is set + if (requiredFile == null) + throw new ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile"); + + var localVarPath = "./fake/{petId}/uploadImageWithRequiredFile"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "multipart/form-data" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (petId != null) localVarPathParams.Add("petId", this.Configuration.ApiClient.ParameterToString(petId)); // path parameter + if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", this.Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter + if (requiredFile != null) localVarFileParams.Add("requiredFile", this.Configuration.ApiClient.ParameterToFile("requiredFile", requiredFile)); + + // authentication (petstore_auth) required + // oauth required + if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + this.Configuration.AccessToken; + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UploadFileWithRequiredFile", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (ApiResponse) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ApiResponse))); + } + + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Task of ApiResponse + public async System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long petId, System.IO.Stream requiredFile, string additionalMetadata = null) + { + ApiResponse localVarResponse = await UploadFileWithRequiredFileAsyncWithHttpInfo(petId, requiredFile, additionalMetadata); + return localVarResponse.Data; + + } + + /// + /// uploads an image (required) + /// + /// Thrown when fails to make API call + /// ID of pet to update + /// file to upload + /// Additional data to pass to server (optional) + /// Task of ApiResponse (ApiResponse) + public async System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = null) + { + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFileWithRequiredFile"); + // verify the required parameter 'requiredFile' is set + if (requiredFile == null) + throw new ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile"); + + var localVarPath = "./fake/{petId}/uploadImageWithRequiredFile"; + var localVarPathParams = new Dictionary(); + var localVarQueryParams = new List>(); + var localVarHeaderParams = new Dictionary(this.Configuration.DefaultHeader); + var localVarFormParams = new Dictionary(); + var localVarFileParams = new Dictionary(); + Object localVarPostBody = null; + + // to determine the Content-Type header + String[] localVarHttpContentTypes = new String[] { + "multipart/form-data" + }; + String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); + + // to determine the Accept header + String[] localVarHttpHeaderAccepts = new String[] { + "application/json" + }; + String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); + if (localVarHttpHeaderAccept != null) + localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); + + if (petId != null) localVarPathParams.Add("petId", this.Configuration.ApiClient.ParameterToString(petId)); // path parameter + if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", this.Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter + if (requiredFile != null) localVarFileParams.Add("requiredFile", this.Configuration.ApiClient.ParameterToFile("requiredFile", requiredFile)); + + // authentication (petstore_auth) required + // oauth required + if (!String.IsNullOrEmpty(this.Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + this.Configuration.AccessToken; + } + + // make the HTTP request + IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath, + Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, + localVarPathParams, localVarHttpContentType); + + int localVarStatusCode = (int) localVarResponse.StatusCode; + + if (ExceptionFactory != null) + { + Exception exception = ExceptionFactory("UploadFileWithRequiredFile", localVarResponse); + if (exception != null) throw exception; + } + + return new ApiResponse(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (ApiResponse) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ApiResponse))); } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/StoreApi.cs index d8184086b8d..c2ba2b259f8 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/StoreApi.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -52,8 +52,8 @@ namespace Org.OpenAPITools.Api /// Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Dictionary<string, int?> - Dictionary GetInventory (); + /// Dictionary<string, int> + Dictionary GetInventory (); /// /// Returns pet inventories by status @@ -62,8 +62,8 @@ namespace Org.OpenAPITools.Api /// Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// ApiResponse of Dictionary<string, int?> - ApiResponse> GetInventoryWithHttpInfo (); + /// ApiResponse of Dictionary<string, int> + ApiResponse> GetInventoryWithHttpInfo (); /// /// Find purchase order by ID /// @@ -73,7 +73,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Order - Order GetOrderById (long? orderId); + Order GetOrderById (long orderId); /// /// Find purchase order by ID @@ -84,7 +84,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// ApiResponse of Order - ApiResponse GetOrderByIdWithHttpInfo (long? orderId); + ApiResponse GetOrderByIdWithHttpInfo (long orderId); /// /// Place an order for a pet /// @@ -92,9 +92,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Order - Order PlaceOrder (Order order); + Order PlaceOrder (Order body); /// /// Place an order for a pet @@ -103,9 +103,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// ApiResponse of Order - ApiResponse PlaceOrderWithHttpInfo (Order order); + ApiResponse PlaceOrderWithHttpInfo (Order body); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -136,8 +136,8 @@ namespace Org.OpenAPITools.Api /// Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Task of Dictionary<string, int?> - System.Threading.Tasks.Task> GetInventoryAsync (); + /// Task of Dictionary<string, int> + System.Threading.Tasks.Task> GetInventoryAsync (); /// /// Returns pet inventories by status @@ -146,8 +146,8 @@ namespace Org.OpenAPITools.Api /// Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Task of ApiResponse (Dictionary<string, int?>) - System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (); + /// Task of ApiResponse (Dictionary<string, int>) + System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (); /// /// Find purchase order by ID /// @@ -157,7 +157,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Task of Order - System.Threading.Tasks.Task GetOrderByIdAsync (long? orderId); + System.Threading.Tasks.Task GetOrderByIdAsync (long orderId); /// /// Find purchase order by ID @@ -168,7 +168,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Task of ApiResponse (Order) - System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long? orderId); + System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId); /// /// Place an order for a pet /// @@ -176,9 +176,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Task of Order - System.Threading.Tasks.Task PlaceOrderAsync (Order order); + System.Threading.Tasks.Task PlaceOrderAsync (Order body); /// /// Place an order for a pet @@ -187,9 +187,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Task of ApiResponse (Order) - System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order order); + System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body); #endregion Asynchronous Operations } @@ -211,6 +211,17 @@ namespace Org.OpenAPITools.Api ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; } + /// + /// Initializes a new instance of the class + /// + /// + public StoreApi() + { + this.Configuration = Org.OpenAPITools.Client.Configuration.Default; + + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + /// /// Initializes a new instance of the class /// using Configuration object @@ -350,7 +361,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -415,7 +426,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -423,10 +434,10 @@ namespace Org.OpenAPITools.Api /// Returns pet inventories by status Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Dictionary<string, int?> - public Dictionary GetInventory () + /// Dictionary<string, int> + public Dictionary GetInventory () { - ApiResponse> localVarResponse = GetInventoryWithHttpInfo(); + ApiResponse> localVarResponse = GetInventoryWithHttpInfo(); return localVarResponse.Data; } @@ -434,8 +445,8 @@ namespace Org.OpenAPITools.Api /// Returns pet inventories by status Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// ApiResponse of Dictionary<string, int?> - public ApiResponse< Dictionary > GetInventoryWithHttpInfo () + /// ApiResponse of Dictionary<string, int> + public ApiResponse< Dictionary > GetInventoryWithHttpInfo () { var localVarPath = "./store/inventory"; @@ -479,19 +490,19 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse>(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); } /// /// Returns pet inventories by status Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Task of Dictionary<string, int?> - public async System.Threading.Tasks.Task> GetInventoryAsync () + /// Task of Dictionary<string, int> + public async System.Threading.Tasks.Task> GetInventoryAsync () { - ApiResponse> localVarResponse = await GetInventoryAsyncWithHttpInfo(); + ApiResponse> localVarResponse = await GetInventoryAsyncWithHttpInfo(); return localVarResponse.Data; } @@ -500,8 +511,8 @@ namespace Org.OpenAPITools.Api /// Returns pet inventories by status Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Task of ApiResponse (Dictionary<string, int?>) - public async System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo () + /// Task of ApiResponse (Dictionary<string, int>) + public async System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo () { var localVarPath = "./store/inventory"; @@ -545,9 +556,9 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse>(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); + return new ApiResponse>(localVarStatusCode, + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), + (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); } /// @@ -556,7 +567,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Order - public Order GetOrderById (long? orderId) + public Order GetOrderById (long orderId) { ApiResponse localVarResponse = GetOrderByIdWithHttpInfo(orderId); return localVarResponse.Data; @@ -568,7 +579,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// ApiResponse of Order - public ApiResponse< Order > GetOrderByIdWithHttpInfo (long? orderId) + public ApiResponse< Order > GetOrderByIdWithHttpInfo (long orderId) { // verify the required parameter 'orderId' is set if (orderId == null) @@ -613,7 +624,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (Order) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); } @@ -623,7 +634,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Task of Order - public async System.Threading.Tasks.Task GetOrderByIdAsync (long? orderId) + public async System.Threading.Tasks.Task GetOrderByIdAsync (long orderId) { ApiResponse localVarResponse = await GetOrderByIdAsyncWithHttpInfo(orderId); return localVarResponse.Data; @@ -636,7 +647,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Task of ApiResponse (Order) - public async System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long? orderId) + public async System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId) { // verify the required parameter 'orderId' is set if (orderId == null) @@ -681,7 +692,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (Order) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); } @@ -689,11 +700,11 @@ namespace Org.OpenAPITools.Api /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Order - public Order PlaceOrder (Order order) + public Order PlaceOrder (Order body) { - ApiResponse localVarResponse = PlaceOrderWithHttpInfo(order); + ApiResponse localVarResponse = PlaceOrderWithHttpInfo(body); return localVarResponse.Data; } @@ -701,13 +712,13 @@ namespace Org.OpenAPITools.Api /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// ApiResponse of Order - public ApiResponse< Order > PlaceOrderWithHttpInfo (Order order) + public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body) { - // verify the required parameter 'order' is set - if (order == null) - throw new ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder"); var localVarPath = "./store/order"; var localVarPathParams = new Dictionary(); @@ -731,13 +742,13 @@ namespace Org.OpenAPITools.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (order != null && order.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(order); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = order; // byte array + localVarPostBody = body; // byte array } @@ -755,7 +766,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (Order) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); } @@ -763,11 +774,11 @@ namespace Org.OpenAPITools.Api /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Task of Order - public async System.Threading.Tasks.Task PlaceOrderAsync (Order order) + public async System.Threading.Tasks.Task PlaceOrderAsync (Order body) { - ApiResponse localVarResponse = await PlaceOrderAsyncWithHttpInfo(order); + ApiResponse localVarResponse = await PlaceOrderAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -776,13 +787,13 @@ namespace Org.OpenAPITools.Api /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Task of ApiResponse (Order) - public async System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order order) + public async System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body) { - // verify the required parameter 'order' is set - if (order == null) - throw new ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder"); var localVarPath = "./store/order"; var localVarPathParams = new Dictionary(); @@ -806,13 +817,13 @@ namespace Org.OpenAPITools.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (order != null && order.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(order); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = order; // byte array + localVarPostBody = body; // byte array } @@ -830,7 +841,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (Order) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order))); } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/UserApi.cs index 3d32cf792a2..27a34b44a5c 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Api/UserApi.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -31,9 +31,9 @@ namespace Org.OpenAPITools.Api /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// - void CreateUser (User user); + void CreateUser (User body); /// /// Create user @@ -42,9 +42,9 @@ namespace Org.OpenAPITools.Api /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// ApiResponse of Object(void) - ApiResponse CreateUserWithHttpInfo (User user); + ApiResponse CreateUserWithHttpInfo (User body); /// /// Creates list of users with given input array /// @@ -52,9 +52,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// - void CreateUsersWithArrayInput (List user); + void CreateUsersWithArrayInput (List body); /// /// Creates list of users with given input array @@ -63,9 +63,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// ApiResponse of Object(void) - ApiResponse CreateUsersWithArrayInputWithHttpInfo (List user); + ApiResponse CreateUsersWithArrayInputWithHttpInfo (List body); /// /// Creates list of users with given input array /// @@ -73,9 +73,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// - void CreateUsersWithListInput (List user); + void CreateUsersWithListInput (List body); /// /// Creates list of users with given input array @@ -84,9 +84,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// ApiResponse of Object(void) - ApiResponse CreateUsersWithListInputWithHttpInfo (List user); + ApiResponse CreateUsersWithListInputWithHttpInfo (List body); /// /// Delete user /// @@ -179,9 +179,9 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// - void UpdateUser (string username, User user); + void UpdateUser (string username, User body); /// /// Updated user @@ -191,9 +191,9 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// ApiResponse of Object(void) - ApiResponse UpdateUserWithHttpInfo (string username, User user); + ApiResponse UpdateUserWithHttpInfo (string username, User body); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -203,9 +203,9 @@ namespace Org.OpenAPITools.Api /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// Task of void - System.Threading.Tasks.Task CreateUserAsync (User user); + System.Threading.Tasks.Task CreateUserAsync (User body); /// /// Create user @@ -214,9 +214,9 @@ namespace Org.OpenAPITools.Api /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User user); + System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body); /// /// Creates list of users with given input array /// @@ -224,9 +224,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of void - System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List user); + System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body); /// /// Creates list of users with given input array @@ -235,9 +235,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List user); + System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body); /// /// Creates list of users with given input array /// @@ -245,9 +245,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of void - System.Threading.Tasks.Task CreateUsersWithListInputAsync (List user); + System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body); /// /// Creates list of users with given input array @@ -256,9 +256,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List user); + System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body); /// /// Delete user /// @@ -351,9 +351,9 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// Task of void - System.Threading.Tasks.Task UpdateUserAsync (string username, User user); + System.Threading.Tasks.Task UpdateUserAsync (string username, User body); /// /// Updated user @@ -363,9 +363,9 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// Task of ApiResponse - System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User user); + System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body); #endregion Asynchronous Operations } @@ -387,6 +387,17 @@ namespace Org.OpenAPITools.Api ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; } + /// + /// Initializes a new instance of the class + /// + /// + public UserApi() + { + this.Configuration = Org.OpenAPITools.Client.Configuration.Default; + + ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory; + } + /// /// Initializes a new instance of the class /// using Configuration object @@ -470,24 +481,24 @@ namespace Org.OpenAPITools.Api /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// - public void CreateUser (User user) + public void CreateUser (User body) { - CreateUserWithHttpInfo(user); + CreateUserWithHttpInfo(body); } /// /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// ApiResponse of Object(void) - public ApiResponse CreateUserWithHttpInfo (User user) + public ApiResponse CreateUserWithHttpInfo (User body) { - // verify the required parameter 'user' is set - if (user == null) - throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUser"); var localVarPath = "./user"; var localVarPathParams = new Dictionary(); @@ -509,13 +520,13 @@ namespace Org.OpenAPITools.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (user != null && user.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = user; // byte array + localVarPostBody = body; // byte array } @@ -533,7 +544,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -541,11 +552,11 @@ namespace Org.OpenAPITools.Api /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// Task of void - public async System.Threading.Tasks.Task CreateUserAsync (User user) + public async System.Threading.Tasks.Task CreateUserAsync (User body) { - await CreateUserAsyncWithHttpInfo(user); + await CreateUserAsyncWithHttpInfo(body); } @@ -553,13 +564,13 @@ namespace Org.OpenAPITools.Api /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User user) + public async System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body) { - // verify the required parameter 'user' is set - if (user == null) - throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUser"); var localVarPath = "./user"; var localVarPathParams = new Dictionary(); @@ -581,13 +592,13 @@ namespace Org.OpenAPITools.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (user != null && user.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = user; // byte array + localVarPostBody = body; // byte array } @@ -605,7 +616,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -613,24 +624,24 @@ namespace Org.OpenAPITools.Api /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// - public void CreateUsersWithArrayInput (List user) + public void CreateUsersWithArrayInput (List body) { - CreateUsersWithArrayInputWithHttpInfo(user); + CreateUsersWithArrayInputWithHttpInfo(body); } /// /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// ApiResponse of Object(void) - public ApiResponse CreateUsersWithArrayInputWithHttpInfo (List user) + public ApiResponse CreateUsersWithArrayInputWithHttpInfo (List body) { - // verify the required parameter 'user' is set - if (user == null) - throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput"); var localVarPath = "./user/createWithArray"; var localVarPathParams = new Dictionary(); @@ -652,13 +663,13 @@ namespace Org.OpenAPITools.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (user != null && user.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = user; // byte array + localVarPostBody = body; // byte array } @@ -676,7 +687,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -684,11 +695,11 @@ namespace Org.OpenAPITools.Api /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of void - public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List user) + public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body) { - await CreateUsersWithArrayInputAsyncWithHttpInfo(user); + await CreateUsersWithArrayInputAsyncWithHttpInfo(body); } @@ -696,13 +707,13 @@ namespace Org.OpenAPITools.Api /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List user) + public async System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body) { - // verify the required parameter 'user' is set - if (user == null) - throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput"); var localVarPath = "./user/createWithArray"; var localVarPathParams = new Dictionary(); @@ -724,13 +735,13 @@ namespace Org.OpenAPITools.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (user != null && user.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = user; // byte array + localVarPostBody = body; // byte array } @@ -748,7 +759,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -756,24 +767,24 @@ namespace Org.OpenAPITools.Api /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// - public void CreateUsersWithListInput (List user) + public void CreateUsersWithListInput (List body) { - CreateUsersWithListInputWithHttpInfo(user); + CreateUsersWithListInputWithHttpInfo(body); } /// /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// ApiResponse of Object(void) - public ApiResponse CreateUsersWithListInputWithHttpInfo (List user) + public ApiResponse CreateUsersWithListInputWithHttpInfo (List body) { - // verify the required parameter 'user' is set - if (user == null) - throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput"); var localVarPath = "./user/createWithList"; var localVarPathParams = new Dictionary(); @@ -795,13 +806,13 @@ namespace Org.OpenAPITools.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (user != null && user.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = user; // byte array + localVarPostBody = body; // byte array } @@ -819,7 +830,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -827,11 +838,11 @@ namespace Org.OpenAPITools.Api /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of void - public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List user) + public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body) { - await CreateUsersWithListInputAsyncWithHttpInfo(user); + await CreateUsersWithListInputAsyncWithHttpInfo(body); } @@ -839,13 +850,13 @@ namespace Org.OpenAPITools.Api /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List user) + public async System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body) { - // verify the required parameter 'user' is set - if (user == null) - throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput"); var localVarPath = "./user/createWithList"; var localVarPathParams = new Dictionary(); @@ -867,13 +878,13 @@ namespace Org.OpenAPITools.Api if (localVarHttpHeaderAccept != null) localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); - if (user != null && user.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = user; // byte array + localVarPostBody = body; // byte array } @@ -891,7 +902,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -955,7 +966,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1020,7 +1031,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1087,7 +1098,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (User) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(User))); } @@ -1155,7 +1166,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (User) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(User))); } @@ -1228,7 +1239,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (string) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); } @@ -1302,7 +1313,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (string) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); } @@ -1360,7 +1371,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1419,7 +1430,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1428,11 +1439,11 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// - public void UpdateUser (string username, User user) + public void UpdateUser (string username, User body) { - UpdateUserWithHttpInfo(username, user); + UpdateUserWithHttpInfo(username, body); } /// @@ -1440,16 +1451,16 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// ApiResponse of Object(void) - public ApiResponse UpdateUserWithHttpInfo (string username, User user) + public ApiResponse UpdateUserWithHttpInfo (string username, User body) { // verify the required parameter 'username' is set if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); - // verify the required parameter 'user' is set - if (user == null) - throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->UpdateUser"); var localVarPath = "./user/{username}"; var localVarPathParams = new Dictionary(); @@ -1472,13 +1483,13 @@ namespace Org.OpenAPITools.Api localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); if (username != null) localVarPathParams.Add("username", this.Configuration.ApiClient.ParameterToString(username)); // path parameter - if (user != null && user.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = user; // byte array + localVarPostBody = body; // byte array } @@ -1496,7 +1507,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } @@ -1505,11 +1516,11 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// Task of void - public async System.Threading.Tasks.Task UpdateUserAsync (string username, User user) + public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body) { - await UpdateUserAsyncWithHttpInfo(username, user); + await UpdateUserAsyncWithHttpInfo(username, body); } @@ -1518,16 +1529,16 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User user) + public async System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body) { // verify the required parameter 'username' is set if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); - // verify the required parameter 'user' is set - if (user == null) - throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser"); + // verify the required parameter 'body' is set + if (body == null) + throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->UpdateUser"); var localVarPath = "./user/{username}"; var localVarPathParams = new Dictionary(); @@ -1550,13 +1561,13 @@ namespace Org.OpenAPITools.Api localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); if (username != null) localVarPathParams.Add("username", this.Configuration.ApiClient.ParameterToString(username)); // path parameter - if (user != null && user.GetType() != typeof(byte[])) + if (body != null && body.GetType() != typeof(byte[])) { - localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter + localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { - localVarPostBody = user; // byte array + localVarPostBody = body; // byte array } @@ -1574,7 +1585,7 @@ namespace Org.OpenAPITools.Api } return new ApiResponse(localVarStatusCode, - localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), + localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), null); } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiClient.cs index 9030e01174f..0311cd3aef5 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiClient.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiException.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiException.cs index 875026e65f4..e7ac15569b9 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiException.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiException.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiResponse.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiResponse.cs index 3e395de9dfb..4b462cf5424 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiResponse.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ApiResponse.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/Configuration.cs index fb26d766182..e10bf1c07e7 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/Configuration.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/Configuration.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -323,7 +323,7 @@ namespace Org.OpenAPITools.Client } /// - /// Gets or sets the the date time format used when serializing in the ApiClient + /// Gets or sets the date time format used when serializing in the ApiClient /// By default, it's set to ISO 8601 - "o", for others see: /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ExceptionFactory.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ExceptionFactory.cs index d5b663b3cbd..343ea7ae2b6 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ExceptionFactory.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/ExceptionFactory.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/GlobalConfiguration.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/GlobalConfiguration.cs index 309e385f25a..a79bea966bd 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/GlobalConfiguration.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/GlobalConfiguration.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/IApiAccessor.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/IApiAccessor.cs index bf20655ef19..df00c43800c 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/IApiAccessor.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/IApiAccessor.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/IReadableConfiguration.cs index 76a5f5124fd..23e1a0c2e19 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/IReadableConfiguration.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs index 4f5c219d5c6..a1bd6b08f3b 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesAnyType.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesAnyType.cs new file mode 100644 index 00000000000..0b66cfaa72a --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesAnyType.cs @@ -0,0 +1,113 @@ +/* + * 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://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// AdditionalPropertiesAnyType + /// + [DataContract] + public partial class AdditionalPropertiesAnyType : Dictionary, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public AdditionalPropertiesAnyType(string name = default(string)) : base() + { + this.Name = name; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AdditionalPropertiesAnyType {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AdditionalPropertiesAnyType); + } + + /// + /// Returns true if AdditionalPropertiesAnyType instances are equal + /// + /// Instance of AdditionalPropertiesAnyType to be compared + /// Boolean + public bool Equals(AdditionalPropertiesAnyType input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesArray.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesArray.cs new file mode 100644 index 00000000000..74e73ae5e69 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesArray.cs @@ -0,0 +1,113 @@ +/* + * 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://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// AdditionalPropertiesArray + /// + [DataContract] + public partial class AdditionalPropertiesArray : Dictionary, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public AdditionalPropertiesArray(string name = default(string)) : base() + { + this.Name = name; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AdditionalPropertiesArray {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AdditionalPropertiesArray); + } + + /// + /// Returns true if AdditionalPropertiesArray instances are equal + /// + /// Instance of AdditionalPropertiesArray to be compared + /// Boolean + public bool Equals(AdditionalPropertiesArray input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs new file mode 100644 index 00000000000..c52f36924d4 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs @@ -0,0 +1,113 @@ +/* + * 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://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// AdditionalPropertiesBoolean + /// + [DataContract] + public partial class AdditionalPropertiesBoolean : Dictionary, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public AdditionalPropertiesBoolean(string name = default(string)) : base() + { + this.Name = name; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AdditionalPropertiesBoolean {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AdditionalPropertiesBoolean); + } + + /// + /// Returns true if AdditionalPropertiesBoolean instances are equal + /// + /// Instance of AdditionalPropertiesBoolean to be compared + /// Boolean + public bool Equals(AdditionalPropertiesBoolean input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index b98ed7cef6a..f56db9cd165 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -31,25 +31,97 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// - /// mapProperty. - /// mapOfMapProperty. - public AdditionalPropertiesClass(Dictionary mapProperty = default(Dictionary), Dictionary> mapOfMapProperty = default(Dictionary>)) + /// mapString. + /// mapNumber. + /// mapInteger. + /// mapBoolean. + /// mapArrayInteger. + /// mapArrayAnytype. + /// mapMapString. + /// mapMapAnytype. + /// anytype1. + /// anytype2. + /// anytype3. + public AdditionalPropertiesClass(Dictionary mapString = default(Dictionary), Dictionary mapNumber = default(Dictionary), Dictionary mapInteger = default(Dictionary), Dictionary mapBoolean = default(Dictionary), Dictionary> mapArrayInteger = default(Dictionary>), Dictionary> mapArrayAnytype = default(Dictionary>), Dictionary> mapMapString = default(Dictionary>), Dictionary> mapMapAnytype = default(Dictionary>), Object anytype1 = default(Object), Object anytype2 = default(Object), Object anytype3 = default(Object)) { - this.MapProperty = mapProperty; - this.MapOfMapProperty = mapOfMapProperty; + this.MapString = mapString; + this.MapNumber = mapNumber; + this.MapInteger = mapInteger; + this.MapBoolean = mapBoolean; + this.MapArrayInteger = mapArrayInteger; + this.MapArrayAnytype = mapArrayAnytype; + this.MapMapString = mapMapString; + this.MapMapAnytype = mapMapAnytype; + this.Anytype1 = anytype1; + this.Anytype2 = anytype2; + this.Anytype3 = anytype3; } /// - /// Gets or Sets MapProperty + /// Gets or Sets MapString /// - [DataMember(Name="map_property", EmitDefaultValue=false)] - public Dictionary MapProperty { get; set; } + [DataMember(Name="map_string", EmitDefaultValue=false)] + public Dictionary MapString { get; set; } /// - /// Gets or Sets MapOfMapProperty + /// Gets or Sets MapNumber /// - [DataMember(Name="map_of_map_property", EmitDefaultValue=false)] - public Dictionary> MapOfMapProperty { get; set; } + [DataMember(Name="map_number", EmitDefaultValue=false)] + public Dictionary MapNumber { get; set; } + + /// + /// Gets or Sets MapInteger + /// + [DataMember(Name="map_integer", EmitDefaultValue=false)] + public Dictionary MapInteger { get; set; } + + /// + /// Gets or Sets MapBoolean + /// + [DataMember(Name="map_boolean", EmitDefaultValue=false)] + public Dictionary MapBoolean { get; set; } + + /// + /// Gets or Sets MapArrayInteger + /// + [DataMember(Name="map_array_integer", EmitDefaultValue=false)] + public Dictionary> MapArrayInteger { get; set; } + + /// + /// Gets or Sets MapArrayAnytype + /// + [DataMember(Name="map_array_anytype", EmitDefaultValue=false)] + public Dictionary> MapArrayAnytype { get; set; } + + /// + /// Gets or Sets MapMapString + /// + [DataMember(Name="map_map_string", EmitDefaultValue=false)] + public Dictionary> MapMapString { get; set; } + + /// + /// Gets or Sets MapMapAnytype + /// + [DataMember(Name="map_map_anytype", EmitDefaultValue=false)] + public Dictionary> MapMapAnytype { get; set; } + + /// + /// Gets or Sets Anytype1 + /// + [DataMember(Name="anytype_1", EmitDefaultValue=false)] + public Object Anytype1 { get; set; } + + /// + /// Gets or Sets Anytype2 + /// + [DataMember(Name="anytype_2", EmitDefaultValue=false)] + public Object Anytype2 { get; set; } + + /// + /// Gets or Sets Anytype3 + /// + [DataMember(Name="anytype_3", EmitDefaultValue=false)] + public Object Anytype3 { get; set; } /// /// Returns the string presentation of the object @@ -59,8 +131,17 @@ namespace Org.OpenAPITools.Model { var sb = new StringBuilder(); sb.Append("class AdditionalPropertiesClass {\n"); - sb.Append(" MapProperty: ").Append(MapProperty).Append("\n"); - sb.Append(" MapOfMapProperty: ").Append(MapOfMapProperty).Append("\n"); + sb.Append(" MapString: ").Append(MapString).Append("\n"); + sb.Append(" MapNumber: ").Append(MapNumber).Append("\n"); + sb.Append(" MapInteger: ").Append(MapInteger).Append("\n"); + sb.Append(" MapBoolean: ").Append(MapBoolean).Append("\n"); + sb.Append(" MapArrayInteger: ").Append(MapArrayInteger).Append("\n"); + sb.Append(" MapArrayAnytype: ").Append(MapArrayAnytype).Append("\n"); + sb.Append(" MapMapString: ").Append(MapMapString).Append("\n"); + sb.Append(" MapMapAnytype: ").Append(MapMapAnytype).Append("\n"); + sb.Append(" Anytype1: ").Append(Anytype1).Append("\n"); + sb.Append(" Anytype2: ").Append(Anytype2).Append("\n"); + sb.Append(" Anytype3: ").Append(Anytype3).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -96,14 +177,67 @@ namespace Org.OpenAPITools.Model return ( - this.MapProperty == input.MapProperty || - this.MapProperty != null && - this.MapProperty.SequenceEqual(input.MapProperty) + this.MapString == input.MapString || + this.MapString != null && + input.MapString != null && + this.MapString.SequenceEqual(input.MapString) ) && ( - this.MapOfMapProperty == input.MapOfMapProperty || - this.MapOfMapProperty != null && - this.MapOfMapProperty.SequenceEqual(input.MapOfMapProperty) + this.MapNumber == input.MapNumber || + this.MapNumber != null && + input.MapNumber != null && + this.MapNumber.SequenceEqual(input.MapNumber) + ) && + ( + this.MapInteger == input.MapInteger || + this.MapInteger != null && + input.MapInteger != null && + this.MapInteger.SequenceEqual(input.MapInteger) + ) && + ( + this.MapBoolean == input.MapBoolean || + this.MapBoolean != null && + input.MapBoolean != null && + this.MapBoolean.SequenceEqual(input.MapBoolean) + ) && + ( + this.MapArrayInteger == input.MapArrayInteger || + this.MapArrayInteger != null && + input.MapArrayInteger != null && + this.MapArrayInteger.SequenceEqual(input.MapArrayInteger) + ) && + ( + this.MapArrayAnytype == input.MapArrayAnytype || + this.MapArrayAnytype != null && + input.MapArrayAnytype != null && + this.MapArrayAnytype.SequenceEqual(input.MapArrayAnytype) + ) && + ( + this.MapMapString == input.MapMapString || + this.MapMapString != null && + input.MapMapString != null && + this.MapMapString.SequenceEqual(input.MapMapString) + ) && + ( + this.MapMapAnytype == input.MapMapAnytype || + this.MapMapAnytype != null && + input.MapMapAnytype != null && + this.MapMapAnytype.SequenceEqual(input.MapMapAnytype) + ) && + ( + this.Anytype1 == input.Anytype1 || + (this.Anytype1 != null && + this.Anytype1.Equals(input.Anytype1)) + ) && + ( + this.Anytype2 == input.Anytype2 || + (this.Anytype2 != null && + this.Anytype2.Equals(input.Anytype2)) + ) && + ( + this.Anytype3 == input.Anytype3 || + (this.Anytype3 != null && + this.Anytype3.Equals(input.Anytype3)) ); } @@ -116,10 +250,28 @@ namespace Org.OpenAPITools.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; - if (this.MapProperty != null) - hashCode = hashCode * 59 + this.MapProperty.GetHashCode(); - if (this.MapOfMapProperty != null) - hashCode = hashCode * 59 + this.MapOfMapProperty.GetHashCode(); + if (this.MapString != null) + hashCode = hashCode * 59 + this.MapString.GetHashCode(); + if (this.MapNumber != null) + hashCode = hashCode * 59 + this.MapNumber.GetHashCode(); + if (this.MapInteger != null) + hashCode = hashCode * 59 + this.MapInteger.GetHashCode(); + if (this.MapBoolean != null) + hashCode = hashCode * 59 + this.MapBoolean.GetHashCode(); + if (this.MapArrayInteger != null) + hashCode = hashCode * 59 + this.MapArrayInteger.GetHashCode(); + if (this.MapArrayAnytype != null) + hashCode = hashCode * 59 + this.MapArrayAnytype.GetHashCode(); + if (this.MapMapString != null) + hashCode = hashCode * 59 + this.MapMapString.GetHashCode(); + if (this.MapMapAnytype != null) + hashCode = hashCode * 59 + this.MapMapAnytype.GetHashCode(); + if (this.Anytype1 != null) + hashCode = hashCode * 59 + this.Anytype1.GetHashCode(); + if (this.Anytype2 != null) + hashCode = hashCode * 59 + this.Anytype2.GetHashCode(); + if (this.Anytype3 != null) + hashCode = hashCode * 59 + this.Anytype3.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs new file mode 100644 index 00000000000..522847f7b16 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs @@ -0,0 +1,113 @@ +/* + * 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://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// AdditionalPropertiesInteger + /// + [DataContract] + public partial class AdditionalPropertiesInteger : Dictionary, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public AdditionalPropertiesInteger(string name = default(string)) : base() + { + this.Name = name; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AdditionalPropertiesInteger {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AdditionalPropertiesInteger); + } + + /// + /// Returns true if AdditionalPropertiesInteger instances are equal + /// + /// Instance of AdditionalPropertiesInteger to be compared + /// Boolean + public bool Equals(AdditionalPropertiesInteger input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs new file mode 100644 index 00000000000..cc739022c18 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs @@ -0,0 +1,113 @@ +/* + * 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://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// AdditionalPropertiesNumber + /// + [DataContract] + public partial class AdditionalPropertiesNumber : Dictionary, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public AdditionalPropertiesNumber(string name = default(string)) : base() + { + this.Name = name; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AdditionalPropertiesNumber {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AdditionalPropertiesNumber); + } + + /// + /// Returns true if AdditionalPropertiesNumber instances are equal + /// + /// Instance of AdditionalPropertiesNumber to be compared + /// Boolean + public bool Equals(AdditionalPropertiesNumber input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesObject.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesObject.cs new file mode 100644 index 00000000000..d5e694f3fdc --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesObject.cs @@ -0,0 +1,113 @@ +/* + * 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://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// AdditionalPropertiesObject + /// + [DataContract] + public partial class AdditionalPropertiesObject : Dictionary>, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public AdditionalPropertiesObject(string name = default(string)) : base() + { + this.Name = name; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AdditionalPropertiesObject {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AdditionalPropertiesObject); + } + + /// + /// Returns true if AdditionalPropertiesObject instances are equal + /// + /// Instance of AdditionalPropertiesObject to be compared + /// Boolean + public bool Equals(AdditionalPropertiesObject input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesString.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesString.cs new file mode 100644 index 00000000000..0c211e824d1 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/AdditionalPropertiesString.cs @@ -0,0 +1,113 @@ +/* + * 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://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// AdditionalPropertiesString + /// + [DataContract] + public partial class AdditionalPropertiesString : Dictionary, IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// name. + public AdditionalPropertiesString(string name = default(string)) : base() + { + this.Name = name; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name", EmitDefaultValue=false)] + public string Name { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class AdditionalPropertiesString {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as AdditionalPropertiesString); + } + + /// + /// Returns true if AdditionalPropertiesString instances are equal + /// + /// Instance of AdditionalPropertiesString to be compared + /// Boolean + public bool Equals(AdditionalPropertiesString input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.Name == input.Name || + (this.Name != null && + this.Name.Equals(input.Name)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Name != null) + hashCode = hashCode * 59 + this.Name.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Animal.cs index 4dac740d240..7f63524790a 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Animal.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -27,7 +27,7 @@ namespace Org.OpenAPITools.Model /// Animal /// [DataContract] - [JsonConverter(typeof(JsonSubtypes), "className")] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] [JsonSubtypes.KnownSubType(typeof(Dog), "Dog")] [JsonSubtypes.KnownSubType(typeof(Cat), "Cat")] public partial class Animal : IEquatable @@ -53,6 +53,7 @@ namespace Org.OpenAPITools.Model { this.ClassName = className; } + // use default value if no "color" provided if (color == null) { diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ApiResponse.cs index d50d0672123..108ca344e67 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -34,7 +34,7 @@ namespace Org.OpenAPITools.Model /// code. /// type. /// message. - public ApiResponse(int? code = default(int?), string type = default(string), string message = default(string)) + public ApiResponse(int code = default(int), string type = default(string), string message = default(string)) { this.Code = code; this.Type = type; @@ -45,7 +45,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Code /// [DataMember(Name="code", EmitDefaultValue=false)] - public int? Code { get; set; } + public int Code { get; set; } /// /// Gets or Sets Type diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 5473bd7b9b1..b95c1002b76 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -32,7 +32,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// arrayArrayNumber. - public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber = default(List>)) + public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber = default(List>)) { this.ArrayArrayNumber = arrayArrayNumber; } @@ -41,7 +41,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets ArrayArrayNumber /// [DataMember(Name="ArrayArrayNumber", EmitDefaultValue=false)] - public List> ArrayArrayNumber { get; set; } + public List> ArrayArrayNumber { get; set; } /// /// Returns the string presentation of the object @@ -89,6 +89,7 @@ namespace Org.OpenAPITools.Model ( this.ArrayArrayNumber == input.ArrayArrayNumber || this.ArrayArrayNumber != null && + input.ArrayArrayNumber != null && this.ArrayArrayNumber.SequenceEqual(input.ArrayArrayNumber) ); } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 22a5449658b..0b6c8afe9eb 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -32,7 +32,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// arrayNumber. - public ArrayOfNumberOnly(List arrayNumber = default(List)) + public ArrayOfNumberOnly(List arrayNumber = default(List)) { this.ArrayNumber = arrayNumber; } @@ -41,7 +41,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets ArrayNumber /// [DataMember(Name="ArrayNumber", EmitDefaultValue=false)] - public List ArrayNumber { get; set; } + public List ArrayNumber { get; set; } /// /// Returns the string presentation of the object @@ -89,6 +89,7 @@ namespace Org.OpenAPITools.Model ( this.ArrayNumber == input.ArrayNumber || this.ArrayNumber != null && + input.ArrayNumber != null && this.ArrayNumber.SequenceEqual(input.ArrayNumber) ); } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ArrayTest.cs index 9d7d5e9800b..ab309bde6b2 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -34,7 +34,7 @@ namespace Org.OpenAPITools.Model /// arrayOfString. /// arrayArrayOfInteger. /// arrayArrayOfModel. - public ArrayTest(List arrayOfString = default(List), List> arrayArrayOfInteger = default(List>), List> arrayArrayOfModel = default(List>)) + public ArrayTest(List arrayOfString = default(List), List> arrayArrayOfInteger = default(List>), List> arrayArrayOfModel = default(List>)) { this.ArrayOfString = arrayOfString; this.ArrayArrayOfInteger = arrayArrayOfInteger; @@ -51,7 +51,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets ArrayArrayOfInteger /// [DataMember(Name="array_array_of_integer", EmitDefaultValue=false)] - public List> ArrayArrayOfInteger { get; set; } + public List> ArrayArrayOfInteger { get; set; } /// /// Gets or Sets ArrayArrayOfModel @@ -107,16 +107,19 @@ namespace Org.OpenAPITools.Model ( this.ArrayOfString == input.ArrayOfString || this.ArrayOfString != null && + input.ArrayOfString != null && this.ArrayOfString.SequenceEqual(input.ArrayOfString) ) && ( this.ArrayArrayOfInteger == input.ArrayArrayOfInteger || this.ArrayArrayOfInteger != null && + input.ArrayArrayOfInteger != null && this.ArrayArrayOfInteger.SequenceEqual(input.ArrayArrayOfInteger) ) && ( this.ArrayArrayOfModel == input.ArrayArrayOfModel || this.ArrayArrayOfModel != null && + input.ArrayArrayOfModel != null && this.ArrayArrayOfModel.SequenceEqual(input.ArrayArrayOfModel) ); } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Capitalization.cs index bdb5ed77da3..ca01a9ea1dd 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Capitalization.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Cat.cs index c4a1704371d..9659342cda9 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Cat.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -37,7 +37,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// declawed. - public Cat(bool? declawed = default(bool?), string className = default(string), string color = "red") : base(className, color) + public Cat(bool declawed = default(bool), string className = default(string), string color = "red") : base(className, color) { this.Declawed = declawed; } @@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Declawed /// [DataMember(Name="declawed", EmitDefaultValue=false)] - public bool? Declawed { get; set; } + public bool Declawed { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/CatAllOf.cs new file mode 100644 index 00000000000..82278839b40 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -0,0 +1,112 @@ +/* + * 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://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// CatAllOf + /// + [DataContract] + public partial class CatAllOf : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// declawed. + public CatAllOf(bool declawed = default(bool)) + { + this.Declawed = declawed; + } + + /// + /// Gets or Sets Declawed + /// + [DataMember(Name="declawed", EmitDefaultValue=false)] + public bool Declawed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class CatAllOf {\n"); + sb.Append(" Declawed: ").Append(Declawed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as CatAllOf); + } + + /// + /// Returns true if CatAllOf instances are equal + /// + /// Instance of CatAllOf to be compared + /// Boolean + public bool Equals(CatAllOf input) + { + if (input == null) + return false; + + return + ( + this.Declawed == input.Declawed || + (this.Declawed != null && + this.Declawed.Equals(input.Declawed)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Declawed != null) + hashCode = hashCode * 59 + this.Declawed.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Category.cs index 22b8d54d9dc..845a5fba42f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Category.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -28,22 +28,36 @@ namespace Org.OpenAPITools.Model [DataContract] public partial class Category : IEquatable { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Category() { } /// /// Initializes a new instance of the class. /// /// id. - /// name. - public Category(long? id = default(long?), string name = default(string)) + /// name (required) (default to "default-name"). + public Category(long id = default(long), string name = "default-name") { + // to ensure "name" is required (not null) + if (name == null) + { + throw new InvalidDataException("name is a required property for Category and cannot be null"); + } + else + { + this.Name = name; + } + this.Id = id; - this.Name = name; } /// /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Name diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ClassModel.cs index 6ef81a1f05f..bf180e2fd3d 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ClassModel.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Dog.cs index 902c5ed92c3..503fe9a20ac 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Dog.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/DogAllOf.cs new file mode 100644 index 00000000000..d4d0ee3f470 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -0,0 +1,112 @@ +/* + * 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://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// DogAllOf + /// + [DataContract] + public partial class DogAllOf : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// breed. + public DogAllOf(string breed = default(string)) + { + this.Breed = breed; + } + + /// + /// Gets or Sets Breed + /// + [DataMember(Name="breed", EmitDefaultValue=false)] + public string Breed { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class DogAllOf {\n"); + sb.Append(" Breed: ").Append(Breed).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as DogAllOf); + } + + /// + /// Returns true if DogAllOf instances are equal + /// + /// Instance of DogAllOf to be compared + /// Boolean + public bool Equals(DogAllOf input) + { + if (input == null) + return false; + + return + ( + this.Breed == input.Breed || + (this.Breed != null && + this.Breed.Equals(input.Breed)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Breed != null) + hashCode = hashCode * 59 + this.Breed.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/EnumArrays.cs index 26c4194396d..4c0e96fd213 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -34,18 +34,18 @@ namespace Org.OpenAPITools.Model [JsonConverter(typeof(StringEnumConverter))] public enum JustSymbolEnum { - /// /// Enum GreaterThanOrEqualTo for value: >= /// [EnumMember(Value = ">=")] GreaterThanOrEqualTo = 1, - + /// /// Enum Dollar for value: $ /// [EnumMember(Value = "$")] Dollar = 2 + } /// @@ -59,18 +59,18 @@ namespace Org.OpenAPITools.Model [JsonConverter(typeof(StringEnumConverter))] public enum ArrayEnumEnum { - /// /// Enum Fish for value: fish /// [EnumMember(Value = "fish")] Fish = 1, - + /// /// Enum Crab for value: crab /// [EnumMember(Value = "crab")] Crab = 2 + } @@ -144,6 +144,7 @@ namespace Org.OpenAPITools.Model ( this.ArrayEnum == input.ArrayEnum || this.ArrayEnum != null && + input.ArrayEnum != null && this.ArrayEnum.SequenceEqual(input.ArrayEnum) ); } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/EnumClass.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/EnumClass.cs index 8065505fd74..3f26d632378 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/EnumClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/EnumClass.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -30,24 +30,24 @@ namespace Org.OpenAPITools.Model public enum EnumClass { - /// /// Enum Abc for value: _abc /// [EnumMember(Value = "_abc")] Abc = 1, - + /// /// Enum Efg for value: -efg /// [EnumMember(Value = "-efg")] Efg = 2, - + /// /// Enum Xyz for value: (xyz) /// [EnumMember(Value = "(xyz)")] Xyz = 3 + } } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/EnumTest.cs index d148da13222..8854d4e9610 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/EnumTest.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -34,24 +34,24 @@ namespace Org.OpenAPITools.Model [JsonConverter(typeof(StringEnumConverter))] public enum EnumStringEnum { - /// /// Enum UPPER for value: UPPER /// [EnumMember(Value = "UPPER")] UPPER = 1, - + /// /// Enum Lower for value: lower /// [EnumMember(Value = "lower")] Lower = 2, - + /// /// Enum Empty for value: /// [EnumMember(Value = "")] Empty = 3 + } /// @@ -65,24 +65,24 @@ namespace Org.OpenAPITools.Model [JsonConverter(typeof(StringEnumConverter))] public enum EnumStringRequiredEnum { - /// /// Enum UPPER for value: UPPER /// [EnumMember(Value = "UPPER")] UPPER = 1, - + /// /// Enum Lower for value: lower /// [EnumMember(Value = "lower")] Lower = 2, - + /// /// Enum Empty for value: /// [EnumMember(Value = "")] Empty = 3 + } /// @@ -95,18 +95,16 @@ namespace Org.OpenAPITools.Model /// public enum EnumIntegerEnum { - /// /// Enum NUMBER_1 for value: 1 /// - NUMBER_1 = 1, - + /// /// Enum NUMBER_MINUS_1 for value: -1 /// - NUMBER_MINUS_1 = -1 + } /// @@ -120,18 +118,18 @@ namespace Org.OpenAPITools.Model [JsonConverter(typeof(StringEnumConverter))] public enum EnumNumberEnum { - /// /// Enum NUMBER_1_DOT_1 for value: 1.1 /// [EnumMember(Value = "1.1")] NUMBER_1_DOT_1 = 1, - + /// /// Enum NUMBER_MINUS_1_DOT_2 for value: -1.2 /// [EnumMember(Value = "-1.2")] NUMBER_MINUS_1_DOT_2 = 2 + } /// @@ -157,7 +155,7 @@ namespace Org.OpenAPITools.Model /// enumInteger. /// enumNumber. /// outerEnum. - public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumStringRequiredEnum enumStringRequired = default(EnumStringRequiredEnum), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnum? outerEnum = default(OuterEnum?)) + public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumStringRequiredEnum enumStringRequired = default(EnumStringRequiredEnum), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnum outerEnum = default(OuterEnum)) { // to ensure "enumStringRequired" is required (not null) if (enumStringRequired == null) @@ -168,6 +166,7 @@ namespace Org.OpenAPITools.Model { this.EnumStringRequired = enumStringRequired; } + this.EnumString = enumString; this.EnumInteger = enumInteger; this.EnumNumber = enumNumber; diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/File.cs new file mode 100644 index 00000000000..8d182f792e8 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/File.cs @@ -0,0 +1,113 @@ +/* + * 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://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// Must be named `File` for test. + /// + [DataContract] + public partial class File : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// Test capitalization. + public File(string sourceURI = default(string)) + { + this.SourceURI = sourceURI; + } + + /// + /// Test capitalization + /// + /// Test capitalization + [DataMember(Name="sourceURI", EmitDefaultValue=false)] + public string SourceURI { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class File {\n"); + sb.Append(" SourceURI: ").Append(SourceURI).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as File); + } + + /// + /// Returns true if File instances are equal + /// + /// Instance of File to be compared + /// Boolean + public bool Equals(File input) + { + if (input == null) + return false; + + return + ( + this.SourceURI == input.SourceURI || + (this.SourceURI != null && + this.SourceURI.Equals(input.SourceURI)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.SourceURI != null) + hashCode = hashCode * 59 + this.SourceURI.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs new file mode 100644 index 00000000000..06713e9cd8e --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -0,0 +1,129 @@ +/* + * 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://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// FileSchemaTestClass + /// + [DataContract] + public partial class FileSchemaTestClass : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// file. + /// files. + public FileSchemaTestClass(File file = default(File), List files = default(List)) + { + this.File = file; + this.Files = files; + } + + /// + /// Gets or Sets File + /// + [DataMember(Name="file", EmitDefaultValue=false)] + public File File { get; set; } + + /// + /// Gets or Sets Files + /// + [DataMember(Name="files", EmitDefaultValue=false)] + public List Files { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class FileSchemaTestClass {\n"); + sb.Append(" File: ").Append(File).Append("\n"); + sb.Append(" Files: ").Append(Files).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as FileSchemaTestClass); + } + + /// + /// Returns true if FileSchemaTestClass instances are equal + /// + /// Instance of FileSchemaTestClass to be compared + /// Boolean + public bool Equals(FileSchemaTestClass input) + { + if (input == null) + return false; + + return + ( + this.File == input.File || + (this.File != null && + this.File.Equals(input.File)) + ) && + ( + this.Files == input.Files || + this.Files != null && + input.Files != null && + this.Files.SequenceEqual(input.Files) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.File != null) + hashCode = hashCode * 59 + this.File.GetHashCode(); + if (this.Files != null) + hashCode = hashCode * 59 + this.Files.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/FormatTest.cs index 2122233225c..38e06b90271 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/FormatTest.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -49,7 +49,7 @@ namespace Org.OpenAPITools.Model /// dateTime. /// uuid. /// password (required). - public FormatTest(int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), decimal? number = default(decimal?), float? _float = default(float?), double? _double = default(double?), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), Guid? uuid = default(Guid?), string password = default(string)) + public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string)) { // to ensure "number" is required (not null) if (number == null) @@ -60,6 +60,7 @@ namespace Org.OpenAPITools.Model { this.Number = number; } + // to ensure "_byte" is required (not null) if (_byte == null) { @@ -69,6 +70,7 @@ namespace Org.OpenAPITools.Model { this.Byte = _byte; } + // to ensure "date" is required (not null) if (date == null) { @@ -78,6 +80,7 @@ namespace Org.OpenAPITools.Model { this.Date = date; } + // to ensure "password" is required (not null) if (password == null) { @@ -87,6 +90,7 @@ namespace Org.OpenAPITools.Model { this.Password = password; } + this.Integer = integer; this.Int32 = int32; this.Int64 = int64; @@ -102,37 +106,37 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Integer /// [DataMember(Name="integer", EmitDefaultValue=false)] - public int? Integer { get; set; } + public int Integer { get; set; } /// /// Gets or Sets Int32 /// [DataMember(Name="int32", EmitDefaultValue=false)] - public int? Int32 { get; set; } + public int Int32 { get; set; } /// /// Gets or Sets Int64 /// [DataMember(Name="int64", EmitDefaultValue=false)] - public long? Int64 { get; set; } + public long Int64 { get; set; } /// /// Gets or Sets Number /// [DataMember(Name="number", EmitDefaultValue=false)] - public decimal? Number { get; set; } + public decimal Number { get; set; } /// /// Gets or Sets Float /// [DataMember(Name="float", EmitDefaultValue=false)] - public float? Float { get; set; } + public float Float { get; set; } /// /// Gets or Sets Double /// [DataMember(Name="double", EmitDefaultValue=false)] - public double? Double { get; set; } + public double Double { get; set; } /// /// Gets or Sets String @@ -157,19 +161,19 @@ namespace Org.OpenAPITools.Model /// [DataMember(Name="date", EmitDefaultValue=false)] [JsonConverter(typeof(OpenAPIDateConverter))] - public DateTime? Date { get; set; } + public DateTime Date { get; set; } /// /// Gets or Sets DateTime /// [DataMember(Name="dateTime", EmitDefaultValue=false)] - public DateTime? DateTime { get; set; } + public DateTime DateTime { get; set; } /// /// Gets or Sets Uuid /// [DataMember(Name="uuid", EmitDefaultValue=false)] - public Guid? Uuid { get; set; } + public Guid Uuid { get; set; } /// /// Gets or Sets Password diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index 90add779814..d5afdb16cc7 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/List.cs index e1c67fa88e4..fd3153ee90b 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/List.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/MapTest.cs index 1ccbdba8adf..3c76047cfb6 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/MapTest.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -34,18 +34,18 @@ namespace Org.OpenAPITools.Model [JsonConverter(typeof(StringEnumConverter))] public enum InnerEnum { - /// /// Enum UPPER for value: UPPER /// [EnumMember(Value = "UPPER")] UPPER = 1, - + /// /// Enum Lower for value: lower /// [EnumMember(Value = "lower")] Lower = 2 + } @@ -59,10 +59,14 @@ namespace Org.OpenAPITools.Model /// /// mapMapOfString. /// mapOfEnumString. - public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary)) + /// directMap. + /// indirectMap. + public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary), Dictionary directMap = default(Dictionary), Dictionary indirectMap = default(Dictionary)) { this.MapMapOfString = mapMapOfString; this.MapOfEnumString = mapOfEnumString; + this.DirectMap = directMap; + this.IndirectMap = indirectMap; } /// @@ -72,6 +76,18 @@ namespace Org.OpenAPITools.Model public Dictionary> MapMapOfString { get; set; } + /// + /// Gets or Sets DirectMap + /// + [DataMember(Name="direct_map", EmitDefaultValue=false)] + public Dictionary DirectMap { get; set; } + + /// + /// Gets or Sets IndirectMap + /// + [DataMember(Name="indirect_map", EmitDefaultValue=false)] + public Dictionary IndirectMap { get; set; } + /// /// Returns the string presentation of the object /// @@ -82,6 +98,8 @@ namespace Org.OpenAPITools.Model sb.Append("class MapTest {\n"); sb.Append(" MapMapOfString: ").Append(MapMapOfString).Append("\n"); sb.Append(" MapOfEnumString: ").Append(MapOfEnumString).Append("\n"); + sb.Append(" DirectMap: ").Append(DirectMap).Append("\n"); + sb.Append(" IndirectMap: ").Append(IndirectMap).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -119,12 +137,26 @@ namespace Org.OpenAPITools.Model ( this.MapMapOfString == input.MapMapOfString || this.MapMapOfString != null && + input.MapMapOfString != null && this.MapMapOfString.SequenceEqual(input.MapMapOfString) ) && ( this.MapOfEnumString == input.MapOfEnumString || this.MapOfEnumString != null && + input.MapOfEnumString != null && this.MapOfEnumString.SequenceEqual(input.MapOfEnumString) + ) && + ( + this.DirectMap == input.DirectMap || + this.DirectMap != null && + input.DirectMap != null && + this.DirectMap.SequenceEqual(input.DirectMap) + ) && + ( + this.IndirectMap == input.IndirectMap || + this.IndirectMap != null && + input.IndirectMap != null && + this.IndirectMap.SequenceEqual(input.IndirectMap) ); } @@ -141,6 +173,10 @@ namespace Org.OpenAPITools.Model hashCode = hashCode * 59 + this.MapMapOfString.GetHashCode(); if (this.MapOfEnumString != null) hashCode = hashCode * 59 + this.MapOfEnumString.GetHashCode(); + if (this.DirectMap != null) + hashCode = hashCode * 59 + this.DirectMap.GetHashCode(); + if (this.IndirectMap != null) + hashCode = hashCode * 59 + this.IndirectMap.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 4293c876ecd..3ec46aea273 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -34,7 +34,7 @@ namespace Org.OpenAPITools.Model /// uuid. /// dateTime. /// map. - public MixedPropertiesAndAdditionalPropertiesClass(Guid? uuid = default(Guid?), DateTime? dateTime = default(DateTime?), Dictionary map = default(Dictionary)) + public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) { this.Uuid = uuid; this.DateTime = dateTime; @@ -45,13 +45,13 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Uuid /// [DataMember(Name="uuid", EmitDefaultValue=false)] - public Guid? Uuid { get; set; } + public Guid Uuid { get; set; } /// /// Gets or Sets DateTime /// [DataMember(Name="dateTime", EmitDefaultValue=false)] - public DateTime? DateTime { get; set; } + public DateTime DateTime { get; set; } /// /// Gets or Sets Map @@ -117,6 +117,7 @@ namespace Org.OpenAPITools.Model ( this.Map == input.Map || this.Map != null && + input.Map != null && this.Map.SequenceEqual(input.Map) ); } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Model200Response.cs index 97ab9e3a9e5..9b18e50452d 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Model200Response.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -33,7 +33,7 @@ namespace Org.OpenAPITools.Model /// /// name. /// _class. - public Model200Response(int? name = default(int?), string _class = default(string)) + public Model200Response(int name = default(int), string _class = default(string)) { this.Name = name; this.Class = _class; @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Name /// [DataMember(Name="name", EmitDefaultValue=false)] - public int? Name { get; set; } + public int Name { get; set; } /// /// Gets or Sets Class diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ModelClient.cs index e08521dd8e9..8636e753b29 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ModelClient.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Name.cs index 3b304b8db0e..fa62132db17 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Name.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -38,7 +38,7 @@ namespace Org.OpenAPITools.Model /// /// name (required). /// property. - public Name(int? name = default(int?), string property = default(string)) + public Name(int name = default(int), string property = default(string)) { // to ensure "name" is required (not null) if (name == null) @@ -49,6 +49,7 @@ namespace Org.OpenAPITools.Model { this._Name = name; } + this.Property = property; } @@ -56,13 +57,13 @@ namespace Org.OpenAPITools.Model /// Gets or Sets _Name /// [DataMember(Name="name", EmitDefaultValue=false)] - public int? _Name { get; set; } + public int _Name { get; set; } /// /// Gets or Sets SnakeCase /// [DataMember(Name="snake_case", EmitDefaultValue=false)] - public int? SnakeCase { get; private set; } + public int SnakeCase { get; private set; } /// /// Gets or Sets Property @@ -74,7 +75,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets _123Number /// [DataMember(Name="123Number", EmitDefaultValue=false)] - public int? _123Number { get; private set; } + public int _123Number { get; private set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/NumberOnly.cs index 4890d031a32..a9d51b7970e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -32,7 +32,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// justNumber. - public NumberOnly(decimal? justNumber = default(decimal?)) + public NumberOnly(decimal justNumber = default(decimal)) { this.JustNumber = justNumber; } @@ -41,7 +41,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets JustNumber /// [DataMember(Name="JustNumber", EmitDefaultValue=false)] - public decimal? JustNumber { get; set; } + public decimal JustNumber { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Order.cs index ef1160318b2..18736e60d77 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Order.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -35,24 +35,24 @@ namespace Org.OpenAPITools.Model [JsonConverter(typeof(StringEnumConverter))] public enum StatusEnum { - /// /// Enum Placed for value: placed /// [EnumMember(Value = "placed")] Placed = 1, - + /// /// Enum Approved for value: approved /// [EnumMember(Value = "approved")] Approved = 2, - + /// /// Enum Delivered for value: delivered /// [EnumMember(Value = "delivered")] Delivered = 3 + } /// @@ -70,7 +70,7 @@ namespace Org.OpenAPITools.Model /// shipDate. /// Order Status. /// complete (default to false). - public Order(long? id = default(long?), long? petId = default(long?), int? quantity = default(int?), DateTime? shipDate = default(DateTime?), StatusEnum? status = default(StatusEnum?), bool? complete = false) + public Order(long id = default(long), long petId = default(long), int quantity = default(int), DateTime shipDate = default(DateTime), StatusEnum? status = default(StatusEnum?), bool complete = false) { this.Id = id; this.PetId = petId; @@ -92,32 +92,32 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets PetId /// [DataMember(Name="petId", EmitDefaultValue=false)] - public long? PetId { get; set; } + public long PetId { get; set; } /// /// Gets or Sets Quantity /// [DataMember(Name="quantity", EmitDefaultValue=false)] - public int? Quantity { get; set; } + public int Quantity { get; set; } /// /// Gets or Sets ShipDate /// [DataMember(Name="shipDate", EmitDefaultValue=false)] - public DateTime? ShipDate { get; set; } + public DateTime ShipDate { get; set; } /// /// Gets or Sets Complete /// [DataMember(Name="complete", EmitDefaultValue=false)] - public bool? Complete { get; set; } + public bool Complete { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/OuterComposite.cs index 794408b87dd..6b378405b74 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -34,7 +34,7 @@ namespace Org.OpenAPITools.Model /// myNumber. /// myString. /// myBoolean. - public OuterComposite(decimal? myNumber = default(decimal?), string myString = default(string), bool? myBoolean = default(bool?)) + public OuterComposite(decimal myNumber = default(decimal), string myString = default(string), bool myBoolean = default(bool)) { this.MyNumber = myNumber; this.MyString = myString; @@ -45,7 +45,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets MyNumber /// [DataMember(Name="my_number", EmitDefaultValue=false)] - public decimal? MyNumber { get; set; } + public decimal MyNumber { get; set; } /// /// Gets or Sets MyString @@ -57,7 +57,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets MyBoolean /// [DataMember(Name="my_boolean", EmitDefaultValue=false)] - public bool? MyBoolean { get; set; } + public bool MyBoolean { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/OuterEnum.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/OuterEnum.cs index e465b750cab..38f979216b7 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/OuterEnum.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/OuterEnum.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -30,24 +30,24 @@ namespace Org.OpenAPITools.Model public enum OuterEnum { - /// /// Enum Placed for value: placed /// [EnumMember(Value = "placed")] Placed = 1, - + /// /// Enum Approved for value: approved /// [EnumMember(Value = "approved")] Approved = 2, - + /// /// Enum Delivered for value: delivered /// [EnumMember(Value = "delivered")] Delivered = 3 + } } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Pet.cs index 446d6e7971b..3e1f5c228bc 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Pet.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -35,24 +35,24 @@ namespace Org.OpenAPITools.Model [JsonConverter(typeof(StringEnumConverter))] public enum StatusEnum { - /// /// Enum Available for value: available /// [EnumMember(Value = "available")] Available = 1, - + /// /// Enum Pending for value: pending /// [EnumMember(Value = "pending")] Pending = 2, - + /// /// Enum Sold for value: sold /// [EnumMember(Value = "sold")] Sold = 3 + } /// @@ -75,7 +75,7 @@ namespace Org.OpenAPITools.Model /// photoUrls (required). /// tags. /// pet status in the store. - public Pet(long? id = default(long?), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) + public Pet(long id = default(long), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) { // to ensure "name" is required (not null) if (name == null) @@ -86,6 +86,7 @@ namespace Org.OpenAPITools.Model { this.Name = name; } + // to ensure "photoUrls" is required (not null) if (photoUrls == null) { @@ -95,6 +96,7 @@ namespace Org.OpenAPITools.Model { this.PhotoUrls = photoUrls; } + this.Id = id; this.Category = category; this.Tags = tags; @@ -105,7 +107,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Category @@ -198,11 +200,13 @@ namespace Org.OpenAPITools.Model ( this.PhotoUrls == input.PhotoUrls || this.PhotoUrls != null && + input.PhotoUrls != null && this.PhotoUrls.SequenceEqual(input.PhotoUrls) ) && ( this.Tags == input.Tags || this.Tags != null && + input.Tags != null && this.Tags.SequenceEqual(input.Tags) ) && ( diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index a3b2f783aab..8b66e4f7dd2 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Return.cs index f40725403f2..3fac5a53eb7 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Return.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -32,7 +32,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// _return. - public Return(int? _return = default(int?)) + public Return(int _return = default(int)) { this._Return = _return; } @@ -41,7 +41,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets _Return /// [DataMember(Name="return", EmitDefaultValue=false)] - public int? _Return { get; set; } + public int _Return { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/SpecialModelName.cs index b105ce35938..e16b6bfc0e8 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -32,7 +32,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// specialPropertyName. - public SpecialModelName(long? specialPropertyName = default(long?)) + public SpecialModelName(long specialPropertyName = default(long)) { this.SpecialPropertyName = specialPropertyName; } @@ -41,7 +41,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets SpecialPropertyName /// [DataMember(Name="$special[property.name]", EmitDefaultValue=false)] - public long? SpecialPropertyName { get; set; } + public long SpecialPropertyName { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Tag.cs index 8de8009d394..f5017864dec 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/Tag.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -33,7 +33,7 @@ namespace Org.OpenAPITools.Model /// /// id. /// name. - public Tag(long? id = default(long?), string name = default(string)) + public Tag(long id = default(long), string name = default(string)) { this.Id = id; this.Name = name; @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Name diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/TypeHolderDefault.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/TypeHolderDefault.cs new file mode 100644 index 00000000000..93307c2324a --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/TypeHolderDefault.cs @@ -0,0 +1,227 @@ +/* + * 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://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// TypeHolderDefault + /// + [DataContract] + public partial class TypeHolderDefault : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected TypeHolderDefault() { } + /// + /// Initializes a new instance of the class. + /// + /// stringItem (required) (default to "what"). + /// numberItem (required). + /// integerItem (required). + /// boolItem (required) (default to true). + /// arrayItem (required). + public TypeHolderDefault(string stringItem = "what", decimal numberItem = default(decimal), int integerItem = default(int), bool boolItem = true, List arrayItem = default(List)) + { + // to ensure "stringItem" is required (not null) + if (stringItem == null) + { + throw new InvalidDataException("stringItem is a required property for TypeHolderDefault and cannot be null"); + } + else + { + this.StringItem = stringItem; + } + + // to ensure "numberItem" is required (not null) + if (numberItem == null) + { + throw new InvalidDataException("numberItem is a required property for TypeHolderDefault and cannot be null"); + } + else + { + this.NumberItem = numberItem; + } + + // to ensure "integerItem" is required (not null) + if (integerItem == null) + { + throw new InvalidDataException("integerItem is a required property for TypeHolderDefault and cannot be null"); + } + else + { + this.IntegerItem = integerItem; + } + + // to ensure "boolItem" is required (not null) + if (boolItem == null) + { + throw new InvalidDataException("boolItem is a required property for TypeHolderDefault and cannot be null"); + } + else + { + this.BoolItem = boolItem; + } + + // to ensure "arrayItem" is required (not null) + if (arrayItem == null) + { + throw new InvalidDataException("arrayItem is a required property for TypeHolderDefault and cannot be null"); + } + else + { + this.ArrayItem = arrayItem; + } + + } + + /// + /// Gets or Sets StringItem + /// + [DataMember(Name="string_item", EmitDefaultValue=false)] + public string StringItem { get; set; } + + /// + /// Gets or Sets NumberItem + /// + [DataMember(Name="number_item", EmitDefaultValue=false)] + public decimal NumberItem { get; set; } + + /// + /// Gets or Sets IntegerItem + /// + [DataMember(Name="integer_item", EmitDefaultValue=false)] + public int IntegerItem { get; set; } + + /// + /// Gets or Sets BoolItem + /// + [DataMember(Name="bool_item", EmitDefaultValue=false)] + public bool BoolItem { get; set; } + + /// + /// Gets or Sets ArrayItem + /// + [DataMember(Name="array_item", EmitDefaultValue=false)] + public List ArrayItem { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class TypeHolderDefault {\n"); + sb.Append(" StringItem: ").Append(StringItem).Append("\n"); + sb.Append(" NumberItem: ").Append(NumberItem).Append("\n"); + sb.Append(" IntegerItem: ").Append(IntegerItem).Append("\n"); + sb.Append(" BoolItem: ").Append(BoolItem).Append("\n"); + sb.Append(" ArrayItem: ").Append(ArrayItem).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as TypeHolderDefault); + } + + /// + /// Returns true if TypeHolderDefault instances are equal + /// + /// Instance of TypeHolderDefault to be compared + /// Boolean + public bool Equals(TypeHolderDefault input) + { + if (input == null) + return false; + + return + ( + this.StringItem == input.StringItem || + (this.StringItem != null && + this.StringItem.Equals(input.StringItem)) + ) && + ( + this.NumberItem == input.NumberItem || + (this.NumberItem != null && + this.NumberItem.Equals(input.NumberItem)) + ) && + ( + this.IntegerItem == input.IntegerItem || + (this.IntegerItem != null && + this.IntegerItem.Equals(input.IntegerItem)) + ) && + ( + this.BoolItem == input.BoolItem || + (this.BoolItem != null && + this.BoolItem.Equals(input.BoolItem)) + ) && + ( + this.ArrayItem == input.ArrayItem || + this.ArrayItem != null && + input.ArrayItem != null && + this.ArrayItem.SequenceEqual(input.ArrayItem) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.StringItem != null) + hashCode = hashCode * 59 + this.StringItem.GetHashCode(); + if (this.NumberItem != null) + hashCode = hashCode * 59 + this.NumberItem.GetHashCode(); + if (this.IntegerItem != null) + hashCode = hashCode * 59 + this.IntegerItem.GetHashCode(); + if (this.BoolItem != null) + hashCode = hashCode * 59 + this.BoolItem.GetHashCode(); + if (this.ArrayItem != null) + hashCode = hashCode * 59 + this.ArrayItem.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/TypeHolderExample.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/TypeHolderExample.cs new file mode 100644 index 00000000000..171fa8b99ff --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/TypeHolderExample.cs @@ -0,0 +1,227 @@ +/* + * 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://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// TypeHolderExample + /// + [DataContract] + public partial class TypeHolderExample : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected TypeHolderExample() { } + /// + /// Initializes a new instance of the class. + /// + /// stringItem (required). + /// numberItem (required). + /// integerItem (required). + /// boolItem (required). + /// arrayItem (required). + public TypeHolderExample(string stringItem = default(string), decimal numberItem = default(decimal), int integerItem = default(int), bool boolItem = default(bool), List arrayItem = default(List)) + { + // to ensure "stringItem" is required (not null) + if (stringItem == null) + { + throw new InvalidDataException("stringItem is a required property for TypeHolderExample and cannot be null"); + } + else + { + this.StringItem = stringItem; + } + + // to ensure "numberItem" is required (not null) + if (numberItem == null) + { + throw new InvalidDataException("numberItem is a required property for TypeHolderExample and cannot be null"); + } + else + { + this.NumberItem = numberItem; + } + + // to ensure "integerItem" is required (not null) + if (integerItem == null) + { + throw new InvalidDataException("integerItem is a required property for TypeHolderExample and cannot be null"); + } + else + { + this.IntegerItem = integerItem; + } + + // to ensure "boolItem" is required (not null) + if (boolItem == null) + { + throw new InvalidDataException("boolItem is a required property for TypeHolderExample and cannot be null"); + } + else + { + this.BoolItem = boolItem; + } + + // to ensure "arrayItem" is required (not null) + if (arrayItem == null) + { + throw new InvalidDataException("arrayItem is a required property for TypeHolderExample and cannot be null"); + } + else + { + this.ArrayItem = arrayItem; + } + + } + + /// + /// Gets or Sets StringItem + /// + [DataMember(Name="string_item", EmitDefaultValue=false)] + public string StringItem { get; set; } + + /// + /// Gets or Sets NumberItem + /// + [DataMember(Name="number_item", EmitDefaultValue=false)] + public decimal NumberItem { get; set; } + + /// + /// Gets or Sets IntegerItem + /// + [DataMember(Name="integer_item", EmitDefaultValue=false)] + public int IntegerItem { get; set; } + + /// + /// Gets or Sets BoolItem + /// + [DataMember(Name="bool_item", EmitDefaultValue=false)] + public bool BoolItem { get; set; } + + /// + /// Gets or Sets ArrayItem + /// + [DataMember(Name="array_item", EmitDefaultValue=false)] + public List ArrayItem { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class TypeHolderExample {\n"); + sb.Append(" StringItem: ").Append(StringItem).Append("\n"); + sb.Append(" NumberItem: ").Append(NumberItem).Append("\n"); + sb.Append(" IntegerItem: ").Append(IntegerItem).Append("\n"); + sb.Append(" BoolItem: ").Append(BoolItem).Append("\n"); + sb.Append(" ArrayItem: ").Append(ArrayItem).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as TypeHolderExample); + } + + /// + /// Returns true if TypeHolderExample instances are equal + /// + /// Instance of TypeHolderExample to be compared + /// Boolean + public bool Equals(TypeHolderExample input) + { + if (input == null) + return false; + + return + ( + this.StringItem == input.StringItem || + (this.StringItem != null && + this.StringItem.Equals(input.StringItem)) + ) && + ( + this.NumberItem == input.NumberItem || + (this.NumberItem != null && + this.NumberItem.Equals(input.NumberItem)) + ) && + ( + this.IntegerItem == input.IntegerItem || + (this.IntegerItem != null && + this.IntegerItem.Equals(input.IntegerItem)) + ) && + ( + this.BoolItem == input.BoolItem || + (this.BoolItem != null && + this.BoolItem.Equals(input.BoolItem)) + ) && + ( + this.ArrayItem == input.ArrayItem || + this.ArrayItem != null && + input.ArrayItem != null && + this.ArrayItem.SequenceEqual(input.ArrayItem) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.StringItem != null) + hashCode = hashCode * 59 + this.StringItem.GetHashCode(); + if (this.NumberItem != null) + hashCode = hashCode * 59 + this.NumberItem.GetHashCode(); + if (this.IntegerItem != null) + hashCode = hashCode * 59 + this.IntegerItem.GetHashCode(); + if (this.BoolItem != null) + hashCode = hashCode * 59 + this.BoolItem.GetHashCode(); + if (this.ArrayItem != null) + hashCode = hashCode * 59 + this.ArrayItem.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/User.cs index 3e680bc8642..7d119882806 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/User.cs @@ -3,7 +3,7 @@ * * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -39,7 +39,7 @@ namespace Org.OpenAPITools.Model /// password. /// phone. /// User Status. - public User(long? id = default(long?), string username = default(string), string firstName = default(string), string lastName = default(string), string email = default(string), string password = default(string), string phone = default(string), int? userStatus = default(int?)) + public User(long id = default(long), string username = default(string), string firstName = default(string), string lastName = default(string), string email = default(string), string password = default(string), string phone = default(string), int userStatus = default(int)) { this.Id = id; this.Username = username; @@ -55,7 +55,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Username @@ -98,7 +98,7 @@ namespace Org.OpenAPITools.Model /// /// User Status [DataMember(Name="userStatus", EmitDefaultValue=false)] - public int? UserStatus { get; set; } + public int UserStatus { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/XmlItem.cs b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/XmlItem.cs new file mode 100644 index 00000000000..280eedb3ad0 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetCoreProject/src/Org.OpenAPITools/Model/XmlItem.cs @@ -0,0 +1,569 @@ +/* + * 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://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// XmlItem + /// + [DataContract] + public partial class XmlItem : IEquatable + { + /// + /// Initializes a new instance of the class. + /// + /// attributeString. + /// attributeNumber. + /// attributeInteger. + /// attributeBoolean. + /// wrappedArray. + /// nameString. + /// nameNumber. + /// nameInteger. + /// nameBoolean. + /// nameArray. + /// nameWrappedArray. + /// prefixString. + /// prefixNumber. + /// prefixInteger. + /// prefixBoolean. + /// prefixArray. + /// prefixWrappedArray. + /// namespaceString. + /// namespaceNumber. + /// namespaceInteger. + /// namespaceBoolean. + /// namespaceArray. + /// namespaceWrappedArray. + /// prefixNsString. + /// prefixNsNumber. + /// prefixNsInteger. + /// prefixNsBoolean. + /// prefixNsArray. + /// prefixNsWrappedArray. + public XmlItem(string attributeString = default(string), decimal attributeNumber = default(decimal), int attributeInteger = default(int), bool attributeBoolean = default(bool), List wrappedArray = default(List), string nameString = default(string), decimal nameNumber = default(decimal), int nameInteger = default(int), bool nameBoolean = default(bool), List nameArray = default(List), List nameWrappedArray = default(List), string prefixString = default(string), decimal prefixNumber = default(decimal), int prefixInteger = default(int), bool prefixBoolean = default(bool), List prefixArray = default(List), List prefixWrappedArray = default(List), string namespaceString = default(string), decimal namespaceNumber = default(decimal), int namespaceInteger = default(int), bool namespaceBoolean = default(bool), List namespaceArray = default(List), List namespaceWrappedArray = default(List), string prefixNsString = default(string), decimal prefixNsNumber = default(decimal), int prefixNsInteger = default(int), bool prefixNsBoolean = default(bool), List prefixNsArray = default(List), List prefixNsWrappedArray = default(List)) + { + this.AttributeString = attributeString; + this.AttributeNumber = attributeNumber; + this.AttributeInteger = attributeInteger; + this.AttributeBoolean = attributeBoolean; + this.WrappedArray = wrappedArray; + this.NameString = nameString; + this.NameNumber = nameNumber; + this.NameInteger = nameInteger; + this.NameBoolean = nameBoolean; + this.NameArray = nameArray; + this.NameWrappedArray = nameWrappedArray; + this.PrefixString = prefixString; + this.PrefixNumber = prefixNumber; + this.PrefixInteger = prefixInteger; + this.PrefixBoolean = prefixBoolean; + this.PrefixArray = prefixArray; + this.PrefixWrappedArray = prefixWrappedArray; + this.NamespaceString = namespaceString; + this.NamespaceNumber = namespaceNumber; + this.NamespaceInteger = namespaceInteger; + this.NamespaceBoolean = namespaceBoolean; + this.NamespaceArray = namespaceArray; + this.NamespaceWrappedArray = namespaceWrappedArray; + this.PrefixNsString = prefixNsString; + this.PrefixNsNumber = prefixNsNumber; + this.PrefixNsInteger = prefixNsInteger; + this.PrefixNsBoolean = prefixNsBoolean; + this.PrefixNsArray = prefixNsArray; + this.PrefixNsWrappedArray = prefixNsWrappedArray; + } + + /// + /// Gets or Sets AttributeString + /// + [DataMember(Name="attribute_string", EmitDefaultValue=false)] + public string AttributeString { get; set; } + + /// + /// Gets or Sets AttributeNumber + /// + [DataMember(Name="attribute_number", EmitDefaultValue=false)] + public decimal AttributeNumber { get; set; } + + /// + /// Gets or Sets AttributeInteger + /// + [DataMember(Name="attribute_integer", EmitDefaultValue=false)] + public int AttributeInteger { get; set; } + + /// + /// Gets or Sets AttributeBoolean + /// + [DataMember(Name="attribute_boolean", EmitDefaultValue=false)] + public bool AttributeBoolean { get; set; } + + /// + /// Gets or Sets WrappedArray + /// + [DataMember(Name="wrapped_array", EmitDefaultValue=false)] + public List WrappedArray { get; set; } + + /// + /// Gets or Sets NameString + /// + [DataMember(Name="name_string", EmitDefaultValue=false)] + public string NameString { get; set; } + + /// + /// Gets or Sets NameNumber + /// + [DataMember(Name="name_number", EmitDefaultValue=false)] + public decimal NameNumber { get; set; } + + /// + /// Gets or Sets NameInteger + /// + [DataMember(Name="name_integer", EmitDefaultValue=false)] + public int NameInteger { get; set; } + + /// + /// Gets or Sets NameBoolean + /// + [DataMember(Name="name_boolean", EmitDefaultValue=false)] + public bool NameBoolean { get; set; } + + /// + /// Gets or Sets NameArray + /// + [DataMember(Name="name_array", EmitDefaultValue=false)] + public List NameArray { get; set; } + + /// + /// Gets or Sets NameWrappedArray + /// + [DataMember(Name="name_wrapped_array", EmitDefaultValue=false)] + public List NameWrappedArray { get; set; } + + /// + /// Gets or Sets PrefixString + /// + [DataMember(Name="prefix_string", EmitDefaultValue=false)] + public string PrefixString { get; set; } + + /// + /// Gets or Sets PrefixNumber + /// + [DataMember(Name="prefix_number", EmitDefaultValue=false)] + public decimal PrefixNumber { get; set; } + + /// + /// Gets or Sets PrefixInteger + /// + [DataMember(Name="prefix_integer", EmitDefaultValue=false)] + public int PrefixInteger { get; set; } + + /// + /// Gets or Sets PrefixBoolean + /// + [DataMember(Name="prefix_boolean", EmitDefaultValue=false)] + public bool PrefixBoolean { get; set; } + + /// + /// Gets or Sets PrefixArray + /// + [DataMember(Name="prefix_array", EmitDefaultValue=false)] + public List PrefixArray { get; set; } + + /// + /// Gets or Sets PrefixWrappedArray + /// + [DataMember(Name="prefix_wrapped_array", EmitDefaultValue=false)] + public List PrefixWrappedArray { get; set; } + + /// + /// Gets or Sets NamespaceString + /// + [DataMember(Name="namespace_string", EmitDefaultValue=false)] + public string NamespaceString { get; set; } + + /// + /// Gets or Sets NamespaceNumber + /// + [DataMember(Name="namespace_number", EmitDefaultValue=false)] + public decimal NamespaceNumber { get; set; } + + /// + /// Gets or Sets NamespaceInteger + /// + [DataMember(Name="namespace_integer", EmitDefaultValue=false)] + public int NamespaceInteger { get; set; } + + /// + /// Gets or Sets NamespaceBoolean + /// + [DataMember(Name="namespace_boolean", EmitDefaultValue=false)] + public bool NamespaceBoolean { get; set; } + + /// + /// Gets or Sets NamespaceArray + /// + [DataMember(Name="namespace_array", EmitDefaultValue=false)] + public List NamespaceArray { get; set; } + + /// + /// Gets or Sets NamespaceWrappedArray + /// + [DataMember(Name="namespace_wrapped_array", EmitDefaultValue=false)] + public List NamespaceWrappedArray { get; set; } + + /// + /// Gets or Sets PrefixNsString + /// + [DataMember(Name="prefix_ns_string", EmitDefaultValue=false)] + public string PrefixNsString { get; set; } + + /// + /// Gets or Sets PrefixNsNumber + /// + [DataMember(Name="prefix_ns_number", EmitDefaultValue=false)] + public decimal PrefixNsNumber { get; set; } + + /// + /// Gets or Sets PrefixNsInteger + /// + [DataMember(Name="prefix_ns_integer", EmitDefaultValue=false)] + public int PrefixNsInteger { get; set; } + + /// + /// Gets or Sets PrefixNsBoolean + /// + [DataMember(Name="prefix_ns_boolean", EmitDefaultValue=false)] + public bool PrefixNsBoolean { get; set; } + + /// + /// Gets or Sets PrefixNsArray + /// + [DataMember(Name="prefix_ns_array", EmitDefaultValue=false)] + public List PrefixNsArray { get; set; } + + /// + /// Gets or Sets PrefixNsWrappedArray + /// + [DataMember(Name="prefix_ns_wrapped_array", EmitDefaultValue=false)] + public List PrefixNsWrappedArray { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class XmlItem {\n"); + sb.Append(" AttributeString: ").Append(AttributeString).Append("\n"); + sb.Append(" AttributeNumber: ").Append(AttributeNumber).Append("\n"); + sb.Append(" AttributeInteger: ").Append(AttributeInteger).Append("\n"); + sb.Append(" AttributeBoolean: ").Append(AttributeBoolean).Append("\n"); + sb.Append(" WrappedArray: ").Append(WrappedArray).Append("\n"); + sb.Append(" NameString: ").Append(NameString).Append("\n"); + sb.Append(" NameNumber: ").Append(NameNumber).Append("\n"); + sb.Append(" NameInteger: ").Append(NameInteger).Append("\n"); + sb.Append(" NameBoolean: ").Append(NameBoolean).Append("\n"); + sb.Append(" NameArray: ").Append(NameArray).Append("\n"); + sb.Append(" NameWrappedArray: ").Append(NameWrappedArray).Append("\n"); + sb.Append(" PrefixString: ").Append(PrefixString).Append("\n"); + sb.Append(" PrefixNumber: ").Append(PrefixNumber).Append("\n"); + sb.Append(" PrefixInteger: ").Append(PrefixInteger).Append("\n"); + sb.Append(" PrefixBoolean: ").Append(PrefixBoolean).Append("\n"); + sb.Append(" PrefixArray: ").Append(PrefixArray).Append("\n"); + sb.Append(" PrefixWrappedArray: ").Append(PrefixWrappedArray).Append("\n"); + sb.Append(" NamespaceString: ").Append(NamespaceString).Append("\n"); + sb.Append(" NamespaceNumber: ").Append(NamespaceNumber).Append("\n"); + sb.Append(" NamespaceInteger: ").Append(NamespaceInteger).Append("\n"); + sb.Append(" NamespaceBoolean: ").Append(NamespaceBoolean).Append("\n"); + sb.Append(" NamespaceArray: ").Append(NamespaceArray).Append("\n"); + sb.Append(" NamespaceWrappedArray: ").Append(NamespaceWrappedArray).Append("\n"); + sb.Append(" PrefixNsString: ").Append(PrefixNsString).Append("\n"); + sb.Append(" PrefixNsNumber: ").Append(PrefixNsNumber).Append("\n"); + sb.Append(" PrefixNsInteger: ").Append(PrefixNsInteger).Append("\n"); + sb.Append(" PrefixNsBoolean: ").Append(PrefixNsBoolean).Append("\n"); + sb.Append(" PrefixNsArray: ").Append(PrefixNsArray).Append("\n"); + sb.Append(" PrefixNsWrappedArray: ").Append(PrefixNsWrappedArray).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as XmlItem); + } + + /// + /// Returns true if XmlItem instances are equal + /// + /// Instance of XmlItem to be compared + /// Boolean + public bool Equals(XmlItem input) + { + if (input == null) + return false; + + return + ( + this.AttributeString == input.AttributeString || + (this.AttributeString != null && + this.AttributeString.Equals(input.AttributeString)) + ) && + ( + this.AttributeNumber == input.AttributeNumber || + (this.AttributeNumber != null && + this.AttributeNumber.Equals(input.AttributeNumber)) + ) && + ( + this.AttributeInteger == input.AttributeInteger || + (this.AttributeInteger != null && + this.AttributeInteger.Equals(input.AttributeInteger)) + ) && + ( + this.AttributeBoolean == input.AttributeBoolean || + (this.AttributeBoolean != null && + this.AttributeBoolean.Equals(input.AttributeBoolean)) + ) && + ( + this.WrappedArray == input.WrappedArray || + this.WrappedArray != null && + input.WrappedArray != null && + this.WrappedArray.SequenceEqual(input.WrappedArray) + ) && + ( + this.NameString == input.NameString || + (this.NameString != null && + this.NameString.Equals(input.NameString)) + ) && + ( + this.NameNumber == input.NameNumber || + (this.NameNumber != null && + this.NameNumber.Equals(input.NameNumber)) + ) && + ( + this.NameInteger == input.NameInteger || + (this.NameInteger != null && + this.NameInteger.Equals(input.NameInteger)) + ) && + ( + this.NameBoolean == input.NameBoolean || + (this.NameBoolean != null && + this.NameBoolean.Equals(input.NameBoolean)) + ) && + ( + this.NameArray == input.NameArray || + this.NameArray != null && + input.NameArray != null && + this.NameArray.SequenceEqual(input.NameArray) + ) && + ( + this.NameWrappedArray == input.NameWrappedArray || + this.NameWrappedArray != null && + input.NameWrappedArray != null && + this.NameWrappedArray.SequenceEqual(input.NameWrappedArray) + ) && + ( + this.PrefixString == input.PrefixString || + (this.PrefixString != null && + this.PrefixString.Equals(input.PrefixString)) + ) && + ( + this.PrefixNumber == input.PrefixNumber || + (this.PrefixNumber != null && + this.PrefixNumber.Equals(input.PrefixNumber)) + ) && + ( + this.PrefixInteger == input.PrefixInteger || + (this.PrefixInteger != null && + this.PrefixInteger.Equals(input.PrefixInteger)) + ) && + ( + this.PrefixBoolean == input.PrefixBoolean || + (this.PrefixBoolean != null && + this.PrefixBoolean.Equals(input.PrefixBoolean)) + ) && + ( + this.PrefixArray == input.PrefixArray || + this.PrefixArray != null && + input.PrefixArray != null && + this.PrefixArray.SequenceEqual(input.PrefixArray) + ) && + ( + this.PrefixWrappedArray == input.PrefixWrappedArray || + this.PrefixWrappedArray != null && + input.PrefixWrappedArray != null && + this.PrefixWrappedArray.SequenceEqual(input.PrefixWrappedArray) + ) && + ( + this.NamespaceString == input.NamespaceString || + (this.NamespaceString != null && + this.NamespaceString.Equals(input.NamespaceString)) + ) && + ( + this.NamespaceNumber == input.NamespaceNumber || + (this.NamespaceNumber != null && + this.NamespaceNumber.Equals(input.NamespaceNumber)) + ) && + ( + this.NamespaceInteger == input.NamespaceInteger || + (this.NamespaceInteger != null && + this.NamespaceInteger.Equals(input.NamespaceInteger)) + ) && + ( + this.NamespaceBoolean == input.NamespaceBoolean || + (this.NamespaceBoolean != null && + this.NamespaceBoolean.Equals(input.NamespaceBoolean)) + ) && + ( + this.NamespaceArray == input.NamespaceArray || + this.NamespaceArray != null && + input.NamespaceArray != null && + this.NamespaceArray.SequenceEqual(input.NamespaceArray) + ) && + ( + this.NamespaceWrappedArray == input.NamespaceWrappedArray || + this.NamespaceWrappedArray != null && + input.NamespaceWrappedArray != null && + this.NamespaceWrappedArray.SequenceEqual(input.NamespaceWrappedArray) + ) && + ( + this.PrefixNsString == input.PrefixNsString || + (this.PrefixNsString != null && + this.PrefixNsString.Equals(input.PrefixNsString)) + ) && + ( + this.PrefixNsNumber == input.PrefixNsNumber || + (this.PrefixNsNumber != null && + this.PrefixNsNumber.Equals(input.PrefixNsNumber)) + ) && + ( + this.PrefixNsInteger == input.PrefixNsInteger || + (this.PrefixNsInteger != null && + this.PrefixNsInteger.Equals(input.PrefixNsInteger)) + ) && + ( + this.PrefixNsBoolean == input.PrefixNsBoolean || + (this.PrefixNsBoolean != null && + this.PrefixNsBoolean.Equals(input.PrefixNsBoolean)) + ) && + ( + this.PrefixNsArray == input.PrefixNsArray || + this.PrefixNsArray != null && + input.PrefixNsArray != null && + this.PrefixNsArray.SequenceEqual(input.PrefixNsArray) + ) && + ( + this.PrefixNsWrappedArray == input.PrefixNsWrappedArray || + this.PrefixNsWrappedArray != null && + input.PrefixNsWrappedArray != null && + this.PrefixNsWrappedArray.SequenceEqual(input.PrefixNsWrappedArray) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.AttributeString != null) + hashCode = hashCode * 59 + this.AttributeString.GetHashCode(); + if (this.AttributeNumber != null) + hashCode = hashCode * 59 + this.AttributeNumber.GetHashCode(); + if (this.AttributeInteger != null) + hashCode = hashCode * 59 + this.AttributeInteger.GetHashCode(); + if (this.AttributeBoolean != null) + hashCode = hashCode * 59 + this.AttributeBoolean.GetHashCode(); + if (this.WrappedArray != null) + hashCode = hashCode * 59 + this.WrappedArray.GetHashCode(); + if (this.NameString != null) + hashCode = hashCode * 59 + this.NameString.GetHashCode(); + if (this.NameNumber != null) + hashCode = hashCode * 59 + this.NameNumber.GetHashCode(); + if (this.NameInteger != null) + hashCode = hashCode * 59 + this.NameInteger.GetHashCode(); + if (this.NameBoolean != null) + hashCode = hashCode * 59 + this.NameBoolean.GetHashCode(); + if (this.NameArray != null) + hashCode = hashCode * 59 + this.NameArray.GetHashCode(); + if (this.NameWrappedArray != null) + hashCode = hashCode * 59 + this.NameWrappedArray.GetHashCode(); + if (this.PrefixString != null) + hashCode = hashCode * 59 + this.PrefixString.GetHashCode(); + if (this.PrefixNumber != null) + hashCode = hashCode * 59 + this.PrefixNumber.GetHashCode(); + if (this.PrefixInteger != null) + hashCode = hashCode * 59 + this.PrefixInteger.GetHashCode(); + if (this.PrefixBoolean != null) + hashCode = hashCode * 59 + this.PrefixBoolean.GetHashCode(); + if (this.PrefixArray != null) + hashCode = hashCode * 59 + this.PrefixArray.GetHashCode(); + if (this.PrefixWrappedArray != null) + hashCode = hashCode * 59 + this.PrefixWrappedArray.GetHashCode(); + if (this.NamespaceString != null) + hashCode = hashCode * 59 + this.NamespaceString.GetHashCode(); + if (this.NamespaceNumber != null) + hashCode = hashCode * 59 + this.NamespaceNumber.GetHashCode(); + if (this.NamespaceInteger != null) + hashCode = hashCode * 59 + this.NamespaceInteger.GetHashCode(); + if (this.NamespaceBoolean != null) + hashCode = hashCode * 59 + this.NamespaceBoolean.GetHashCode(); + if (this.NamespaceArray != null) + hashCode = hashCode * 59 + this.NamespaceArray.GetHashCode(); + if (this.NamespaceWrappedArray != null) + hashCode = hashCode * 59 + this.NamespaceWrappedArray.GetHashCode(); + if (this.PrefixNsString != null) + hashCode = hashCode * 59 + this.PrefixNsString.GetHashCode(); + if (this.PrefixNsNumber != null) + hashCode = hashCode * 59 + this.PrefixNsNumber.GetHashCode(); + if (this.PrefixNsInteger != null) + hashCode = hashCode * 59 + this.PrefixNsInteger.GetHashCode(); + if (this.PrefixNsBoolean != null) + hashCode = hashCode * 59 + this.PrefixNsBoolean.GetHashCode(); + if (this.PrefixNsArray != null) + hashCode = hashCode * 59 + this.PrefixNsArray.GetHashCode(); + if (this.PrefixNsWrappedArray != null) + hashCode = hashCode * 59 + this.PrefixNsWrappedArray.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientNetStandard/.openapi-generator/VERSION index 06b5019af3f..83a328a9227 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/README.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/README.md index b61a5400367..260c3df449a 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/README.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/README.md @@ -40,7 +40,7 @@ using Org.OpenAPITools.Model; ## Getting Started ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -50,10 +50,11 @@ namespace Example { public class Example { - public void main() + public static void Main() { - var apiInstance = new AnotherFakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(Configuration.Default); var body = new ModelClient(); // ModelClient | client model try @@ -62,9 +63,11 @@ namespace Example ModelClient result = apiInstance.Call123TestSpecialTags(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/AdditionalPropertiesClass.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/AdditionalPropertiesClass.md index 32d7ffc7653..d07f57619d5 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/AdditionalPropertiesClass.md @@ -6,10 +6,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **MapString** | **Dictionary<string, string>** | | [optional] -**MapNumber** | **Dictionary<string, decimal?>** | | [optional] -**MapInteger** | **Dictionary<string, int?>** | | [optional] -**MapBoolean** | **Dictionary<string, bool?>** | | [optional] -**MapArrayInteger** | **Dictionary<string, List<int?>>** | | [optional] +**MapNumber** | **Dictionary<string, decimal>** | | [optional] +**MapInteger** | **Dictionary<string, int>** | | [optional] +**MapBoolean** | **Dictionary<string, bool>** | | [optional] +**MapArrayInteger** | **Dictionary<string, List<int>>** | | [optional] **MapArrayAnytype** | **Dictionary<string, List<Object>>** | | [optional] **MapMapString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] **MapMapAnytype** | **Dictionary<string, Dictionary<string, Object>>** | | [optional] diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/AnotherFakeApi.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/AnotherFakeApi.md index d13566caf34..5af41a1862c 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/AnotherFakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/AnotherFakeApi.md @@ -19,7 +19,7 @@ To test special tags and operation ID starting with number ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -29,9 +29,10 @@ namespace Example { public class Call123TestSpecialTagsExample { - public void main() + public static void Main() { - var apiInstance = new AnotherFakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(Configuration.Default); var body = new ModelClient(); // ModelClient | client model try @@ -40,9 +41,11 @@ namespace Example ModelClient result = apiInstance.Call123TestSpecialTags(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -69,6 +72,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/ApiResponse.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/ApiResponse.md index e16dea75cc2..a3b916355fd 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/ApiResponse.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/ApiResponse.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Code** | **int?** | | [optional] +**Code** | **int** | | [optional] **Type** | **string** | | [optional] **Message** | **string** | | [optional] diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/ArrayOfArrayOfNumberOnly.md index 12616c6718b..e05ea7dc240 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/ArrayOfArrayOfNumberOnly.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ArrayArrayNumber** | **List<List<decimal?>>** | | [optional] +**ArrayArrayNumber** | **List<List<decimal>>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/ArrayOfNumberOnly.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/ArrayOfNumberOnly.md index 04facf7d5d1..5f593d42929 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/ArrayOfNumberOnly.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ArrayNumber** | **List<decimal?>** | | [optional] +**ArrayNumber** | **List<decimal>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/ArrayTest.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/ArrayTest.md index 9c297f062a9..593bc2d7386 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/ArrayTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/ArrayTest.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ArrayOfString** | **List<string>** | | [optional] -**ArrayArrayOfInteger** | **List<List<long?>>** | | [optional] +**ArrayArrayOfInteger** | **List<List<long>>** | | [optional] **ArrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Cat.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Cat.md index 4545a124369..6609de8e12a 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Cat.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Cat.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ClassName** | **string** | | **Color** | **string** | | [optional] [default to "red"] -**Declawed** | **bool?** | | [optional] +**Declawed** | **bool** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/CatAllOf.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/CatAllOf.md index 1a630760455..d623d2a0a6e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/CatAllOf.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/CatAllOf.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Declawed** | **bool?** | | [optional] +**Declawed** | **bool** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Category.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Category.md index 87ad855ca6f..42102d4e508 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Category.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Category.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Name** | **string** | | [default to "default-name"] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/EnumTest.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/EnumTest.md index 8e213c3335f..f8bc67baa6a 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/EnumTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/EnumTest.md @@ -7,8 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **EnumString** | **string** | | [optional] **EnumStringRequired** | **string** | | -**EnumInteger** | **int?** | | [optional] -**EnumNumber** | **double?** | | [optional] +**EnumInteger** | **int** | | [optional] +**EnumNumber** | **double** | | [optional] **OuterEnum** | **OuterEnum** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FakeApi.md index a2284ba8f3e..2738b9e1853 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FakeApi.md @@ -31,7 +31,7 @@ this route creates an XmlItem ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -41,9 +41,10 @@ namespace Example { public class CreateXmlItemExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var xmlItem = new XmlItem(); // XmlItem | XmlItem Body try @@ -51,9 +52,11 @@ namespace Example // creates an XmlItem apiInstance.CreateXmlItem(xmlItem); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.CreateXmlItem: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -80,6 +83,11 @@ No authorization required - **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 - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -88,7 +96,7 @@ No authorization required ## FakeOuterBooleanSerialize -> bool? FakeOuterBooleanSerialize (bool? body = null) +> bool FakeOuterBooleanSerialize (bool body = null) @@ -97,7 +105,7 @@ Test serialization of outer boolean types ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -107,19 +115,22 @@ namespace Example { public class FakeOuterBooleanSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var body = true; // bool? | Input boolean as post body (optional) + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var body = true; // bool | Input boolean as post body (optional) try { - bool? result = apiInstance.FakeOuterBooleanSerialize(body); + bool result = apiInstance.FakeOuterBooleanSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -131,11 +142,11 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **bool?**| Input boolean as post body | [optional] + **body** | **bool**| Input boolean as post body | [optional] ### Return type -**bool?** +**bool** ### Authorization @@ -146,6 +157,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -163,7 +179,7 @@ Test serialization of object with outer number type ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -173,9 +189,10 @@ namespace Example { public class FakeOuterCompositeSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = new OuterComposite(); // OuterComposite | Input composite as post body (optional) try @@ -183,9 +200,11 @@ namespace Example OuterComposite result = apiInstance.FakeOuterCompositeSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -212,6 +231,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -220,7 +244,7 @@ No authorization required ## FakeOuterNumberSerialize -> decimal? FakeOuterNumberSerialize (decimal? body = null) +> decimal FakeOuterNumberSerialize (decimal body = null) @@ -229,7 +253,7 @@ Test serialization of outer number types ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -239,19 +263,22 @@ namespace Example { public class FakeOuterNumberSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var body = 8.14; // decimal? | Input number as post body (optional) + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var body = 8.14; // decimal | Input number as post body (optional) try { - decimal? result = apiInstance.FakeOuterNumberSerialize(body); + decimal result = apiInstance.FakeOuterNumberSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -263,11 +290,11 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **decimal?**| Input number as post body | [optional] + **body** | **decimal**| Input number as post body | [optional] ### Return type -**decimal?** +**decimal** ### Authorization @@ -278,6 +305,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -295,7 +327,7 @@ Test serialization of outer string types ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -305,9 +337,10 @@ namespace Example { public class FakeOuterStringSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = body_example; // string | Input string as post body (optional) try @@ -315,9 +348,11 @@ namespace Example string result = apiInstance.FakeOuterStringSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -344,6 +379,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -361,7 +401,7 @@ For this test, the body for this request much reference a schema named `File`. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -371,18 +411,21 @@ namespace Example { public class TestBodyWithFileSchemaExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = new FileSchemaTestClass(); // FileSchemaTestClass | try { apiInstance.TestBodyWithFileSchema(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchema: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -409,6 +452,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -424,7 +472,7 @@ No authorization required ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -434,9 +482,10 @@ namespace Example { public class TestBodyWithQueryParamsExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var query = query_example; // string | var body = new User(); // User | @@ -444,9 +493,11 @@ namespace Example { apiInstance.TestBodyWithQueryParams(query, body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -474,6 +525,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -491,7 +547,7 @@ To test \"client\" model ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -501,9 +557,10 @@ namespace Example { public class TestClientModelExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = new ModelClient(); // ModelClient | client model try @@ -512,9 +569,11 @@ namespace Example ModelClient result = apiInstance.TestClientModel(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -541,6 +600,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -549,7 +613,7 @@ No authorization required ## TestEndpointParameters -> void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) +> void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = null, int int32 = null, long int64 = null, float _float = null, string _string = null, System.IO.Stream binary = null, DateTime date = null, DateTime dateTime = null, string password = null, string callback = null) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -558,7 +622,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -568,25 +632,26 @@ namespace Example { public class TestEndpointParametersExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure HTTP basic authorization: http_basic_test Configuration.Default.Username = "YOUR_USERNAME"; Configuration.Default.Password = "YOUR_PASSWORD"; - var apiInstance = new FakeApi(); - var number = 8.14; // decimal? | None - var _double = 1.2D; // double? | None + var apiInstance = new FakeApi(Configuration.Default); + var number = 8.14; // decimal | None + var _double = 1.2D; // double | None var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None var _byte = BYTE_ARRAY_DATA_HERE; // byte[] | None - var integer = 56; // int? | None (optional) - var int32 = 56; // int? | None (optional) - var int64 = 789; // long? | None (optional) - var _float = 3.4F; // float? | None (optional) + var integer = 56; // int | None (optional) + var int32 = 56; // int | None (optional) + var int64 = 789; // long | None (optional) + var _float = 3.4F; // float | None (optional) var _string = _string_example; // string | None (optional) var binary = BINARY_DATA_HERE; // System.IO.Stream | None (optional) - var date = 2013-10-20; // DateTime? | None (optional) - var dateTime = 2013-10-20T19:20:30+01:00; // DateTime? | None (optional) + var date = 2013-10-20; // DateTime | None (optional) + var dateTime = 2013-10-20T19:20:30+01:00; // DateTime | None (optional) var password = password_example; // string | None (optional) var callback = callback_example; // string | None (optional) @@ -595,9 +660,11 @@ namespace Example // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 apiInstance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -609,18 +676,18 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **number** | **decimal?**| None | - **_double** | **double?**| None | + **number** | **decimal**| None | + **_double** | **double**| None | **patternWithoutDelimiter** | **string**| None | **_byte** | **byte[]**| None | - **integer** | **int?**| None | [optional] - **int32** | **int?**| None | [optional] - **int64** | **long?**| None | [optional] - **_float** | **float?**| None | [optional] + **integer** | **int**| None | [optional] + **int32** | **int**| None | [optional] + **int64** | **long**| None | [optional] + **_float** | **float**| None | [optional] **_string** | **string**| None | [optional] **binary** | **System.IO.Stream**| None | [optional] - **date** | **DateTime?**| None | [optional] - **dateTime** | **DateTime?**| None | [optional] + **date** | **DateTime**| None | [optional] + **dateTime** | **DateTime**| None | [optional] **password** | **string**| None | [optional] **callback** | **string**| None | [optional] @@ -637,6 +704,12 @@ void (empty response body) - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -645,7 +718,7 @@ void (empty response body) ## TestEnumParameters -> void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) +> void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int enumQueryInteger = null, double enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) To test enum parameters @@ -654,7 +727,7 @@ To test enum parameters ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -664,15 +737,16 @@ namespace Example { public class TestEnumParametersExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var enumHeaderStringArray = enumHeaderStringArray_example; // List | Header parameter enum test (string array) (optional) var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg) var enumQueryStringArray = enumQueryStringArray_example; // List | Query parameter enum test (string array) (optional) var enumQueryString = enumQueryString_example; // string | Query parameter enum test (string) (optional) (default to -efg) - var enumQueryInteger = 56; // int? | Query parameter enum test (double) (optional) - var enumQueryDouble = 1.2D; // double? | Query parameter enum test (double) (optional) + var enumQueryInteger = 56; // int | Query parameter enum test (double) (optional) + var enumQueryDouble = 1.2D; // double | Query parameter enum test (double) (optional) var enumFormStringArray = new List(); // List | Form parameter enum test (string array) (optional) (default to $) var enumFormString = enumFormString_example; // string | Form parameter enum test (string) (optional) (default to -efg) @@ -681,9 +755,11 @@ namespace Example // To test enum parameters apiInstance.TestEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -699,8 +775,8 @@ Name | Type | Description | Notes **enumHeaderString** | **string**| Header parameter enum test (string) | [optional] [default to -efg] **enumQueryStringArray** | **List<string>**| Query parameter enum test (string array) | [optional] **enumQueryString** | **string**| Query parameter enum test (string) | [optional] [default to -efg] - **enumQueryInteger** | **int?**| Query parameter enum test (double) | [optional] - **enumQueryDouble** | **double?**| Query parameter enum test (double) | [optional] + **enumQueryInteger** | **int**| Query parameter enum test (double) | [optional] + **enumQueryDouble** | **double**| Query parameter enum test (double) | [optional] **enumFormStringArray** | [**List<string>**](string.md)| Form parameter enum test (string array) | [optional] [default to $] **enumFormString** | **string**| Form parameter enum test (string) | [optional] [default to -efg] @@ -717,6 +793,12 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -725,7 +807,7 @@ No authorization required ## TestGroupParameters -> void TestGroupParameters (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) +> void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = null, bool booleanGroup = null, long int64Group = null) Fake endpoint to test group parameters (optional) @@ -734,7 +816,7 @@ Fake endpoint to test group parameters (optional) ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -744,24 +826,27 @@ namespace Example { public class TestGroupParametersExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var requiredStringGroup = 56; // int? | Required String in group parameters - var requiredBooleanGroup = true; // bool? | Required Boolean in group parameters - var requiredInt64Group = 789; // long? | Required Integer in group parameters - var stringGroup = 56; // int? | String in group parameters (optional) - var booleanGroup = true; // bool? | Boolean in group parameters (optional) - var int64Group = 789; // long? | Integer in group parameters (optional) + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var requiredStringGroup = 56; // int | Required String in group parameters + var requiredBooleanGroup = true; // bool | Required Boolean in group parameters + var requiredInt64Group = 789; // long | Required Integer in group parameters + var stringGroup = 56; // int | String in group parameters (optional) + var booleanGroup = true; // bool | Boolean in group parameters (optional) + var int64Group = 789; // long | Integer in group parameters (optional) try { // Fake endpoint to test group parameters (optional) apiInstance.TestGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestGroupParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -773,12 +858,12 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **requiredStringGroup** | **int?**| Required String in group parameters | - **requiredBooleanGroup** | **bool?**| Required Boolean in group parameters | - **requiredInt64Group** | **long?**| Required Integer in group parameters | - **stringGroup** | **int?**| String in group parameters | [optional] - **booleanGroup** | **bool?**| Boolean in group parameters | [optional] - **int64Group** | **long?**| Integer in group parameters | [optional] + **requiredStringGroup** | **int**| Required String in group parameters | + **requiredBooleanGroup** | **bool**| Required Boolean in group parameters | + **requiredInt64Group** | **long**| Required Integer in group parameters | + **stringGroup** | **int**| String in group parameters | [optional] + **booleanGroup** | **bool**| Boolean in group parameters | [optional] + **int64Group** | **long**| Integer in group parameters | [optional] ### Return type @@ -793,6 +878,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Someting wrong | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -808,7 +898,7 @@ test inline additionalProperties ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -818,9 +908,10 @@ namespace Example { public class TestInlineAdditionalPropertiesExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var param = new Dictionary(); // Dictionary | request body try @@ -828,9 +919,11 @@ namespace Example // test inline additionalProperties apiInstance.TestInlineAdditionalProperties(param); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -857,6 +950,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -872,7 +970,7 @@ test json serialization of form data ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -882,9 +980,10 @@ namespace Example { public class TestJsonFormDataExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var param = param_example; // string | field1 var param2 = param2_example; // string | field2 @@ -893,9 +992,11 @@ namespace Example // test json serialization of form data apiInstance.TestJsonFormData(param, param2); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -923,6 +1024,11 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FakeClassnameTags123Api.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FakeClassnameTags123Api.md index cc0cd83d12c..deb97a27697 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FakeClassnameTags123Api.md @@ -19,7 +19,7 @@ To test class name in snake case ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -29,14 +29,15 @@ namespace Example { public class TestClassnameExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key_query Configuration.Default.AddApiKey("api_key_query", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key_query", "Bearer"); - var apiInstance = new FakeClassnameTags123Api(); + var apiInstance = new FakeClassnameTags123Api(Configuration.Default); var body = new ModelClient(); // ModelClient | client model try @@ -45,9 +46,11 @@ namespace Example ModelClient result = apiInstance.TestClassname(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -74,6 +77,11 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FormatTest.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FormatTest.md index 519e940a7c8..0d921285ba1 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FormatTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/FormatTest.md @@ -5,18 +5,18 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Integer** | **int?** | | [optional] -**Int32** | **int?** | | [optional] -**Int64** | **long?** | | [optional] -**Number** | **decimal?** | | -**Float** | **float?** | | [optional] -**Double** | **double?** | | [optional] +**Integer** | **int** | | [optional] +**Int32** | **int** | | [optional] +**Int64** | **long** | | [optional] +**Number** | **decimal** | | +**Float** | **float** | | [optional] +**Double** | **double** | | [optional] **String** | **string** | | [optional] **Byte** | **byte[]** | | **Binary** | **System.IO.Stream** | | [optional] -**Date** | **DateTime?** | | -**DateTime** | **DateTime?** | | [optional] -**Uuid** | **Guid?** | | [optional] +**Date** | **DateTime** | | +**DateTime** | **DateTime** | | [optional] +**Uuid** | **Guid** | | [optional] **Password** | **string** | | [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/MapTest.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/MapTest.md index 89be5aa12cf..79d499e2cf9 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/MapTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/MapTest.md @@ -7,8 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **MapMapOfString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] **MapOfEnumString** | **Dictionary<string, string>** | | [optional] -**DirectMap** | **Dictionary<string, bool?>** | | [optional] -**IndirectMap** | **Dictionary<string, bool?>** | | [optional] +**DirectMap** | **Dictionary<string, bool>** | | [optional] +**IndirectMap** | **Dictionary<string, bool>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 323933588de..dd7b01e49fe 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Uuid** | **Guid?** | | [optional] -**DateTime** | **DateTime?** | | [optional] +**Uuid** | **Guid** | | [optional] +**DateTime** | **DateTime** | | [optional] **Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Model200Response.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Model200Response.md index 59918913107..7d826bca1ec 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Model200Response.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Model200Response.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **int?** | | [optional] +**Name** | **int** | | [optional] **Class** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Name.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Name.md index 80d0a9f31f3..77b9b2e7501 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Name.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Name.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Name** | **int?** | | -**SnakeCase** | **int?** | | [optional] +**_Name** | **int** | | +**SnakeCase** | **int** | | [optional] **Property** | **string** | | [optional] -**_123Number** | **int?** | | [optional] +**_123Number** | **int** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/NumberOnly.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/NumberOnly.md index 8fd05997a93..e4b08467e08 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/NumberOnly.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/NumberOnly.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**JustNumber** | **decimal?** | | [optional] +**JustNumber** | **decimal** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Order.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Order.md index f28ee2ad006..875f43a30e5 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Order.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Order.md @@ -5,12 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] -**PetId** | **long?** | | [optional] -**Quantity** | **int?** | | [optional] -**ShipDate** | **DateTime?** | | [optional] +**Id** | **long** | | [optional] +**PetId** | **long** | | [optional] +**Quantity** | **int** | | [optional] +**ShipDate** | **DateTime** | | [optional] **Status** | **string** | Order Status | [optional] -**Complete** | **bool?** | | [optional] [default to false] +**Complete** | **bool** | | [optional] [default to false] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/OuterComposite.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/OuterComposite.md index e371f712633..f381fb7fd28 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/OuterComposite.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/OuterComposite.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MyNumber** | **decimal?** | | [optional] +**MyNumber** | **decimal** | | [optional] **MyString** | **string** | | [optional] -**MyBoolean** | **bool?** | | [optional] +**MyBoolean** | **bool** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Pet.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Pet.md index 51022249270..0bd5c40fc99 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Pet.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Pet.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Category** | [**Category**](Category.md) | | [optional] **Name** | **string** | | **PhotoUrls** | **List<string>** | | diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/PetApi.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/PetApi.md index d2e2075bfd7..1a9eba14868 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/PetApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/PetApi.md @@ -25,7 +25,7 @@ Add a new pet to the store ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -35,12 +35,13 @@ namespace Example { public class AddPetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var body = new Pet(); // Pet | Pet object that needs to be added to the store try @@ -48,9 +49,11 @@ namespace Example // Add a new pet to the store apiInstance.AddPet(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -77,6 +80,12 @@ void (empty response body) - **Content-Type**: application/json, application/xml - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **405** | Invalid input | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -85,14 +94,14 @@ void (empty response body) ## DeletePet -> void DeletePet (long? petId, string apiKey = null) +> void DeletePet (long petId, string apiKey = null) Deletes a pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -102,13 +111,14 @@ namespace Example { public class DeletePetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var petId = 789; // long? | Pet id to delete + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | Pet id to delete var apiKey = apiKey_example; // string | (optional) try @@ -116,9 +126,11 @@ namespace Example // Deletes a pet apiInstance.DeletePet(petId, apiKey); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -130,7 +142,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| Pet id to delete | + **petId** | **long**| Pet id to delete | **apiKey** | **string**| | [optional] ### Return type @@ -146,6 +158,12 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid pet value | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -154,7 +172,7 @@ void (empty response body) ## FindPetsByStatus -> List FindPetsByStatus (List status) +> List<Pet> FindPetsByStatus (List status) Finds Pets by status @@ -163,7 +181,7 @@ Multiple status values can be provided with comma separated strings ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -173,23 +191,26 @@ namespace Example { public class FindPetsByStatusExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var status = status_example; // List | Status values that need to be considered for filter try { // Finds Pets by status - List<Pet> result = apiInstance.FindPetsByStatus(status); + List result = apiInstance.FindPetsByStatus(status); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -205,7 +226,7 @@ Name | Type | Description | Notes ### Return type -[**List**](Pet.md) +[**List<Pet>**](Pet.md) ### Authorization @@ -216,6 +237,12 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -224,7 +251,7 @@ Name | Type | Description | Notes ## FindPetsByTags -> List FindPetsByTags (List tags) +> List<Pet> FindPetsByTags (List tags) Finds Pets by tags @@ -233,7 +260,7 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -243,23 +270,26 @@ namespace Example { public class FindPetsByTagsExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var tags = new List(); // List | Tags to filter by try { // Finds Pets by tags - List<Pet> result = apiInstance.FindPetsByTags(tags); + List result = apiInstance.FindPetsByTags(tags); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -275,7 +305,7 @@ Name | Type | Description | Notes ### Return type -[**List**](Pet.md) +[**List<Pet>**](Pet.md) ### Authorization @@ -286,6 +316,12 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -294,7 +330,7 @@ Name | Type | Description | Notes ## GetPetById -> Pet GetPetById (long? petId) +> Pet GetPetById (long petId) Find pet by ID @@ -303,7 +339,7 @@ Returns a single pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -313,15 +349,16 @@ namespace Example { public class GetPetByIdExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet to return + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | ID of pet to return try { @@ -329,9 +366,11 @@ namespace Example Pet result = apiInstance.GetPetById(petId); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -343,7 +382,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to return | + **petId** | **long**| ID of pet to return | ### Return type @@ -358,6 +397,13 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -373,7 +419,7 @@ Update an existing pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -383,12 +429,13 @@ namespace Example { public class UpdatePetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var body = new Pet(); // Pet | Pet object that needs to be added to the store try @@ -396,9 +443,11 @@ namespace Example // Update an existing pet apiInstance.UpdatePet(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -425,6 +474,14 @@ void (empty response body) - **Content-Type**: application/json, application/xml - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -433,14 +490,14 @@ void (empty response body) ## UpdatePetWithForm -> void UpdatePetWithForm (long? petId, string name = null, string status = null) +> void UpdatePetWithForm (long petId, string name = null, string status = null) Updates a pet in the store with form data ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -450,13 +507,14 @@ namespace Example { public class UpdatePetWithFormExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet that needs to be updated + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | ID of pet that needs to be updated var name = name_example; // string | Updated name of the pet (optional) var status = status_example; // string | Updated status of the pet (optional) @@ -465,9 +523,11 @@ namespace Example // Updates a pet in the store with form data apiInstance.UpdatePetWithForm(petId, name, status); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -479,7 +539,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet that needs to be updated | + **petId** | **long**| ID of pet that needs to be updated | **name** | **string**| Updated name of the pet | [optional] **status** | **string**| Updated status of the pet | [optional] @@ -496,6 +556,11 @@ void (empty response body) - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -504,14 +569,14 @@ void (empty response body) ## UploadFile -> ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null) +> ApiResponse UploadFile (long petId, string additionalMetadata = null, System.IO.Stream file = null) uploads an image ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -521,13 +586,14 @@ namespace Example { public class UploadFileExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet to update + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | ID of pet to update var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) var file = BINARY_DATA_HERE; // System.IO.Stream | file to upload (optional) @@ -537,9 +603,11 @@ namespace Example ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -551,7 +619,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to update | + **petId** | **long**| ID of pet to update | **additionalMetadata** | **string**| Additional data to pass to server | [optional] **file** | **System.IO.Stream**| file to upload | [optional] @@ -568,6 +636,11 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -576,14 +649,14 @@ Name | Type | Description | Notes ## UploadFileWithRequiredFile -> ApiResponse UploadFileWithRequiredFile (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) +> ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string additionalMetadata = null) uploads an image (required) ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -593,13 +666,14 @@ namespace Example { public class UploadFileWithRequiredFileExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet to update + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | ID of pet to update var requiredFile = BINARY_DATA_HERE; // System.IO.Stream | file to upload var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) @@ -609,9 +683,11 @@ namespace Example ApiResponse result = apiInstance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -623,7 +699,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to update | + **petId** | **long**| ID of pet to update | **requiredFile** | **System.IO.Stream**| file to upload | **additionalMetadata** | **string**| Additional data to pass to server | [optional] @@ -640,6 +716,11 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Return.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Return.md index 65481f45cf2..4761c70748e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Return.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Return.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Return** | **int?** | | [optional] +**_Return** | **int** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/SpecialModelName.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/SpecialModelName.md index c1154219ccc..ee6489524d0 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/SpecialModelName.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/SpecialModelName.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SpecialPropertyName** | **long?** | | [optional] +**SpecialPropertyName** | **long** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/StoreApi.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/StoreApi.md index 0f6d9e4e3dc..57247772d4f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/StoreApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/StoreApi.md @@ -22,7 +22,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -32,9 +32,10 @@ namespace Example { public class DeleteOrderExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); var orderId = orderId_example; // string | ID of the order that needs to be deleted try @@ -42,9 +43,11 @@ namespace Example // Delete purchase order by ID apiInstance.DeleteOrder(orderId); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -71,6 +74,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -79,7 +88,7 @@ No authorization required ## GetInventory -> Dictionary GetInventory () +> Dictionary<string, int> GetInventory () Returns pet inventories by status @@ -88,7 +97,7 @@ Returns a map of status codes to quantities ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -98,24 +107,27 @@ namespace Example { public class GetInventoryExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); - var apiInstance = new StoreApi(); + var apiInstance = new StoreApi(Configuration.Default); try { // Returns pet inventories by status - Dictionary<string, int?> result = apiInstance.GetInventory(); + Dictionary result = apiInstance.GetInventory(); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -128,7 +140,7 @@ This endpoint does not need any parameter. ### Return type -**Dictionary** +**Dictionary** ### Authorization @@ -139,6 +151,11 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -147,7 +164,7 @@ This endpoint does not need any parameter. ## GetOrderById -> Order GetOrderById (long? orderId) +> Order GetOrderById (long orderId) Find purchase order by ID @@ -156,7 +173,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -166,10 +183,11 @@ namespace Example { public class GetOrderByIdExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); - var orderId = 789; // long? | ID of pet that needs to be fetched + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); + var orderId = 789; // long | ID of pet that needs to be fetched try { @@ -177,9 +195,11 @@ namespace Example Order result = apiInstance.GetOrderById(orderId); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -191,7 +211,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **long?**| ID of pet that needs to be fetched | + **orderId** | **long**| ID of pet that needs to be fetched | ### Return type @@ -206,6 +226,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -221,7 +248,7 @@ Place an order for a pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -231,9 +258,10 @@ namespace Example { public class PlaceOrderExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); var body = new Order(); // Order | order placed for purchasing the pet try @@ -242,9 +270,11 @@ namespace Example Order result = apiInstance.PlaceOrder(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -271,6 +301,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Tag.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Tag.md index 864cac0c8d3..f781c26f017 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Tag.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/Tag.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Name** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/TypeHolderDefault.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/TypeHolderDefault.md index d336f567ab2..0945245b213 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/TypeHolderDefault.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/TypeHolderDefault.md @@ -6,10 +6,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **StringItem** | **string** | | [default to "what"] -**NumberItem** | **decimal?** | | -**IntegerItem** | **int?** | | -**BoolItem** | **bool?** | | [default to true] -**ArrayItem** | **List<int?>** | | +**NumberItem** | **decimal** | | +**IntegerItem** | **int** | | +**BoolItem** | **bool** | | [default to true] +**ArrayItem** | **List<int>** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/TypeHolderExample.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/TypeHolderExample.md index 8f9ec66939e..e92681b8cba 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/TypeHolderExample.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/TypeHolderExample.md @@ -6,10 +6,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **StringItem** | **string** | | -**NumberItem** | **decimal?** | | -**IntegerItem** | **int?** | | -**BoolItem** | **bool?** | | -**ArrayItem** | **List<int?>** | | +**NumberItem** | **decimal** | | +**IntegerItem** | **int** | | +**BoolItem** | **bool** | | +**ArrayItem** | **List<int>** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/User.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/User.md index 6faa1df688d..a25c25d1aa0 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/User.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/User.md @@ -5,14 +5,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Username** | **string** | | [optional] **FirstName** | **string** | | [optional] **LastName** | **string** | | [optional] **Email** | **string** | | [optional] **Password** | **string** | | [optional] **Phone** | **string** | | [optional] -**UserStatus** | **int?** | User Status | [optional] +**UserStatus** | **int** | User Status | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/UserApi.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/UserApi.md index b9f592bdd71..1385d840413 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/UserApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/UserApi.md @@ -26,7 +26,7 @@ This can only be done by the logged in user. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -36,9 +36,10 @@ namespace Example { public class CreateUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var body = new User(); // User | Created user object try @@ -46,9 +47,11 @@ namespace Example // Create user apiInstance.CreateUser(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -75,6 +78,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -90,7 +98,7 @@ Creates list of users with given input array ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -100,9 +108,10 @@ namespace Example { public class CreateUsersWithArrayInputExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var body = new List(); // List | List of user object try @@ -110,9 +119,11 @@ namespace Example // Creates list of users with given input array apiInstance.CreateUsersWithArrayInput(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -124,7 +135,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -139,6 +150,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -154,7 +170,7 @@ Creates list of users with given input array ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -164,9 +180,10 @@ namespace Example { public class CreateUsersWithListInputExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var body = new List(); // List | List of user object try @@ -174,9 +191,11 @@ namespace Example // Creates list of users with given input array apiInstance.CreateUsersWithListInput(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -188,7 +207,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -203,6 +222,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -220,7 +244,7 @@ This can only be done by the logged in user. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -230,9 +254,10 @@ namespace Example { public class DeleteUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The name that needs to be deleted try @@ -240,9 +265,11 @@ namespace Example // Delete user apiInstance.DeleteUser(username); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -269,6 +296,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -284,7 +317,7 @@ Get user by user name ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -294,9 +327,10 @@ namespace Example { public class GetUserByNameExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. try @@ -305,9 +339,11 @@ namespace Example User result = apiInstance.GetUserByName(username); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -334,6 +370,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -349,7 +392,7 @@ Logs user into the system ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -359,9 +402,10 @@ namespace Example { public class LoginUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The user name for login var password = password_example; // string | The password for login in clear text @@ -371,9 +415,11 @@ namespace Example string result = apiInstance.LoginUser(username, password); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -401,6 +447,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -416,7 +468,7 @@ Logs out current logged in user session ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -426,18 +478,21 @@ namespace Example { public class LogoutUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); try { // Logs out current logged in user session apiInstance.LogoutUser(); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -461,6 +516,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -478,7 +538,7 @@ This can only be done by the logged in user. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -488,9 +548,10 @@ namespace Example { public class UpdateUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | name that need to be deleted var body = new User(); // User | Updated user object @@ -499,9 +560,11 @@ namespace Example // Updated user apiInstance.UpdateUser(username, body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -529,6 +592,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/XmlItem.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/XmlItem.md index e96ea4b0de6..0dca90c706f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/XmlItem.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/XmlItem.md @@ -6,34 +6,34 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **AttributeString** | **string** | | [optional] -**AttributeNumber** | **decimal?** | | [optional] -**AttributeInteger** | **int?** | | [optional] -**AttributeBoolean** | **bool?** | | [optional] -**WrappedArray** | **List<int?>** | | [optional] +**AttributeNumber** | **decimal** | | [optional] +**AttributeInteger** | **int** | | [optional] +**AttributeBoolean** | **bool** | | [optional] +**WrappedArray** | **List<int>** | | [optional] **NameString** | **string** | | [optional] -**NameNumber** | **decimal?** | | [optional] -**NameInteger** | **int?** | | [optional] -**NameBoolean** | **bool?** | | [optional] -**NameArray** | **List<int?>** | | [optional] -**NameWrappedArray** | **List<int?>** | | [optional] +**NameNumber** | **decimal** | | [optional] +**NameInteger** | **int** | | [optional] +**NameBoolean** | **bool** | | [optional] +**NameArray** | **List<int>** | | [optional] +**NameWrappedArray** | **List<int>** | | [optional] **PrefixString** | **string** | | [optional] -**PrefixNumber** | **decimal?** | | [optional] -**PrefixInteger** | **int?** | | [optional] -**PrefixBoolean** | **bool?** | | [optional] -**PrefixArray** | **List<int?>** | | [optional] -**PrefixWrappedArray** | **List<int?>** | | [optional] +**PrefixNumber** | **decimal** | | [optional] +**PrefixInteger** | **int** | | [optional] +**PrefixBoolean** | **bool** | | [optional] +**PrefixArray** | **List<int>** | | [optional] +**PrefixWrappedArray** | **List<int>** | | [optional] **NamespaceString** | **string** | | [optional] -**NamespaceNumber** | **decimal?** | | [optional] -**NamespaceInteger** | **int?** | | [optional] -**NamespaceBoolean** | **bool?** | | [optional] -**NamespaceArray** | **List<int?>** | | [optional] -**NamespaceWrappedArray** | **List<int?>** | | [optional] +**NamespaceNumber** | **decimal** | | [optional] +**NamespaceInteger** | **int** | | [optional] +**NamespaceBoolean** | **bool** | | [optional] +**NamespaceArray** | **List<int>** | | [optional] +**NamespaceWrappedArray** | **List<int>** | | [optional] **PrefixNsString** | **string** | | [optional] -**PrefixNsNumber** | **decimal?** | | [optional] -**PrefixNsInteger** | **int?** | | [optional] -**PrefixNsBoolean** | **bool?** | | [optional] -**PrefixNsArray** | **List<int?>** | | [optional] -**PrefixNsWrappedArray** | **List<int?>** | | [optional] +**PrefixNsNumber** | **decimal** | | [optional] +**PrefixNsInteger** | **int** | | [optional] +**PrefixNsBoolean** | **bool** | | [optional] +**PrefixNsArray** | **List<int>** | | [optional] +**PrefixNsWrappedArray** | **List<int>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 76d5194e5a1..1ad994047eb 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -197,7 +197,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > Call123TestSpecialTagsWithHttpInfo (ModelClient body) + public ApiResponse Call123TestSpecialTagsWithHttpInfo (ModelClient body) { // verify the required parameter 'body' is set if (body == null) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/FakeApi.cs index 7f0b649598c..f16e8c0a1c9 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/FakeApi.cs @@ -53,8 +53,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// bool? - bool? FakeOuterBooleanSerialize (bool? body = null); + /// bool + bool FakeOuterBooleanSerialize (bool body = default(bool)); /// /// @@ -64,8 +64,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// ApiResponse of bool? - ApiResponse FakeOuterBooleanSerializeWithHttpInfo (bool? body = null); + /// ApiResponse of bool + ApiResponse FakeOuterBooleanSerializeWithHttpInfo (bool body = default(bool)); /// /// /// @@ -75,7 +75,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// OuterComposite - OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null); + OuterComposite FakeOuterCompositeSerialize (OuterComposite body = default(OuterComposite)); /// /// @@ -86,7 +86,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// ApiResponse of OuterComposite - ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null); + ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = default(OuterComposite)); /// /// /// @@ -95,8 +95,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// decimal? - decimal? FakeOuterNumberSerialize (decimal? body = null); + /// decimal + decimal FakeOuterNumberSerialize (decimal body = default(decimal)); /// /// @@ -106,8 +106,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// ApiResponse of decimal? - ApiResponse FakeOuterNumberSerializeWithHttpInfo (decimal? body = null); + /// ApiResponse of decimal + ApiResponse FakeOuterNumberSerializeWithHttpInfo (decimal body = default(decimal)); /// /// /// @@ -117,7 +117,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// string - string FakeOuterStringSerialize (string body = null); + string FakeOuterStringSerialize (string body = default(string)); /// /// @@ -128,7 +128,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// ApiResponse of string - ApiResponse FakeOuterStringSerializeWithHttpInfo (string body = null); + ApiResponse FakeOuterStringSerializeWithHttpInfo (string body = default(string)); /// /// /// @@ -216,7 +216,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// - void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -240,7 +240,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// ApiResponse of Object(void) - ApiResponse TestEndpointParametersWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + ApiResponse TestEndpointParametersWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)); /// /// To test enum parameters /// @@ -257,7 +257,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// - void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); + void TestEnumParameters (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)); /// /// To test enum parameters @@ -275,7 +275,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// ApiResponse of Object(void) - ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); + ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)); /// /// Fake endpoint to test group parameters (optional) /// @@ -290,7 +290,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// - void TestGroupParameters (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)); /// /// Fake endpoint to test group parameters (optional) @@ -306,7 +306,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// ApiResponse of Object(void) - ApiResponse TestGroupParametersWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + ApiResponse TestGroupParametersWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)); /// /// test inline additionalProperties /// @@ -382,8 +382,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of bool? - System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = null); + /// Task of bool + System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool body = default(bool)); /// /// @@ -393,8 +393,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of ApiResponse (bool?) - System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = null); + /// Task of ApiResponse (bool) + System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool body = default(bool)); /// /// /// @@ -404,7 +404,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// Task of OuterComposite - System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null); + System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = default(OuterComposite)); /// /// @@ -415,7 +415,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// Task of ApiResponse (OuterComposite) - System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null); + System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = default(OuterComposite)); /// /// /// @@ -424,8 +424,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of decimal? - System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = null); + /// Task of decimal + System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal body = default(decimal)); /// /// @@ -435,8 +435,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of ApiResponse (decimal?) - System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = null); + /// Task of ApiResponse (decimal) + System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal body = default(decimal)); /// /// /// @@ -446,7 +446,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// Task of string - System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = null); + System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = default(string)); /// /// @@ -457,7 +457,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// Task of ApiResponse (string) - System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = null); + System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = default(string)); /// /// /// @@ -545,7 +545,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// Task of void - System.Threading.Tasks.Task TestEndpointParametersAsync (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -569,7 +569,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// Task of ApiResponse - System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)); /// /// To test enum parameters /// @@ -586,7 +586,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// Task of void - System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); + System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)); /// /// To test enum parameters @@ -604,7 +604,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// Task of ApiResponse - System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); + System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)); /// /// Fake endpoint to test group parameters (optional) /// @@ -619,7 +619,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// Task of void - System.Threading.Tasks.Task TestGroupParametersAsync (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + System.Threading.Tasks.Task TestGroupParametersAsync (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)); /// /// Fake endpoint to test group parameters (optional) @@ -635,7 +635,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// Task of ApiResponse - System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)); /// /// test inline additionalProperties /// @@ -951,10 +951,10 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// bool? - public bool? FakeOuterBooleanSerialize (bool? body = null) + /// bool + public bool FakeOuterBooleanSerialize (bool body = default(bool)) { - ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -963,8 +963,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// ApiResponse of bool? - public ApiResponse< bool? > FakeOuterBooleanSerializeWithHttpInfo (bool? body = null) + /// ApiResponse of bool + public ApiResponse FakeOuterBooleanSerializeWithHttpInfo (bool body = default(bool)) { var localVarPath = "./fake/outer/boolean"; @@ -1011,9 +1011,9 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), - (bool?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool?))); + (bool) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool))); } /// @@ -1021,10 +1021,10 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of bool? - public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = null) + /// Task of bool + public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool body = default(bool)) { - ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -1034,8 +1034,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of ApiResponse (bool?) - public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = null) + /// Task of ApiResponse (bool) + public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool body = default(bool)) { var localVarPath = "./fake/outer/boolean"; @@ -1082,9 +1082,9 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), - (bool?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool?))); + (bool) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool))); } /// @@ -1093,7 +1093,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// OuterComposite - public OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) + public OuterComposite FakeOuterCompositeSerialize (OuterComposite body = default(OuterComposite)) { ApiResponse localVarResponse = FakeOuterCompositeSerializeWithHttpInfo(body); return localVarResponse.Data; @@ -1105,7 +1105,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// ApiResponse of OuterComposite - public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null) + public ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = default(OuterComposite)) { var localVarPath = "./fake/outer/composite"; @@ -1163,7 +1163,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// Task of OuterComposite - public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null) + public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = default(OuterComposite)) { ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; @@ -1176,7 +1176,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// Task of ApiResponse (OuterComposite) - public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null) + public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = default(OuterComposite)) { var localVarPath = "./fake/outer/composite"; @@ -1233,10 +1233,10 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// decimal? - public decimal? FakeOuterNumberSerialize (decimal? body = null) + /// decimal + public decimal FakeOuterNumberSerialize (decimal body = default(decimal)) { - ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -1245,8 +1245,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// ApiResponse of decimal? - public ApiResponse< decimal? > FakeOuterNumberSerializeWithHttpInfo (decimal? body = null) + /// ApiResponse of decimal + public ApiResponse FakeOuterNumberSerializeWithHttpInfo (decimal body = default(decimal)) { var localVarPath = "./fake/outer/number"; @@ -1293,9 +1293,9 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), - (decimal?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal?))); + (decimal) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal))); } /// @@ -1303,10 +1303,10 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of decimal? - public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = null) + /// Task of decimal + public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal body = default(decimal)) { - ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -1316,8 +1316,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of ApiResponse (decimal?) - public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = null) + /// Task of ApiResponse (decimal) + public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal body = default(decimal)) { var localVarPath = "./fake/outer/number"; @@ -1364,9 +1364,9 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), - (decimal?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal?))); + (decimal) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal))); } /// @@ -1375,7 +1375,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// string - public string FakeOuterStringSerialize (string body = null) + public string FakeOuterStringSerialize (string body = default(string)) { ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); return localVarResponse.Data; @@ -1387,7 +1387,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// ApiResponse of string - public ApiResponse< string > FakeOuterStringSerializeWithHttpInfo (string body = null) + public ApiResponse FakeOuterStringSerializeWithHttpInfo (string body = default(string)) { var localVarPath = "./fake/outer/string"; @@ -1445,7 +1445,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// Task of string - public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = null) + public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = default(string)) { ApiResponse localVarResponse = await FakeOuterStringSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; @@ -1458,7 +1458,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// Task of ApiResponse (string) - public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = null) + public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = default(string)) { var localVarPath = "./fake/outer/string"; @@ -1830,7 +1830,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient body) + public ApiResponse TestClientModelWithHttpInfo (ModelClient body) { // verify the required parameter 'body' is set if (body == null) @@ -1980,7 +1980,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// - public void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + public void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)) { TestEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); } @@ -2004,7 +2004,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// ApiResponse of Object(void) - public ApiResponse TestEndpointParametersWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + public ApiResponse TestEndpointParametersWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)) { // verify the required parameter 'number' is set if (number == null) @@ -2099,7 +2099,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// Task of void - public async System.Threading.Tasks.Task TestEndpointParametersAsync (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + public async System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)) { await TestEndpointParametersAsyncWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); @@ -2124,7 +2124,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + public async System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)) { // verify the required parameter 'number' is set if (number == null) @@ -2213,7 +2213,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// - public void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) + public void TestEnumParameters (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)) { TestEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } @@ -2231,7 +2231,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// ApiResponse of Object(void) - public ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) + public ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)) { var localVarPath = "./fake"; @@ -2296,7 +2296,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// Task of void - public async System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) + public async System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)) { await TestEnumParametersAsyncWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); @@ -2315,7 +2315,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) + public async System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)) { var localVarPath = "./fake"; @@ -2378,7 +2378,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// - public void TestGroupParameters (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + public void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)) { TestGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } @@ -2394,7 +2394,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// ApiResponse of Object(void) - public ApiResponse TestGroupParametersWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + public ApiResponse TestGroupParametersWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)) { // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup == null) @@ -2463,7 +2463,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// Task of void - public async System.Threading.Tasks.Task TestGroupParametersAsync (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + public async System.Threading.Tasks.Task TestGroupParametersAsync (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)) { await TestGroupParametersAsyncWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); @@ -2480,7 +2480,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + public async System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)) { // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup == null) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 15a124d69b3..4e181eeb4f7 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -197,7 +197,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient body) + public ApiResponse TestClassnameWithHttpInfo (ModelClient body) { // verify the required parameter 'body' is set if (body == null) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/PetApi.cs index 9cf187dae40..835858d4b10 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/PetApi.cs @@ -55,7 +55,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// - void DeletePet (long? petId, string apiKey = null); + void DeletePet (long petId, string apiKey = default(string)); /// /// Deletes a pet @@ -67,7 +67,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// ApiResponse of Object(void) - ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = null); + ApiResponse DeletePetWithHttpInfo (long petId, string apiKey = default(string)); /// /// Finds Pets by status /// @@ -119,7 +119,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Pet - Pet GetPetById (long? petId); + Pet GetPetById (long petId); /// /// Find pet by ID @@ -130,7 +130,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// ApiResponse of Pet - ApiResponse GetPetByIdWithHttpInfo (long? petId); + ApiResponse GetPetByIdWithHttpInfo (long petId); /// /// Update an existing pet /// @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// - void UpdatePetWithForm (long? petId, string name = null, string status = null); + void UpdatePetWithForm (long petId, string name = default(string), string status = default(string)); /// /// Updates a pet in the store with form data @@ -176,7 +176,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// ApiResponse of Object(void) - ApiResponse UpdatePetWithFormWithHttpInfo (long? petId, string name = null, string status = null); + ApiResponse UpdatePetWithFormWithHttpInfo (long petId, string name = default(string), string status = default(string)); /// /// uploads an image /// @@ -188,7 +188,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse - ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + ApiResponse UploadFile (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); /// /// uploads an image @@ -201,7 +201,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse of ApiResponse - ApiResponse UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + ApiResponse UploadFileWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); /// /// uploads an image (required) /// @@ -213,7 +213,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// ApiResponse - ApiResponse UploadFileWithRequiredFile (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null); + ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); /// /// uploads an image (required) @@ -226,7 +226,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// ApiResponse of ApiResponse - ApiResponse UploadFileWithRequiredFileWithHttpInfo (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null); + ApiResponse UploadFileWithRequiredFileWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -260,7 +260,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// Task of void - System.Threading.Tasks.Task DeletePetAsync (long? petId, string apiKey = null); + System.Threading.Tasks.Task DeletePetAsync (long petId, string apiKey = default(string)); /// /// Deletes a pet @@ -272,7 +272,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// Task of ApiResponse - System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long? petId, string apiKey = null); + System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string)); /// /// Finds Pets by status /// @@ -324,7 +324,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Task of Pet - System.Threading.Tasks.Task GetPetByIdAsync (long? petId); + System.Threading.Tasks.Task GetPetByIdAsync (long petId); /// /// Find pet by ID @@ -335,7 +335,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Task of ApiResponse (Pet) - System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long? petId); + System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId); /// /// Update an existing pet /// @@ -368,7 +368,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// Task of void - System.Threading.Tasks.Task UpdatePetWithFormAsync (long? petId, string name = null, string status = null); + System.Threading.Tasks.Task UpdatePetWithFormAsync (long petId, string name = default(string), string status = default(string)); /// /// Updates a pet in the store with form data @@ -381,7 +381,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// Task of ApiResponse - System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long? petId, string name = null, string status = null); + System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string)); /// /// uploads an image /// @@ -393,7 +393,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// Task of ApiResponse - System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + System.Threading.Tasks.Task UploadFileAsync (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); /// /// uploads an image @@ -406,7 +406,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// Task of ApiResponse (ApiResponse) - System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); /// /// uploads an image (required) /// @@ -418,7 +418,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// Task of ApiResponse - System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null); + System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); /// /// uploads an image (required) @@ -431,7 +431,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// Task of ApiResponse (ApiResponse) - System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null); + System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); #endregion Asynchronous Operations } @@ -709,7 +709,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// - public void DeletePet (long? petId, string apiKey = null) + public void DeletePet (long petId, string apiKey = default(string)) { DeletePetWithHttpInfo(petId, apiKey); } @@ -721,7 +721,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// ApiResponse of Object(void) - public ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = null) + public ApiResponse DeletePetWithHttpInfo (long petId, string apiKey = default(string)) { // verify the required parameter 'petId' is set if (petId == null) @@ -782,7 +782,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// Task of void - public async System.Threading.Tasks.Task DeletePetAsync (long? petId, string apiKey = null) + public async System.Threading.Tasks.Task DeletePetAsync (long petId, string apiKey = default(string)) { await DeletePetAsyncWithHttpInfo(petId, apiKey); @@ -795,7 +795,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long? petId, string apiKey = null) + public async System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string)) { // verify the required parameter 'petId' is set if (petId == null) @@ -867,7 +867,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Status values that need to be considered for filter /// ApiResponse of List<Pet> - public ApiResponse< List > FindPetsByStatusWithHttpInfo (List status) + public ApiResponse> FindPetsByStatusWithHttpInfo (List status) { // verify the required parameter 'status' is set if (status == null) @@ -1014,7 +1014,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Tags to filter by /// ApiResponse of List<Pet> - public ApiResponse< List > FindPetsByTagsWithHttpInfo (List tags) + public ApiResponse> FindPetsByTagsWithHttpInfo (List tags) { // verify the required parameter 'tags' is set if (tags == null) @@ -1149,7 +1149,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Pet - public Pet GetPetById (long? petId) + public Pet GetPetById (long petId) { ApiResponse localVarResponse = GetPetByIdWithHttpInfo(petId); return localVarResponse.Data; @@ -1161,7 +1161,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// ApiResponse of Pet - public ApiResponse< Pet > GetPetByIdWithHttpInfo (long? petId) + public ApiResponse GetPetByIdWithHttpInfo (long petId) { // verify the required parameter 'petId' is set if (petId == null) @@ -1221,7 +1221,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Task of Pet - public async System.Threading.Tasks.Task GetPetByIdAsync (long? petId) + public async System.Threading.Tasks.Task GetPetByIdAsync (long petId) { ApiResponse localVarResponse = await GetPetByIdAsyncWithHttpInfo(petId); return localVarResponse.Data; @@ -1234,7 +1234,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Task of ApiResponse (Pet) - public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long? petId) + public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId) { // verify the required parameter 'petId' is set if (petId == null) @@ -1455,7 +1455,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// - public void UpdatePetWithForm (long? petId, string name = null, string status = null) + public void UpdatePetWithForm (long petId, string name = default(string), string status = default(string)) { UpdatePetWithFormWithHttpInfo(petId, name, status); } @@ -1468,7 +1468,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// ApiResponse of Object(void) - public ApiResponse UpdatePetWithFormWithHttpInfo (long? petId, string name = null, string status = null) + public ApiResponse UpdatePetWithFormWithHttpInfo (long petId, string name = default(string), string status = default(string)) { // verify the required parameter 'petId' is set if (petId == null) @@ -1532,7 +1532,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// Task of void - public async System.Threading.Tasks.Task UpdatePetWithFormAsync (long? petId, string name = null, string status = null) + public async System.Threading.Tasks.Task UpdatePetWithFormAsync (long petId, string name = default(string), string status = default(string)) { await UpdatePetWithFormAsyncWithHttpInfo(petId, name, status); @@ -1546,7 +1546,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long? petId, string name = null, string status = null) + public async System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string)) { // verify the required parameter 'petId' is set if (petId == null) @@ -1610,7 +1610,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse - public ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public ApiResponse UploadFile (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) { ApiResponse localVarResponse = UploadFileWithHttpInfo(petId, additionalMetadata, file); return localVarResponse.Data; @@ -1624,7 +1624,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse of ApiResponse - public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public ApiResponse UploadFileWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) { // verify the required parameter 'petId' is set if (petId == null) @@ -1689,7 +1689,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public async System.Threading.Tasks.Task UploadFileAsync (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) { ApiResponse localVarResponse = await UploadFileAsyncWithHttpInfo(petId, additionalMetadata, file); return localVarResponse.Data; @@ -1704,7 +1704,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// Task of ApiResponse (ApiResponse) - public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) { // verify the required parameter 'petId' is set if (petId == null) @@ -1769,7 +1769,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// ApiResponse - public ApiResponse UploadFileWithRequiredFile (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) + public ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) { ApiResponse localVarResponse = UploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata); return localVarResponse.Data; @@ -1783,7 +1783,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// ApiResponse of ApiResponse - public ApiResponse< ApiResponse > UploadFileWithRequiredFileWithHttpInfo (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) + public ApiResponse UploadFileWithRequiredFileWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) { // verify the required parameter 'petId' is set if (petId == null) @@ -1851,7 +1851,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) + public async System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) { ApiResponse localVarResponse = await UploadFileWithRequiredFileAsyncWithHttpInfo(petId, requiredFile, additionalMetadata); return localVarResponse.Data; @@ -1866,7 +1866,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// Task of ApiResponse (ApiResponse) - public async System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) + public async System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) { // verify the required parameter 'petId' is set if (petId == null) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/StoreApi.cs index 2823afda29c..c7e01ce602b 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/StoreApi.cs @@ -52,8 +52,8 @@ namespace Org.OpenAPITools.Api /// Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Dictionary<string, int?> - Dictionary GetInventory (); + /// Dictionary<string, int> + Dictionary GetInventory (); /// /// Returns pet inventories by status @@ -62,8 +62,8 @@ namespace Org.OpenAPITools.Api /// Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// ApiResponse of Dictionary<string, int?> - ApiResponse> GetInventoryWithHttpInfo (); + /// ApiResponse of Dictionary<string, int> + ApiResponse> GetInventoryWithHttpInfo (); /// /// Find purchase order by ID /// @@ -73,7 +73,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Order - Order GetOrderById (long? orderId); + Order GetOrderById (long orderId); /// /// Find purchase order by ID @@ -84,7 +84,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// ApiResponse of Order - ApiResponse GetOrderByIdWithHttpInfo (long? orderId); + ApiResponse GetOrderByIdWithHttpInfo (long orderId); /// /// Place an order for a pet /// @@ -136,8 +136,8 @@ namespace Org.OpenAPITools.Api /// Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Task of Dictionary<string, int?> - System.Threading.Tasks.Task> GetInventoryAsync (); + /// Task of Dictionary<string, int> + System.Threading.Tasks.Task> GetInventoryAsync (); /// /// Returns pet inventories by status @@ -146,8 +146,8 @@ namespace Org.OpenAPITools.Api /// Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Task of ApiResponse (Dictionary<string, int?>) - System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (); + /// Task of ApiResponse (Dictionary<string, int>) + System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (); /// /// Find purchase order by ID /// @@ -157,7 +157,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Task of Order - System.Threading.Tasks.Task GetOrderByIdAsync (long? orderId); + System.Threading.Tasks.Task GetOrderByIdAsync (long orderId); /// /// Find purchase order by ID @@ -168,7 +168,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Task of ApiResponse (Order) - System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long? orderId); + System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId); /// /// Place an order for a pet /// @@ -434,10 +434,10 @@ namespace Org.OpenAPITools.Api /// Returns pet inventories by status Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Dictionary<string, int?> - public Dictionary GetInventory () + /// Dictionary<string, int> + public Dictionary GetInventory () { - ApiResponse> localVarResponse = GetInventoryWithHttpInfo(); + ApiResponse> localVarResponse = GetInventoryWithHttpInfo(); return localVarResponse.Data; } @@ -445,8 +445,8 @@ namespace Org.OpenAPITools.Api /// Returns pet inventories by status Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// ApiResponse of Dictionary<string, int?> - public ApiResponse< Dictionary > GetInventoryWithHttpInfo () + /// ApiResponse of Dictionary<string, int> + public ApiResponse> GetInventoryWithHttpInfo () { var localVarPath = "./store/inventory"; @@ -490,19 +490,19 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse>(localVarStatusCode, + return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), - (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); + (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); } /// /// Returns pet inventories by status Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Task of Dictionary<string, int?> - public async System.Threading.Tasks.Task> GetInventoryAsync () + /// Task of Dictionary<string, int> + public async System.Threading.Tasks.Task> GetInventoryAsync () { - ApiResponse> localVarResponse = await GetInventoryAsyncWithHttpInfo(); + ApiResponse> localVarResponse = await GetInventoryAsyncWithHttpInfo(); return localVarResponse.Data; } @@ -511,8 +511,8 @@ namespace Org.OpenAPITools.Api /// Returns pet inventories by status Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Task of ApiResponse (Dictionary<string, int?>) - public async System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo () + /// Task of ApiResponse (Dictionary<string, int>) + public async System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo () { var localVarPath = "./store/inventory"; @@ -556,9 +556,9 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse>(localVarStatusCode, + return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), - (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); + (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); } /// @@ -567,7 +567,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Order - public Order GetOrderById (long? orderId) + public Order GetOrderById (long orderId) { ApiResponse localVarResponse = GetOrderByIdWithHttpInfo(orderId); return localVarResponse.Data; @@ -579,7 +579,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// ApiResponse of Order - public ApiResponse< Order > GetOrderByIdWithHttpInfo (long? orderId) + public ApiResponse GetOrderByIdWithHttpInfo (long orderId) { // verify the required parameter 'orderId' is set if (orderId == null) @@ -634,7 +634,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Task of Order - public async System.Threading.Tasks.Task GetOrderByIdAsync (long? orderId) + public async System.Threading.Tasks.Task GetOrderByIdAsync (long orderId) { ApiResponse localVarResponse = await GetOrderByIdAsyncWithHttpInfo(orderId); return localVarResponse.Data; @@ -647,7 +647,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Task of ApiResponse (Order) - public async System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long? orderId) + public async System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId) { // verify the required parameter 'orderId' is set if (orderId == null) @@ -714,7 +714,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// order placed for purchasing the pet /// ApiResponse of Order - public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body) + public ApiResponse PlaceOrderWithHttpInfo (Order body) { // verify the required parameter 'body' is set if (body == null) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/UserApi.cs index 27a34b44a5c..0273aa89c37 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Api/UserApi.cs @@ -1053,7 +1053,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// The name that needs to be fetched. Use user1 for testing. /// ApiResponse of User - public ApiResponse< User > GetUserByNameWithHttpInfo (string username) + public ApiResponse GetUserByNameWithHttpInfo (string username) { // verify the required parameter 'username' is set if (username == null) @@ -1190,7 +1190,7 @@ namespace Org.OpenAPITools.Api /// The user name for login /// The password for login in clear text /// ApiResponse of string - public ApiResponse< string > LoginUserWithHttpInfo (string username, string password) + public ApiResponse LoginUserWithHttpInfo (string username, string password) { // verify the required parameter 'username' is set if (username == null) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs index 9cff36e9c63..c52f36924d4 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs @@ -26,7 +26,7 @@ namespace Org.OpenAPITools.Model /// AdditionalPropertiesBoolean /// [DataContract] - public partial class AdditionalPropertiesBoolean : Dictionary, IEquatable + public partial class AdditionalPropertiesBoolean : Dictionary, IEquatable { /// /// Initializes a new instance of the class. diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 45cb4e1ec3d..f56db9cd165 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -42,7 +42,7 @@ namespace Org.OpenAPITools.Model /// anytype1. /// anytype2. /// anytype3. - public AdditionalPropertiesClass(Dictionary mapString = default(Dictionary), Dictionary mapNumber = default(Dictionary), Dictionary mapInteger = default(Dictionary), Dictionary mapBoolean = default(Dictionary), Dictionary> mapArrayInteger = default(Dictionary>), Dictionary> mapArrayAnytype = default(Dictionary>), Dictionary> mapMapString = default(Dictionary>), Dictionary> mapMapAnytype = default(Dictionary>), Object anytype1 = default(Object), Object anytype2 = default(Object), Object anytype3 = default(Object)) + public AdditionalPropertiesClass(Dictionary mapString = default(Dictionary), Dictionary mapNumber = default(Dictionary), Dictionary mapInteger = default(Dictionary), Dictionary mapBoolean = default(Dictionary), Dictionary> mapArrayInteger = default(Dictionary>), Dictionary> mapArrayAnytype = default(Dictionary>), Dictionary> mapMapString = default(Dictionary>), Dictionary> mapMapAnytype = default(Dictionary>), Object anytype1 = default(Object), Object anytype2 = default(Object), Object anytype3 = default(Object)) { this.MapString = mapString; this.MapNumber = mapNumber; @@ -67,25 +67,25 @@ namespace Org.OpenAPITools.Model /// Gets or Sets MapNumber /// [DataMember(Name="map_number", EmitDefaultValue=false)] - public Dictionary MapNumber { get; set; } + public Dictionary MapNumber { get; set; } /// /// Gets or Sets MapInteger /// [DataMember(Name="map_integer", EmitDefaultValue=false)] - public Dictionary MapInteger { get; set; } + public Dictionary MapInteger { get; set; } /// /// Gets or Sets MapBoolean /// [DataMember(Name="map_boolean", EmitDefaultValue=false)] - public Dictionary MapBoolean { get; set; } + public Dictionary MapBoolean { get; set; } /// /// Gets or Sets MapArrayInteger /// [DataMember(Name="map_array_integer", EmitDefaultValue=false)] - public Dictionary> MapArrayInteger { get; set; } + public Dictionary> MapArrayInteger { get; set; } /// /// Gets or Sets MapArrayAnytype diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs index bf955fdfa3c..522847f7b16 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs @@ -26,7 +26,7 @@ namespace Org.OpenAPITools.Model /// AdditionalPropertiesInteger /// [DataContract] - public partial class AdditionalPropertiesInteger : Dictionary, IEquatable + public partial class AdditionalPropertiesInteger : Dictionary, IEquatable { /// /// Initializes a new instance of the class. diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs index 884374ab277..cc739022c18 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs @@ -26,7 +26,7 @@ namespace Org.OpenAPITools.Model /// AdditionalPropertiesNumber /// [DataContract] - public partial class AdditionalPropertiesNumber : Dictionary, IEquatable + public partial class AdditionalPropertiesNumber : Dictionary, IEquatable { /// /// Initializes a new instance of the class. diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/ApiResponse.cs index ac9b07f03ed..108ca344e67 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -34,7 +34,7 @@ namespace Org.OpenAPITools.Model /// code. /// type. /// message. - public ApiResponse(int? code = default(int?), string type = default(string), string message = default(string)) + public ApiResponse(int code = default(int), string type = default(string), string message = default(string)) { this.Code = code; this.Type = type; @@ -45,7 +45,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Code /// [DataMember(Name="code", EmitDefaultValue=false)] - public int? Code { get; set; } + public int Code { get; set; } /// /// Gets or Sets Type diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 3fc75a44373..b95c1002b76 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -32,7 +32,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// arrayArrayNumber. - public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber = default(List>)) + public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber = default(List>)) { this.ArrayArrayNumber = arrayArrayNumber; } @@ -41,7 +41,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets ArrayArrayNumber /// [DataMember(Name="ArrayArrayNumber", EmitDefaultValue=false)] - public List> ArrayArrayNumber { get; set; } + public List> ArrayArrayNumber { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index b9f18a8f275..0b6c8afe9eb 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -32,7 +32,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// arrayNumber. - public ArrayOfNumberOnly(List arrayNumber = default(List)) + public ArrayOfNumberOnly(List arrayNumber = default(List)) { this.ArrayNumber = arrayNumber; } @@ -41,7 +41,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets ArrayNumber /// [DataMember(Name="ArrayNumber", EmitDefaultValue=false)] - public List ArrayNumber { get; set; } + public List ArrayNumber { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/ArrayTest.cs index 8ae85144836..ab309bde6b2 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -34,7 +34,7 @@ namespace Org.OpenAPITools.Model /// arrayOfString. /// arrayArrayOfInteger. /// arrayArrayOfModel. - public ArrayTest(List arrayOfString = default(List), List> arrayArrayOfInteger = default(List>), List> arrayArrayOfModel = default(List>)) + public ArrayTest(List arrayOfString = default(List), List> arrayArrayOfInteger = default(List>), List> arrayArrayOfModel = default(List>)) { this.ArrayOfString = arrayOfString; this.ArrayArrayOfInteger = arrayArrayOfInteger; @@ -51,7 +51,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets ArrayArrayOfInteger /// [DataMember(Name="array_array_of_integer", EmitDefaultValue=false)] - public List> ArrayArrayOfInteger { get; set; } + public List> ArrayArrayOfInteger { get; set; } /// /// Gets or Sets ArrayArrayOfModel diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Cat.cs index 57ff36b41d9..9659342cda9 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Cat.cs @@ -37,7 +37,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// declawed. - public Cat(bool? declawed = default(bool?), string className = default(string), string color = "red") : base(className, color) + public Cat(bool declawed = default(bool), string className = default(string), string color = "red") : base(className, color) { this.Declawed = declawed; } @@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Declawed /// [DataMember(Name="declawed", EmitDefaultValue=false)] - public bool? Declawed { get; set; } + public bool Declawed { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/CatAllOf.cs index f8cd1ab68db..82278839b40 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/CatAllOf.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -32,7 +32,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// declawed. - public CatAllOf(bool? declawed = default(bool?)) + public CatAllOf(bool declawed = default(bool)) { this.Declawed = declawed; } @@ -41,7 +41,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Declawed /// [DataMember(Name="declawed", EmitDefaultValue=false)] - public bool? Declawed { get; set; } + public bool Declawed { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Category.cs index a53ef65cbf6..845a5fba42f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Category.cs @@ -38,7 +38,7 @@ namespace Org.OpenAPITools.Model /// /// id. /// name (required) (default to "default-name"). - public Category(long? id = default(long?), string name = "default-name") + public Category(long id = default(long), string name = "default-name") { // to ensure "name" is required (not null) if (name == null) @@ -57,7 +57,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Name diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/FormatTest.cs index 9ac79674298..38e06b90271 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/FormatTest.cs @@ -49,7 +49,7 @@ namespace Org.OpenAPITools.Model /// dateTime. /// uuid. /// password (required). - public FormatTest(int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), decimal? number = default(decimal?), float? _float = default(float?), double? _double = default(double?), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), Guid? uuid = default(Guid?), string password = default(string)) + public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string)) { // to ensure "number" is required (not null) if (number == null) @@ -106,37 +106,37 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Integer /// [DataMember(Name="integer", EmitDefaultValue=false)] - public int? Integer { get; set; } + public int Integer { get; set; } /// /// Gets or Sets Int32 /// [DataMember(Name="int32", EmitDefaultValue=false)] - public int? Int32 { get; set; } + public int Int32 { get; set; } /// /// Gets or Sets Int64 /// [DataMember(Name="int64", EmitDefaultValue=false)] - public long? Int64 { get; set; } + public long Int64 { get; set; } /// /// Gets or Sets Number /// [DataMember(Name="number", EmitDefaultValue=false)] - public decimal? Number { get; set; } + public decimal Number { get; set; } /// /// Gets or Sets Float /// [DataMember(Name="float", EmitDefaultValue=false)] - public float? Float { get; set; } + public float Float { get; set; } /// /// Gets or Sets Double /// [DataMember(Name="double", EmitDefaultValue=false)] - public double? Double { get; set; } + public double Double { get; set; } /// /// Gets or Sets String @@ -161,19 +161,19 @@ namespace Org.OpenAPITools.Model /// [DataMember(Name="date", EmitDefaultValue=false)] [JsonConverter(typeof(OpenAPIDateConverter))] - public DateTime? Date { get; set; } + public DateTime Date { get; set; } /// /// Gets or Sets DateTime /// [DataMember(Name="dateTime", EmitDefaultValue=false)] - public DateTime? DateTime { get; set; } + public DateTime DateTime { get; set; } /// /// Gets or Sets Uuid /// [DataMember(Name="uuid", EmitDefaultValue=false)] - public Guid? Uuid { get; set; } + public Guid Uuid { get; set; } /// /// Gets or Sets Password diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/MapTest.cs index 68cde151bfd..3c76047cfb6 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/MapTest.cs @@ -61,7 +61,7 @@ namespace Org.OpenAPITools.Model /// mapOfEnumString. /// directMap. /// indirectMap. - public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary), Dictionary directMap = default(Dictionary), Dictionary indirectMap = default(Dictionary)) + public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary), Dictionary directMap = default(Dictionary), Dictionary indirectMap = default(Dictionary)) { this.MapMapOfString = mapMapOfString; this.MapOfEnumString = mapOfEnumString; @@ -80,13 +80,13 @@ namespace Org.OpenAPITools.Model /// Gets or Sets DirectMap /// [DataMember(Name="direct_map", EmitDefaultValue=false)] - public Dictionary DirectMap { get; set; } + public Dictionary DirectMap { get; set; } /// /// Gets or Sets IndirectMap /// [DataMember(Name="indirect_map", EmitDefaultValue=false)] - public Dictionary IndirectMap { get; set; } + public Dictionary IndirectMap { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 6215ed4a003..3ec46aea273 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -34,7 +34,7 @@ namespace Org.OpenAPITools.Model /// uuid. /// dateTime. /// map. - public MixedPropertiesAndAdditionalPropertiesClass(Guid? uuid = default(Guid?), DateTime? dateTime = default(DateTime?), Dictionary map = default(Dictionary)) + public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) { this.Uuid = uuid; this.DateTime = dateTime; @@ -45,13 +45,13 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Uuid /// [DataMember(Name="uuid", EmitDefaultValue=false)] - public Guid? Uuid { get; set; } + public Guid Uuid { get; set; } /// /// Gets or Sets DateTime /// [DataMember(Name="dateTime", EmitDefaultValue=false)] - public DateTime? DateTime { get; set; } + public DateTime DateTime { get; set; } /// /// Gets or Sets Map diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Model200Response.cs index c29e2a2924f..9b18e50452d 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Model200Response.cs @@ -33,7 +33,7 @@ namespace Org.OpenAPITools.Model /// /// name. /// _class. - public Model200Response(int? name = default(int?), string _class = default(string)) + public Model200Response(int name = default(int), string _class = default(string)) { this.Name = name; this.Class = _class; @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Name /// [DataMember(Name="name", EmitDefaultValue=false)] - public int? Name { get; set; } + public int Name { get; set; } /// /// Gets or Sets Class diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Name.cs index c1c01fd3692..fa62132db17 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Name.cs @@ -38,7 +38,7 @@ namespace Org.OpenAPITools.Model /// /// name (required). /// property. - public Name(int? name = default(int?), string property = default(string)) + public Name(int name = default(int), string property = default(string)) { // to ensure "name" is required (not null) if (name == null) @@ -57,13 +57,13 @@ namespace Org.OpenAPITools.Model /// Gets or Sets _Name /// [DataMember(Name="name", EmitDefaultValue=false)] - public int? _Name { get; set; } + public int _Name { get; set; } /// /// Gets or Sets SnakeCase /// [DataMember(Name="snake_case", EmitDefaultValue=false)] - public int? SnakeCase { get; private set; } + public int SnakeCase { get; private set; } /// /// Gets or Sets Property @@ -75,7 +75,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets _123Number /// [DataMember(Name="123Number", EmitDefaultValue=false)] - public int? _123Number { get; private set; } + public int _123Number { get; private set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/NumberOnly.cs index af8ca238a50..a9d51b7970e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -32,7 +32,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// justNumber. - public NumberOnly(decimal? justNumber = default(decimal?)) + public NumberOnly(decimal justNumber = default(decimal)) { this.JustNumber = justNumber; } @@ -41,7 +41,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets JustNumber /// [DataMember(Name="JustNumber", EmitDefaultValue=false)] - public decimal? JustNumber { get; set; } + public decimal JustNumber { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Order.cs index 2b42e6adbd8..18736e60d77 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Order.cs @@ -70,7 +70,7 @@ namespace Org.OpenAPITools.Model /// shipDate. /// Order Status. /// complete (default to false). - public Order(long? id = default(long?), long? petId = default(long?), int? quantity = default(int?), DateTime? shipDate = default(DateTime?), StatusEnum? status = default(StatusEnum?), bool? complete = false) + public Order(long id = default(long), long petId = default(long), int quantity = default(int), DateTime shipDate = default(DateTime), StatusEnum? status = default(StatusEnum?), bool complete = false) { this.Id = id; this.PetId = petId; @@ -92,32 +92,32 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets PetId /// [DataMember(Name="petId", EmitDefaultValue=false)] - public long? PetId { get; set; } + public long PetId { get; set; } /// /// Gets or Sets Quantity /// [DataMember(Name="quantity", EmitDefaultValue=false)] - public int? Quantity { get; set; } + public int Quantity { get; set; } /// /// Gets or Sets ShipDate /// [DataMember(Name="shipDate", EmitDefaultValue=false)] - public DateTime? ShipDate { get; set; } + public DateTime ShipDate { get; set; } /// /// Gets or Sets Complete /// [DataMember(Name="complete", EmitDefaultValue=false)] - public bool? Complete { get; set; } + public bool Complete { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/OuterComposite.cs index 5c8fa1b4401..6b378405b74 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -34,7 +34,7 @@ namespace Org.OpenAPITools.Model /// myNumber. /// myString. /// myBoolean. - public OuterComposite(decimal? myNumber = default(decimal?), string myString = default(string), bool? myBoolean = default(bool?)) + public OuterComposite(decimal myNumber = default(decimal), string myString = default(string), bool myBoolean = default(bool)) { this.MyNumber = myNumber; this.MyString = myString; @@ -45,7 +45,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets MyNumber /// [DataMember(Name="my_number", EmitDefaultValue=false)] - public decimal? MyNumber { get; set; } + public decimal MyNumber { get; set; } /// /// Gets or Sets MyString @@ -57,7 +57,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets MyBoolean /// [DataMember(Name="my_boolean", EmitDefaultValue=false)] - public bool? MyBoolean { get; set; } + public bool MyBoolean { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Pet.cs index 15811f90016..3e1f5c228bc 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Pet.cs @@ -75,7 +75,7 @@ namespace Org.OpenAPITools.Model /// photoUrls (required). /// tags. /// pet status in the store. - public Pet(long? id = default(long?), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) + public Pet(long id = default(long), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) { // to ensure "name" is required (not null) if (name == null) @@ -107,7 +107,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Category diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Return.cs index 96b60164ffd..3fac5a53eb7 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Return.cs @@ -32,7 +32,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// _return. - public Return(int? _return = default(int?)) + public Return(int _return = default(int)) { this._Return = _return; } @@ -41,7 +41,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets _Return /// [DataMember(Name="return", EmitDefaultValue=false)] - public int? _Return { get; set; } + public int _Return { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/SpecialModelName.cs index 92d0bf77567..e16b6bfc0e8 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -32,7 +32,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// specialPropertyName. - public SpecialModelName(long? specialPropertyName = default(long?)) + public SpecialModelName(long specialPropertyName = default(long)) { this.SpecialPropertyName = specialPropertyName; } @@ -41,7 +41,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets SpecialPropertyName /// [DataMember(Name="$special[property.name]", EmitDefaultValue=false)] - public long? SpecialPropertyName { get; set; } + public long SpecialPropertyName { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Tag.cs index 1ad145982c4..f5017864dec 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Tag.cs @@ -33,7 +33,7 @@ namespace Org.OpenAPITools.Model /// /// id. /// name. - public Tag(long? id = default(long?), string name = default(string)) + public Tag(long id = default(long), string name = default(string)) { this.Id = id; this.Name = name; @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Name diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/TypeHolderDefault.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/TypeHolderDefault.cs index b5507bbf256..93307c2324a 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/TypeHolderDefault.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/TypeHolderDefault.cs @@ -41,7 +41,7 @@ namespace Org.OpenAPITools.Model /// integerItem (required). /// boolItem (required) (default to true). /// arrayItem (required). - public TypeHolderDefault(string stringItem = "what", decimal? numberItem = default(decimal?), int? integerItem = default(int?), bool? boolItem = true, List arrayItem = default(List)) + public TypeHolderDefault(string stringItem = "what", decimal numberItem = default(decimal), int integerItem = default(int), bool boolItem = true, List arrayItem = default(List)) { // to ensure "stringItem" is required (not null) if (stringItem == null) @@ -105,25 +105,25 @@ namespace Org.OpenAPITools.Model /// Gets or Sets NumberItem /// [DataMember(Name="number_item", EmitDefaultValue=false)] - public decimal? NumberItem { get; set; } + public decimal NumberItem { get; set; } /// /// Gets or Sets IntegerItem /// [DataMember(Name="integer_item", EmitDefaultValue=false)] - public int? IntegerItem { get; set; } + public int IntegerItem { get; set; } /// /// Gets or Sets BoolItem /// [DataMember(Name="bool_item", EmitDefaultValue=false)] - public bool? BoolItem { get; set; } + public bool BoolItem { get; set; } /// /// Gets or Sets ArrayItem /// [DataMember(Name="array_item", EmitDefaultValue=false)] - public List ArrayItem { get; set; } + public List ArrayItem { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/TypeHolderExample.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/TypeHolderExample.cs index 7603fe142df..171fa8b99ff 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/TypeHolderExample.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/TypeHolderExample.cs @@ -41,7 +41,7 @@ namespace Org.OpenAPITools.Model /// integerItem (required). /// boolItem (required). /// arrayItem (required). - public TypeHolderExample(string stringItem = default(string), decimal? numberItem = default(decimal?), int? integerItem = default(int?), bool? boolItem = default(bool?), List arrayItem = default(List)) + public TypeHolderExample(string stringItem = default(string), decimal numberItem = default(decimal), int integerItem = default(int), bool boolItem = default(bool), List arrayItem = default(List)) { // to ensure "stringItem" is required (not null) if (stringItem == null) @@ -105,25 +105,25 @@ namespace Org.OpenAPITools.Model /// Gets or Sets NumberItem /// [DataMember(Name="number_item", EmitDefaultValue=false)] - public decimal? NumberItem { get; set; } + public decimal NumberItem { get; set; } /// /// Gets or Sets IntegerItem /// [DataMember(Name="integer_item", EmitDefaultValue=false)] - public int? IntegerItem { get; set; } + public int IntegerItem { get; set; } /// /// Gets or Sets BoolItem /// [DataMember(Name="bool_item", EmitDefaultValue=false)] - public bool? BoolItem { get; set; } + public bool BoolItem { get; set; } /// /// Gets or Sets ArrayItem /// [DataMember(Name="array_item", EmitDefaultValue=false)] - public List ArrayItem { get; set; } + public List ArrayItem { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/User.cs index 9933c347cbf..7d119882806 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/User.cs @@ -39,7 +39,7 @@ namespace Org.OpenAPITools.Model /// password. /// phone. /// User Status. - public User(long? id = default(long?), string username = default(string), string firstName = default(string), string lastName = default(string), string email = default(string), string password = default(string), string phone = default(string), int? userStatus = default(int?)) + public User(long id = default(long), string username = default(string), string firstName = default(string), string lastName = default(string), string email = default(string), string password = default(string), string phone = default(string), int userStatus = default(int)) { this.Id = id; this.Username = username; @@ -55,7 +55,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Username @@ -98,7 +98,7 @@ namespace Org.OpenAPITools.Model /// /// User Status [DataMember(Name="userStatus", EmitDefaultValue=false)] - public int? UserStatus { get; set; } + public int UserStatus { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/XmlItem.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/XmlItem.cs index e80b6bac4b3..280eedb3ad0 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/XmlItem.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/XmlItem.cs @@ -60,7 +60,7 @@ namespace Org.OpenAPITools.Model /// prefixNsBoolean. /// prefixNsArray. /// prefixNsWrappedArray. - public XmlItem(string attributeString = default(string), decimal? attributeNumber = default(decimal?), int? attributeInteger = default(int?), bool? attributeBoolean = default(bool?), List wrappedArray = default(List), string nameString = default(string), decimal? nameNumber = default(decimal?), int? nameInteger = default(int?), bool? nameBoolean = default(bool?), List nameArray = default(List), List nameWrappedArray = default(List), string prefixString = default(string), decimal? prefixNumber = default(decimal?), int? prefixInteger = default(int?), bool? prefixBoolean = default(bool?), List prefixArray = default(List), List prefixWrappedArray = default(List), string namespaceString = default(string), decimal? namespaceNumber = default(decimal?), int? namespaceInteger = default(int?), bool? namespaceBoolean = default(bool?), List namespaceArray = default(List), List namespaceWrappedArray = default(List), string prefixNsString = default(string), decimal? prefixNsNumber = default(decimal?), int? prefixNsInteger = default(int?), bool? prefixNsBoolean = default(bool?), List prefixNsArray = default(List), List prefixNsWrappedArray = default(List)) + public XmlItem(string attributeString = default(string), decimal attributeNumber = default(decimal), int attributeInteger = default(int), bool attributeBoolean = default(bool), List wrappedArray = default(List), string nameString = default(string), decimal nameNumber = default(decimal), int nameInteger = default(int), bool nameBoolean = default(bool), List nameArray = default(List), List nameWrappedArray = default(List), string prefixString = default(string), decimal prefixNumber = default(decimal), int prefixInteger = default(int), bool prefixBoolean = default(bool), List prefixArray = default(List), List prefixWrappedArray = default(List), string namespaceString = default(string), decimal namespaceNumber = default(decimal), int namespaceInteger = default(int), bool namespaceBoolean = default(bool), List namespaceArray = default(List), List namespaceWrappedArray = default(List), string prefixNsString = default(string), decimal prefixNsNumber = default(decimal), int prefixNsInteger = default(int), bool prefixNsBoolean = default(bool), List prefixNsArray = default(List), List prefixNsWrappedArray = default(List)) { this.AttributeString = attributeString; this.AttributeNumber = attributeNumber; @@ -103,25 +103,25 @@ namespace Org.OpenAPITools.Model /// Gets or Sets AttributeNumber /// [DataMember(Name="attribute_number", EmitDefaultValue=false)] - public decimal? AttributeNumber { get; set; } + public decimal AttributeNumber { get; set; } /// /// Gets or Sets AttributeInteger /// [DataMember(Name="attribute_integer", EmitDefaultValue=false)] - public int? AttributeInteger { get; set; } + public int AttributeInteger { get; set; } /// /// Gets or Sets AttributeBoolean /// [DataMember(Name="attribute_boolean", EmitDefaultValue=false)] - public bool? AttributeBoolean { get; set; } + public bool AttributeBoolean { get; set; } /// /// Gets or Sets WrappedArray /// [DataMember(Name="wrapped_array", EmitDefaultValue=false)] - public List WrappedArray { get; set; } + public List WrappedArray { get; set; } /// /// Gets or Sets NameString @@ -133,31 +133,31 @@ namespace Org.OpenAPITools.Model /// Gets or Sets NameNumber /// [DataMember(Name="name_number", EmitDefaultValue=false)] - public decimal? NameNumber { get; set; } + public decimal NameNumber { get; set; } /// /// Gets or Sets NameInteger /// [DataMember(Name="name_integer", EmitDefaultValue=false)] - public int? NameInteger { get; set; } + public int NameInteger { get; set; } /// /// Gets or Sets NameBoolean /// [DataMember(Name="name_boolean", EmitDefaultValue=false)] - public bool? NameBoolean { get; set; } + public bool NameBoolean { get; set; } /// /// Gets or Sets NameArray /// [DataMember(Name="name_array", EmitDefaultValue=false)] - public List NameArray { get; set; } + public List NameArray { get; set; } /// /// Gets or Sets NameWrappedArray /// [DataMember(Name="name_wrapped_array", EmitDefaultValue=false)] - public List NameWrappedArray { get; set; } + public List NameWrappedArray { get; set; } /// /// Gets or Sets PrefixString @@ -169,31 +169,31 @@ namespace Org.OpenAPITools.Model /// Gets or Sets PrefixNumber /// [DataMember(Name="prefix_number", EmitDefaultValue=false)] - public decimal? PrefixNumber { get; set; } + public decimal PrefixNumber { get; set; } /// /// Gets or Sets PrefixInteger /// [DataMember(Name="prefix_integer", EmitDefaultValue=false)] - public int? PrefixInteger { get; set; } + public int PrefixInteger { get; set; } /// /// Gets or Sets PrefixBoolean /// [DataMember(Name="prefix_boolean", EmitDefaultValue=false)] - public bool? PrefixBoolean { get; set; } + public bool PrefixBoolean { get; set; } /// /// Gets or Sets PrefixArray /// [DataMember(Name="prefix_array", EmitDefaultValue=false)] - public List PrefixArray { get; set; } + public List PrefixArray { get; set; } /// /// Gets or Sets PrefixWrappedArray /// [DataMember(Name="prefix_wrapped_array", EmitDefaultValue=false)] - public List PrefixWrappedArray { get; set; } + public List PrefixWrappedArray { get; set; } /// /// Gets or Sets NamespaceString @@ -205,31 +205,31 @@ namespace Org.OpenAPITools.Model /// Gets or Sets NamespaceNumber /// [DataMember(Name="namespace_number", EmitDefaultValue=false)] - public decimal? NamespaceNumber { get; set; } + public decimal NamespaceNumber { get; set; } /// /// Gets or Sets NamespaceInteger /// [DataMember(Name="namespace_integer", EmitDefaultValue=false)] - public int? NamespaceInteger { get; set; } + public int NamespaceInteger { get; set; } /// /// Gets or Sets NamespaceBoolean /// [DataMember(Name="namespace_boolean", EmitDefaultValue=false)] - public bool? NamespaceBoolean { get; set; } + public bool NamespaceBoolean { get; set; } /// /// Gets or Sets NamespaceArray /// [DataMember(Name="namespace_array", EmitDefaultValue=false)] - public List NamespaceArray { get; set; } + public List NamespaceArray { get; set; } /// /// Gets or Sets NamespaceWrappedArray /// [DataMember(Name="namespace_wrapped_array", EmitDefaultValue=false)] - public List NamespaceWrappedArray { get; set; } + public List NamespaceWrappedArray { get; set; } /// /// Gets or Sets PrefixNsString @@ -241,31 +241,31 @@ namespace Org.OpenAPITools.Model /// Gets or Sets PrefixNsNumber /// [DataMember(Name="prefix_ns_number", EmitDefaultValue=false)] - public decimal? PrefixNsNumber { get; set; } + public decimal PrefixNsNumber { get; set; } /// /// Gets or Sets PrefixNsInteger /// [DataMember(Name="prefix_ns_integer", EmitDefaultValue=false)] - public int? PrefixNsInteger { get; set; } + public int PrefixNsInteger { get; set; } /// /// Gets or Sets PrefixNsBoolean /// [DataMember(Name="prefix_ns_boolean", EmitDefaultValue=false)] - public bool? PrefixNsBoolean { get; set; } + public bool PrefixNsBoolean { get; set; } /// /// Gets or Sets PrefixNsArray /// [DataMember(Name="prefix_ns_array", EmitDefaultValue=false)] - public List PrefixNsArray { get; set; } + public List PrefixNsArray { get; set; } /// /// Gets or Sets PrefixNsWrappedArray /// [DataMember(Name="prefix_ns_wrapped_array", EmitDefaultValue=false)] - public List PrefixNsWrappedArray { get; set; } + public List PrefixNsWrappedArray { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.openapi-generator/VERSION index 06b5019af3f..83a328a9227 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/README.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/README.md index 6319d9193e9..dcdb39631c5 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/README.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/README.md @@ -64,7 +64,7 @@ Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-p ## Getting Started ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -74,10 +74,11 @@ namespace Example { public class Example { - public void main() + public static void Main() { - var apiInstance = new AnotherFakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(Configuration.Default); var body = new ModelClient(); // ModelClient | client model try @@ -86,9 +87,11 @@ namespace Example ModelClient result = apiInstance.Call123TestSpecialTags(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/AdditionalPropertiesClass.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/AdditionalPropertiesClass.md index 32d7ffc7653..d07f57619d5 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/AdditionalPropertiesClass.md @@ -6,10 +6,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **MapString** | **Dictionary<string, string>** | | [optional] -**MapNumber** | **Dictionary<string, decimal?>** | | [optional] -**MapInteger** | **Dictionary<string, int?>** | | [optional] -**MapBoolean** | **Dictionary<string, bool?>** | | [optional] -**MapArrayInteger** | **Dictionary<string, List<int?>>** | | [optional] +**MapNumber** | **Dictionary<string, decimal>** | | [optional] +**MapInteger** | **Dictionary<string, int>** | | [optional] +**MapBoolean** | **Dictionary<string, bool>** | | [optional] +**MapArrayInteger** | **Dictionary<string, List<int>>** | | [optional] **MapArrayAnytype** | **Dictionary<string, List<Object>>** | | [optional] **MapMapString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] **MapMapAnytype** | **Dictionary<string, Dictionary<string, Object>>** | | [optional] diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/AnotherFakeApi.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/AnotherFakeApi.md index d13566caf34..5af41a1862c 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/AnotherFakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/AnotherFakeApi.md @@ -19,7 +19,7 @@ To test special tags and operation ID starting with number ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -29,9 +29,10 @@ namespace Example { public class Call123TestSpecialTagsExample { - public void main() + public static void Main() { - var apiInstance = new AnotherFakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new AnotherFakeApi(Configuration.Default); var body = new ModelClient(); // ModelClient | client model try @@ -40,9 +41,11 @@ namespace Example ModelClient result = apiInstance.Call123TestSpecialTags(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -69,6 +72,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/ApiResponse.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/ApiResponse.md index e16dea75cc2..a3b916355fd 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/ApiResponse.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/ApiResponse.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Code** | **int?** | | [optional] +**Code** | **int** | | [optional] **Type** | **string** | | [optional] **Message** | **string** | | [optional] diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/ArrayOfArrayOfNumberOnly.md index 12616c6718b..e05ea7dc240 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/ArrayOfArrayOfNumberOnly.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ArrayArrayNumber** | **List<List<decimal?>>** | | [optional] +**ArrayArrayNumber** | **List<List<decimal>>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/ArrayOfNumberOnly.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/ArrayOfNumberOnly.md index 04facf7d5d1..5f593d42929 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/ArrayOfNumberOnly.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ArrayNumber** | **List<decimal?>** | | [optional] +**ArrayNumber** | **List<decimal>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/ArrayTest.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/ArrayTest.md index 9c297f062a9..593bc2d7386 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/ArrayTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/ArrayTest.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ArrayOfString** | **List<string>** | | [optional] -**ArrayArrayOfInteger** | **List<List<long?>>** | | [optional] +**ArrayArrayOfInteger** | **List<List<long>>** | | [optional] **ArrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Cat.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Cat.md index 4545a124369..6609de8e12a 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Cat.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Cat.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ClassName** | **string** | | **Color** | **string** | | [optional] [default to "red"] -**Declawed** | **bool?** | | [optional] +**Declawed** | **bool** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/CatAllOf.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/CatAllOf.md index 1a630760455..d623d2a0a6e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/CatAllOf.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/CatAllOf.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Declawed** | **bool?** | | [optional] +**Declawed** | **bool** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Category.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Category.md index 87ad855ca6f..42102d4e508 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Category.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Category.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Name** | **string** | | [default to "default-name"] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/EnumTest.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/EnumTest.md index 8e213c3335f..f8bc67baa6a 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/EnumTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/EnumTest.md @@ -7,8 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **EnumString** | **string** | | [optional] **EnumStringRequired** | **string** | | -**EnumInteger** | **int?** | | [optional] -**EnumNumber** | **double?** | | [optional] +**EnumInteger** | **int** | | [optional] +**EnumNumber** | **double** | | [optional] **OuterEnum** | **OuterEnum** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FakeApi.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FakeApi.md index a2284ba8f3e..2738b9e1853 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FakeApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FakeApi.md @@ -31,7 +31,7 @@ this route creates an XmlItem ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -41,9 +41,10 @@ namespace Example { public class CreateXmlItemExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var xmlItem = new XmlItem(); // XmlItem | XmlItem Body try @@ -51,9 +52,11 @@ namespace Example // creates an XmlItem apiInstance.CreateXmlItem(xmlItem); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.CreateXmlItem: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -80,6 +83,11 @@ No authorization required - **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 - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -88,7 +96,7 @@ No authorization required ## FakeOuterBooleanSerialize -> bool? FakeOuterBooleanSerialize (bool? body = null) +> bool FakeOuterBooleanSerialize (bool body = null) @@ -97,7 +105,7 @@ Test serialization of outer boolean types ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -107,19 +115,22 @@ namespace Example { public class FakeOuterBooleanSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var body = true; // bool? | Input boolean as post body (optional) + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var body = true; // bool | Input boolean as post body (optional) try { - bool? result = apiInstance.FakeOuterBooleanSerialize(body); + bool result = apiInstance.FakeOuterBooleanSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterBooleanSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -131,11 +142,11 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **bool?**| Input boolean as post body | [optional] + **body** | **bool**| Input boolean as post body | [optional] ### Return type -**bool?** +**bool** ### Authorization @@ -146,6 +157,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -163,7 +179,7 @@ Test serialization of object with outer number type ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -173,9 +189,10 @@ namespace Example { public class FakeOuterCompositeSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = new OuterComposite(); // OuterComposite | Input composite as post body (optional) try @@ -183,9 +200,11 @@ namespace Example OuterComposite result = apiInstance.FakeOuterCompositeSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterCompositeSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -212,6 +231,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -220,7 +244,7 @@ No authorization required ## FakeOuterNumberSerialize -> decimal? FakeOuterNumberSerialize (decimal? body = null) +> decimal FakeOuterNumberSerialize (decimal body = null) @@ -229,7 +253,7 @@ Test serialization of outer number types ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -239,19 +263,22 @@ namespace Example { public class FakeOuterNumberSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var body = 8.14; // decimal? | Input number as post body (optional) + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var body = 8.14; // decimal | Input number as post body (optional) try { - decimal? result = apiInstance.FakeOuterNumberSerialize(body); + decimal result = apiInstance.FakeOuterNumberSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterNumberSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -263,11 +290,11 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **decimal?**| Input number as post body | [optional] + **body** | **decimal**| Input number as post body | [optional] ### Return type -**decimal?** +**decimal** ### Authorization @@ -278,6 +305,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -295,7 +327,7 @@ Test serialization of outer string types ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -305,9 +337,10 @@ namespace Example { public class FakeOuterStringSerializeExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = body_example; // string | Input string as post body (optional) try @@ -315,9 +348,11 @@ namespace Example string result = apiInstance.FakeOuterStringSerialize(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.FakeOuterStringSerialize: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -344,6 +379,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: */* +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -361,7 +401,7 @@ For this test, the body for this request much reference a schema named `File`. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -371,18 +411,21 @@ namespace Example { public class TestBodyWithFileSchemaExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = new FileSchemaTestClass(); // FileSchemaTestClass | try { apiInstance.TestBodyWithFileSchema(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestBodyWithFileSchema: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -409,6 +452,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -424,7 +472,7 @@ No authorization required ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -434,9 +482,10 @@ namespace Example { public class TestBodyWithQueryParamsExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var query = query_example; // string | var body = new User(); // User | @@ -444,9 +493,11 @@ namespace Example { apiInstance.TestBodyWithQueryParams(query, body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -474,6 +525,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -491,7 +547,7 @@ To test \"client\" model ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -501,9 +557,10 @@ namespace Example { public class TestClientModelExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var body = new ModelClient(); // ModelClient | client model try @@ -512,9 +569,11 @@ namespace Example ModelClient result = apiInstance.TestClientModel(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestClientModel: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -541,6 +600,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -549,7 +613,7 @@ No authorization required ## TestEndpointParameters -> void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) +> void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = null, int int32 = null, long int64 = null, float _float = null, string _string = null, System.IO.Stream binary = null, DateTime date = null, DateTime dateTime = null, string password = null, string callback = null) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -558,7 +622,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -568,25 +632,26 @@ namespace Example { public class TestEndpointParametersExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure HTTP basic authorization: http_basic_test Configuration.Default.Username = "YOUR_USERNAME"; Configuration.Default.Password = "YOUR_PASSWORD"; - var apiInstance = new FakeApi(); - var number = 8.14; // decimal? | None - var _double = 1.2D; // double? | None + var apiInstance = new FakeApi(Configuration.Default); + var number = 8.14; // decimal | None + var _double = 1.2D; // double | None var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None var _byte = BYTE_ARRAY_DATA_HERE; // byte[] | None - var integer = 56; // int? | None (optional) - var int32 = 56; // int? | None (optional) - var int64 = 789; // long? | None (optional) - var _float = 3.4F; // float? | None (optional) + var integer = 56; // int | None (optional) + var int32 = 56; // int | None (optional) + var int64 = 789; // long | None (optional) + var _float = 3.4F; // float | None (optional) var _string = _string_example; // string | None (optional) var binary = BINARY_DATA_HERE; // System.IO.Stream | None (optional) - var date = 2013-10-20; // DateTime? | None (optional) - var dateTime = 2013-10-20T19:20:30+01:00; // DateTime? | None (optional) + var date = 2013-10-20; // DateTime | None (optional) + var dateTime = 2013-10-20T19:20:30+01:00; // DateTime | None (optional) var password = password_example; // string | None (optional) var callback = callback_example; // string | None (optional) @@ -595,9 +660,11 @@ namespace Example // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 apiInstance.TestEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestEndpointParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -609,18 +676,18 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **number** | **decimal?**| None | - **_double** | **double?**| None | + **number** | **decimal**| None | + **_double** | **double**| None | **patternWithoutDelimiter** | **string**| None | **_byte** | **byte[]**| None | - **integer** | **int?**| None | [optional] - **int32** | **int?**| None | [optional] - **int64** | **long?**| None | [optional] - **_float** | **float?**| None | [optional] + **integer** | **int**| None | [optional] + **int32** | **int**| None | [optional] + **int64** | **long**| None | [optional] + **_float** | **float**| None | [optional] **_string** | **string**| None | [optional] **binary** | **System.IO.Stream**| None | [optional] - **date** | **DateTime?**| None | [optional] - **dateTime** | **DateTime?**| None | [optional] + **date** | **DateTime**| None | [optional] + **dateTime** | **DateTime**| None | [optional] **password** | **string**| None | [optional] **callback** | **string**| None | [optional] @@ -637,6 +704,12 @@ void (empty response body) - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -645,7 +718,7 @@ void (empty response body) ## TestEnumParameters -> void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) +> void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int enumQueryInteger = null, double enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) To test enum parameters @@ -654,7 +727,7 @@ To test enum parameters ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -664,15 +737,16 @@ namespace Example { public class TestEnumParametersExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var enumHeaderStringArray = enumHeaderStringArray_example; // List | Header parameter enum test (string array) (optional) var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg) var enumQueryStringArray = enumQueryStringArray_example; // List | Query parameter enum test (string array) (optional) var enumQueryString = enumQueryString_example; // string | Query parameter enum test (string) (optional) (default to -efg) - var enumQueryInteger = 56; // int? | Query parameter enum test (double) (optional) - var enumQueryDouble = 1.2D; // double? | Query parameter enum test (double) (optional) + var enumQueryInteger = 56; // int | Query parameter enum test (double) (optional) + var enumQueryDouble = 1.2D; // double | Query parameter enum test (double) (optional) var enumFormStringArray = new List(); // List | Form parameter enum test (string array) (optional) (default to $) var enumFormString = enumFormString_example; // string | Form parameter enum test (string) (optional) (default to -efg) @@ -681,9 +755,11 @@ namespace Example // To test enum parameters apiInstance.TestEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestEnumParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -699,8 +775,8 @@ Name | Type | Description | Notes **enumHeaderString** | **string**| Header parameter enum test (string) | [optional] [default to -efg] **enumQueryStringArray** | **List<string>**| Query parameter enum test (string array) | [optional] **enumQueryString** | **string**| Query parameter enum test (string) | [optional] [default to -efg] - **enumQueryInteger** | **int?**| Query parameter enum test (double) | [optional] - **enumQueryDouble** | **double?**| Query parameter enum test (double) | [optional] + **enumQueryInteger** | **int**| Query parameter enum test (double) | [optional] + **enumQueryDouble** | **double**| Query parameter enum test (double) | [optional] **enumFormStringArray** | [**List<string>**](string.md)| Form parameter enum test (string array) | [optional] [default to $] **enumFormString** | **string**| Form parameter enum test (string) | [optional] [default to -efg] @@ -717,6 +793,12 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -725,7 +807,7 @@ No authorization required ## TestGroupParameters -> void TestGroupParameters (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) +> void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = null, bool booleanGroup = null, long int64Group = null) Fake endpoint to test group parameters (optional) @@ -734,7 +816,7 @@ Fake endpoint to test group parameters (optional) ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -744,24 +826,27 @@ namespace Example { public class TestGroupParametersExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); - var requiredStringGroup = 56; // int? | Required String in group parameters - var requiredBooleanGroup = true; // bool? | Required Boolean in group parameters - var requiredInt64Group = 789; // long? | Required Integer in group parameters - var stringGroup = 56; // int? | String in group parameters (optional) - var booleanGroup = true; // bool? | Boolean in group parameters (optional) - var int64Group = 789; // long? | Integer in group parameters (optional) + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); + var requiredStringGroup = 56; // int | Required String in group parameters + var requiredBooleanGroup = true; // bool | Required Boolean in group parameters + var requiredInt64Group = 789; // long | Required Integer in group parameters + var stringGroup = 56; // int | String in group parameters (optional) + var booleanGroup = true; // bool | Boolean in group parameters (optional) + var int64Group = 789; // long | Integer in group parameters (optional) try { // Fake endpoint to test group parameters (optional) apiInstance.TestGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestGroupParameters: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -773,12 +858,12 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **requiredStringGroup** | **int?**| Required String in group parameters | - **requiredBooleanGroup** | **bool?**| Required Boolean in group parameters | - **requiredInt64Group** | **long?**| Required Integer in group parameters | - **stringGroup** | **int?**| String in group parameters | [optional] - **booleanGroup** | **bool?**| Boolean in group parameters | [optional] - **int64Group** | **long?**| Integer in group parameters | [optional] + **requiredStringGroup** | **int**| Required String in group parameters | + **requiredBooleanGroup** | **bool**| Required Boolean in group parameters | + **requiredInt64Group** | **long**| Required Integer in group parameters | + **stringGroup** | **int**| String in group parameters | [optional] + **booleanGroup** | **bool**| Boolean in group parameters | [optional] + **int64Group** | **long**| Integer in group parameters | [optional] ### Return type @@ -793,6 +878,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Someting wrong | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -808,7 +898,7 @@ test inline additionalProperties ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -818,9 +908,10 @@ namespace Example { public class TestInlineAdditionalPropertiesExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var param = new Dictionary(); // Dictionary | request body try @@ -828,9 +919,11 @@ namespace Example // test inline additionalProperties apiInstance.TestInlineAdditionalProperties(param); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestInlineAdditionalProperties: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -857,6 +950,11 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -872,7 +970,7 @@ test json serialization of form data ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -882,9 +980,10 @@ namespace Example { public class TestJsonFormDataExample { - public void main() + public static void Main() { - var apiInstance = new FakeApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new FakeApi(Configuration.Default); var param = param_example; // string | field1 var param2 = param2_example; // string | field2 @@ -893,9 +992,11 @@ namespace Example // test json serialization of form data apiInstance.TestJsonFormData(param, param2); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeApi.TestJsonFormData: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -923,6 +1024,11 @@ No authorization required - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FakeClassnameTags123Api.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FakeClassnameTags123Api.md index cc0cd83d12c..deb97a27697 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FakeClassnameTags123Api.md @@ -19,7 +19,7 @@ To test class name in snake case ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -29,14 +29,15 @@ namespace Example { public class TestClassnameExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key_query Configuration.Default.AddApiKey("api_key_query", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key_query", "Bearer"); - var apiInstance = new FakeClassnameTags123Api(); + var apiInstance = new FakeClassnameTags123Api(Configuration.Default); var body = new ModelClient(); // ModelClient | client model try @@ -45,9 +46,11 @@ namespace Example ModelClient result = apiInstance.TestClassname(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -74,6 +77,11 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FormatTest.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FormatTest.md index 519e940a7c8..0d921285ba1 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FormatTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/FormatTest.md @@ -5,18 +5,18 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Integer** | **int?** | | [optional] -**Int32** | **int?** | | [optional] -**Int64** | **long?** | | [optional] -**Number** | **decimal?** | | -**Float** | **float?** | | [optional] -**Double** | **double?** | | [optional] +**Integer** | **int** | | [optional] +**Int32** | **int** | | [optional] +**Int64** | **long** | | [optional] +**Number** | **decimal** | | +**Float** | **float** | | [optional] +**Double** | **double** | | [optional] **String** | **string** | | [optional] **Byte** | **byte[]** | | **Binary** | **System.IO.Stream** | | [optional] -**Date** | **DateTime?** | | -**DateTime** | **DateTime?** | | [optional] -**Uuid** | **Guid?** | | [optional] +**Date** | **DateTime** | | +**DateTime** | **DateTime** | | [optional] +**Uuid** | **Guid** | | [optional] **Password** | **string** | | [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/MapTest.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/MapTest.md index 89be5aa12cf..79d499e2cf9 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/MapTest.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/MapTest.md @@ -7,8 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **MapMapOfString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] **MapOfEnumString** | **Dictionary<string, string>** | | [optional] -**DirectMap** | **Dictionary<string, bool?>** | | [optional] -**IndirectMap** | **Dictionary<string, bool?>** | | [optional] +**DirectMap** | **Dictionary<string, bool>** | | [optional] +**IndirectMap** | **Dictionary<string, bool>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 323933588de..dd7b01e49fe 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Uuid** | **Guid?** | | [optional] -**DateTime** | **DateTime?** | | [optional] +**Uuid** | **Guid** | | [optional] +**DateTime** | **DateTime** | | [optional] **Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Model200Response.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Model200Response.md index 59918913107..7d826bca1ec 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Model200Response.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Model200Response.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **int?** | | [optional] +**Name** | **int** | | [optional] **Class** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Name.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Name.md index 80d0a9f31f3..77b9b2e7501 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Name.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Name.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Name** | **int?** | | -**SnakeCase** | **int?** | | [optional] +**_Name** | **int** | | +**SnakeCase** | **int** | | [optional] **Property** | **string** | | [optional] -**_123Number** | **int?** | | [optional] +**_123Number** | **int** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/NumberOnly.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/NumberOnly.md index 8fd05997a93..e4b08467e08 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/NumberOnly.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/NumberOnly.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**JustNumber** | **decimal?** | | [optional] +**JustNumber** | **decimal** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Order.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Order.md index f28ee2ad006..875f43a30e5 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Order.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Order.md @@ -5,12 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] -**PetId** | **long?** | | [optional] -**Quantity** | **int?** | | [optional] -**ShipDate** | **DateTime?** | | [optional] +**Id** | **long** | | [optional] +**PetId** | **long** | | [optional] +**Quantity** | **int** | | [optional] +**ShipDate** | **DateTime** | | [optional] **Status** | **string** | Order Status | [optional] -**Complete** | **bool?** | | [optional] [default to false] +**Complete** | **bool** | | [optional] [default to false] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/OuterComposite.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/OuterComposite.md index e371f712633..f381fb7fd28 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/OuterComposite.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/OuterComposite.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MyNumber** | **decimal?** | | [optional] +**MyNumber** | **decimal** | | [optional] **MyString** | **string** | | [optional] -**MyBoolean** | **bool?** | | [optional] +**MyBoolean** | **bool** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Pet.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Pet.md index 51022249270..0bd5c40fc99 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Pet.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Pet.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Category** | [**Category**](Category.md) | | [optional] **Name** | **string** | | **PhotoUrls** | **List<string>** | | diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/PetApi.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/PetApi.md index d2e2075bfd7..1a9eba14868 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/PetApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/PetApi.md @@ -25,7 +25,7 @@ Add a new pet to the store ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -35,12 +35,13 @@ namespace Example { public class AddPetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var body = new Pet(); // Pet | Pet object that needs to be added to the store try @@ -48,9 +49,11 @@ namespace Example // Add a new pet to the store apiInstance.AddPet(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.AddPet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -77,6 +80,12 @@ void (empty response body) - **Content-Type**: application/json, application/xml - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **405** | Invalid input | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -85,14 +94,14 @@ void (empty response body) ## DeletePet -> void DeletePet (long? petId, string apiKey = null) +> void DeletePet (long petId, string apiKey = null) Deletes a pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -102,13 +111,14 @@ namespace Example { public class DeletePetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var petId = 789; // long? | Pet id to delete + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | Pet id to delete var apiKey = apiKey_example; // string | (optional) try @@ -116,9 +126,11 @@ namespace Example // Deletes a pet apiInstance.DeletePet(petId, apiKey); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -130,7 +142,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| Pet id to delete | + **petId** | **long**| Pet id to delete | **apiKey** | **string**| | [optional] ### Return type @@ -146,6 +158,12 @@ void (empty response body) - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid pet value | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -154,7 +172,7 @@ void (empty response body) ## FindPetsByStatus -> List FindPetsByStatus (List status) +> List<Pet> FindPetsByStatus (List status) Finds Pets by status @@ -163,7 +181,7 @@ Multiple status values can be provided with comma separated strings ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -173,23 +191,26 @@ namespace Example { public class FindPetsByStatusExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var status = status_example; // List | Status values that need to be considered for filter try { // Finds Pets by status - List<Pet> result = apiInstance.FindPetsByStatus(status); + List result = apiInstance.FindPetsByStatus(status); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -205,7 +226,7 @@ Name | Type | Description | Notes ### Return type -[**List**](Pet.md) +[**List<Pet>**](Pet.md) ### Authorization @@ -216,6 +237,12 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -224,7 +251,7 @@ Name | Type | Description | Notes ## FindPetsByTags -> List FindPetsByTags (List tags) +> List<Pet> FindPetsByTags (List tags) Finds Pets by tags @@ -233,7 +260,7 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -243,23 +270,26 @@ namespace Example { public class FindPetsByTagsExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var tags = new List(); // List | Tags to filter by try { // Finds Pets by tags - List<Pet> result = apiInstance.FindPetsByTags(tags); + List result = apiInstance.FindPetsByTags(tags); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -275,7 +305,7 @@ Name | Type | Description | Notes ### Return type -[**List**](Pet.md) +[**List<Pet>**](Pet.md) ### Authorization @@ -286,6 +316,12 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -294,7 +330,7 @@ Name | Type | Description | Notes ## GetPetById -> Pet GetPetById (long? petId) +> Pet GetPetById (long petId) Find pet by ID @@ -303,7 +339,7 @@ Returns a single pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -313,15 +349,16 @@ namespace Example { public class GetPetByIdExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet to return + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | ID of pet to return try { @@ -329,9 +366,11 @@ namespace Example Pet result = apiInstance.GetPetById(petId); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -343,7 +382,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to return | + **petId** | **long**| ID of pet to return | ### Return type @@ -358,6 +397,13 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -373,7 +419,7 @@ Update an existing pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -383,12 +429,13 @@ namespace Example { public class UpdatePetExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); + var apiInstance = new PetApi(Configuration.Default); var body = new Pet(); // Pet | Pet object that needs to be added to the store try @@ -396,9 +443,11 @@ namespace Example // Update an existing pet apiInstance.UpdatePet(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -425,6 +474,14 @@ void (empty response body) - **Content-Type**: application/json, application/xml - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -433,14 +490,14 @@ void (empty response body) ## UpdatePetWithForm -> void UpdatePetWithForm (long? petId, string name = null, string status = null) +> void UpdatePetWithForm (long petId, string name = null, string status = null) Updates a pet in the store with form data ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -450,13 +507,14 @@ namespace Example { public class UpdatePetWithFormExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet that needs to be updated + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | ID of pet that needs to be updated var name = name_example; // string | Updated name of the pet (optional) var status = status_example; // string | Updated status of the pet (optional) @@ -465,9 +523,11 @@ namespace Example // Updates a pet in the store with form data apiInstance.UpdatePetWithForm(petId, name, status); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -479,7 +539,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet that needs to be updated | + **petId** | **long**| ID of pet that needs to be updated | **name** | **string**| Updated name of the pet | [optional] **status** | **string**| Updated status of the pet | [optional] @@ -496,6 +556,11 @@ void (empty response body) - **Content-Type**: application/x-www-form-urlencoded - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -504,14 +569,14 @@ void (empty response body) ## UploadFile -> ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null) +> ApiResponse UploadFile (long petId, string additionalMetadata = null, System.IO.Stream file = null) uploads an image ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -521,13 +586,14 @@ namespace Example { public class UploadFileExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet to update + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | ID of pet to update var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) var file = BINARY_DATA_HERE; // System.IO.Stream | file to upload (optional) @@ -537,9 +603,11 @@ namespace Example ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -551,7 +619,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to update | + **petId** | **long**| ID of pet to update | **additionalMetadata** | **string**| Additional data to pass to server | [optional] **file** | **System.IO.Stream**| file to upload | [optional] @@ -568,6 +636,11 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -576,14 +649,14 @@ Name | Type | Description | Notes ## UploadFileWithRequiredFile -> ApiResponse UploadFileWithRequiredFile (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) +> ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string additionalMetadata = null) uploads an image (required) ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -593,13 +666,14 @@ namespace Example { public class UploadFileWithRequiredFileExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure OAuth2 access token for authorization: petstore_auth Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; - var apiInstance = new PetApi(); - var petId = 789; // long? | ID of pet to update + var apiInstance = new PetApi(Configuration.Default); + var petId = 789; // long | ID of pet to update var requiredFile = BINARY_DATA_HERE; // System.IO.Stream | file to upload var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) @@ -609,9 +683,11 @@ namespace Example ApiResponse result = apiInstance.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -623,7 +699,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **long?**| ID of pet to update | + **petId** | **long**| ID of pet to update | **requiredFile** | **System.IO.Stream**| file to upload | **additionalMetadata** | **string**| Additional data to pass to server | [optional] @@ -640,6 +716,11 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Return.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Return.md index 65481f45cf2..4761c70748e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Return.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Return.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**_Return** | **int?** | | [optional] +**_Return** | **int** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/SpecialModelName.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/SpecialModelName.md index c1154219ccc..ee6489524d0 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/SpecialModelName.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/SpecialModelName.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SpecialPropertyName** | **long?** | | [optional] +**SpecialPropertyName** | **long** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/StoreApi.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/StoreApi.md index 0f6d9e4e3dc..57247772d4f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/StoreApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/StoreApi.md @@ -22,7 +22,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -32,9 +32,10 @@ namespace Example { public class DeleteOrderExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); var orderId = orderId_example; // string | ID of the order that needs to be deleted try @@ -42,9 +43,11 @@ namespace Example // Delete purchase order by ID apiInstance.DeleteOrder(orderId); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -71,6 +74,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -79,7 +88,7 @@ No authorization required ## GetInventory -> Dictionary GetInventory () +> Dictionary<string, int> GetInventory () Returns pet inventories by status @@ -88,7 +97,7 @@ Returns a map of status codes to quantities ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -98,24 +107,27 @@ namespace Example { public class GetInventoryExample { - public void main() + public static void Main() { + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; // Configure API key authorization: api_key Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // Configuration.Default.AddApiKeyPrefix("api_key", "Bearer"); - var apiInstance = new StoreApi(); + var apiInstance = new StoreApi(Configuration.Default); try { // Returns pet inventories by status - Dictionary<string, int?> result = apiInstance.GetInventory(); + Dictionary result = apiInstance.GetInventory(); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -128,7 +140,7 @@ This endpoint does not need any parameter. ### Return type -**Dictionary** +**Dictionary** ### Authorization @@ -139,6 +151,11 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -147,7 +164,7 @@ This endpoint does not need any parameter. ## GetOrderById -> Order GetOrderById (long? orderId) +> Order GetOrderById (long orderId) Find purchase order by ID @@ -156,7 +173,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -166,10 +183,11 @@ namespace Example { public class GetOrderByIdExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); - var orderId = 789; // long? | ID of pet that needs to be fetched + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); + var orderId = 789; // long | ID of pet that needs to be fetched try { @@ -177,9 +195,11 @@ namespace Example Order result = apiInstance.GetOrderById(orderId); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -191,7 +211,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **long?**| ID of pet that needs to be fetched | + **orderId** | **long**| ID of pet that needs to be fetched | ### Return type @@ -206,6 +226,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -221,7 +248,7 @@ Place an order for a pet ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -231,9 +258,10 @@ namespace Example { public class PlaceOrderExample { - public void main() + public static void Main() { - var apiInstance = new StoreApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new StoreApi(Configuration.Default); var body = new Order(); // Order | order placed for purchasing the pet try @@ -242,9 +270,11 @@ namespace Example Order result = apiInstance.PlaceOrder(body); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -271,6 +301,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Tag.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Tag.md index 864cac0c8d3..f781c26f017 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Tag.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/Tag.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Name** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/TypeHolderDefault.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/TypeHolderDefault.md index d336f567ab2..0945245b213 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/TypeHolderDefault.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/TypeHolderDefault.md @@ -6,10 +6,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **StringItem** | **string** | | [default to "what"] -**NumberItem** | **decimal?** | | -**IntegerItem** | **int?** | | -**BoolItem** | **bool?** | | [default to true] -**ArrayItem** | **List<int?>** | | +**NumberItem** | **decimal** | | +**IntegerItem** | **int** | | +**BoolItem** | **bool** | | [default to true] +**ArrayItem** | **List<int>** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/TypeHolderExample.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/TypeHolderExample.md index 8f9ec66939e..e92681b8cba 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/TypeHolderExample.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/TypeHolderExample.md @@ -6,10 +6,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **StringItem** | **string** | | -**NumberItem** | **decimal?** | | -**IntegerItem** | **int?** | | -**BoolItem** | **bool?** | | -**ArrayItem** | **List<int?>** | | +**NumberItem** | **decimal** | | +**IntegerItem** | **int** | | +**BoolItem** | **bool** | | +**ArrayItem** | **List<int>** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/User.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/User.md index 6faa1df688d..a25c25d1aa0 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/User.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/User.md @@ -5,14 +5,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | **long?** | | [optional] +**Id** | **long** | | [optional] **Username** | **string** | | [optional] **FirstName** | **string** | | [optional] **LastName** | **string** | | [optional] **Email** | **string** | | [optional] **Password** | **string** | | [optional] **Phone** | **string** | | [optional] -**UserStatus** | **int?** | User Status | [optional] +**UserStatus** | **int** | User Status | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/UserApi.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/UserApi.md index b9f592bdd71..1385d840413 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/UserApi.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/UserApi.md @@ -26,7 +26,7 @@ This can only be done by the logged in user. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -36,9 +36,10 @@ namespace Example { public class CreateUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var body = new User(); // User | Created user object try @@ -46,9 +47,11 @@ namespace Example // Create user apiInstance.CreateUser(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -75,6 +78,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -90,7 +98,7 @@ Creates list of users with given input array ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -100,9 +108,10 @@ namespace Example { public class CreateUsersWithArrayInputExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var body = new List(); // List | List of user object try @@ -110,9 +119,11 @@ namespace Example // Creates list of users with given input array apiInstance.CreateUsersWithArrayInput(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -124,7 +135,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -139,6 +150,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -154,7 +170,7 @@ Creates list of users with given input array ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -164,9 +180,10 @@ namespace Example { public class CreateUsersWithListInputExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var body = new List(); // List | List of user object try @@ -174,9 +191,11 @@ namespace Example // Creates list of users with given input array apiInstance.CreateUsersWithListInput(body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -188,7 +207,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -203,6 +222,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -220,7 +244,7 @@ This can only be done by the logged in user. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -230,9 +254,10 @@ namespace Example { public class DeleteUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The name that needs to be deleted try @@ -240,9 +265,11 @@ namespace Example // Delete user apiInstance.DeleteUser(username); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -269,6 +296,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -284,7 +317,7 @@ Get user by user name ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -294,9 +327,10 @@ namespace Example { public class GetUserByNameExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The name that needs to be fetched. Use user1 for testing. try @@ -305,9 +339,11 @@ namespace Example User result = apiInstance.GetUserByName(username); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -334,6 +370,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -349,7 +392,7 @@ Logs user into the system ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -359,9 +402,10 @@ namespace Example { public class LoginUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | The user name for login var password = password_example; // string | The password for login in clear text @@ -371,9 +415,11 @@ namespace Example string result = apiInstance.LoginUser(username, password); Debug.WriteLine(result); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -401,6 +447,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -416,7 +468,7 @@ Logs out current logged in user session ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -426,18 +478,21 @@ namespace Example { public class LogoutUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); try { // Logs out current logged in user session apiInstance.LogoutUser(); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -461,6 +516,11 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -478,7 +538,7 @@ This can only be done by the logged in user. ### Example ```csharp -using System; +using System.Collections.Generic; using System.Diagnostics; using Org.OpenAPITools.Api; using Org.OpenAPITools.Client; @@ -488,9 +548,10 @@ namespace Example { public class UpdateUserExample { - public void main() + public static void Main() { - var apiInstance = new UserApi(); + Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2"; + var apiInstance = new UserApi(Configuration.Default); var username = username_example; // string | name that need to be deleted var body = new User(); // User | Updated user object @@ -499,9 +560,11 @@ namespace Example // Updated user apiInstance.UpdateUser(username, body); } - catch (Exception e) + catch (ApiException e) { Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message ); + Debug.Print("Status Code: "+ e.ErrorCode); + Debug.Print(e.StackTrace); } } } @@ -529,6 +592,12 @@ No authorization required - **Content-Type**: Not defined - **Accept**: Not defined +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/XmlItem.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/XmlItem.md index e96ea4b0de6..0dca90c706f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/XmlItem.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/XmlItem.md @@ -6,34 +6,34 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **AttributeString** | **string** | | [optional] -**AttributeNumber** | **decimal?** | | [optional] -**AttributeInteger** | **int?** | | [optional] -**AttributeBoolean** | **bool?** | | [optional] -**WrappedArray** | **List<int?>** | | [optional] +**AttributeNumber** | **decimal** | | [optional] +**AttributeInteger** | **int** | | [optional] +**AttributeBoolean** | **bool** | | [optional] +**WrappedArray** | **List<int>** | | [optional] **NameString** | **string** | | [optional] -**NameNumber** | **decimal?** | | [optional] -**NameInteger** | **int?** | | [optional] -**NameBoolean** | **bool?** | | [optional] -**NameArray** | **List<int?>** | | [optional] -**NameWrappedArray** | **List<int?>** | | [optional] +**NameNumber** | **decimal** | | [optional] +**NameInteger** | **int** | | [optional] +**NameBoolean** | **bool** | | [optional] +**NameArray** | **List<int>** | | [optional] +**NameWrappedArray** | **List<int>** | | [optional] **PrefixString** | **string** | | [optional] -**PrefixNumber** | **decimal?** | | [optional] -**PrefixInteger** | **int?** | | [optional] -**PrefixBoolean** | **bool?** | | [optional] -**PrefixArray** | **List<int?>** | | [optional] -**PrefixWrappedArray** | **List<int?>** | | [optional] +**PrefixNumber** | **decimal** | | [optional] +**PrefixInteger** | **int** | | [optional] +**PrefixBoolean** | **bool** | | [optional] +**PrefixArray** | **List<int>** | | [optional] +**PrefixWrappedArray** | **List<int>** | | [optional] **NamespaceString** | **string** | | [optional] -**NamespaceNumber** | **decimal?** | | [optional] -**NamespaceInteger** | **int?** | | [optional] -**NamespaceBoolean** | **bool?** | | [optional] -**NamespaceArray** | **List<int?>** | | [optional] -**NamespaceWrappedArray** | **List<int?>** | | [optional] +**NamespaceNumber** | **decimal** | | [optional] +**NamespaceInteger** | **int** | | [optional] +**NamespaceBoolean** | **bool** | | [optional] +**NamespaceArray** | **List<int>** | | [optional] +**NamespaceWrappedArray** | **List<int>** | | [optional] **PrefixNsString** | **string** | | [optional] -**PrefixNsNumber** | **decimal?** | | [optional] -**PrefixNsInteger** | **int?** | | [optional] -**PrefixNsBoolean** | **bool?** | | [optional] -**PrefixNsArray** | **List<int?>** | | [optional] -**PrefixNsWrappedArray** | **List<int?>** | | [optional] +**PrefixNsNumber** | **decimal** | | [optional] +**PrefixNsInteger** | **int** | | [optional] +**PrefixNsBoolean** | **bool** | | [optional] +**PrefixNsArray** | **List<int>** | | [optional] +**PrefixNsWrappedArray** | **List<int>** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index 91ad0c3c299..142c089e706 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -197,7 +197,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > Call123TestSpecialTagsWithHttpInfo (ModelClient body) + public ApiResponse Call123TestSpecialTagsWithHttpInfo (ModelClient body) { // verify the required parameter 'body' is set if (body == null) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/FakeApi.cs index e9fbcf1cca8..b352cdd30cf 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/FakeApi.cs @@ -53,8 +53,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// bool? - bool? FakeOuterBooleanSerialize (bool? body = null); + /// bool + bool FakeOuterBooleanSerialize (bool body = default(bool)); /// /// @@ -64,8 +64,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// ApiResponse of bool? - ApiResponse FakeOuterBooleanSerializeWithHttpInfo (bool? body = null); + /// ApiResponse of bool + ApiResponse FakeOuterBooleanSerializeWithHttpInfo (bool body = default(bool)); /// /// /// @@ -75,7 +75,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// OuterComposite - OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null); + OuterComposite FakeOuterCompositeSerialize (OuterComposite body = default(OuterComposite)); /// /// @@ -86,7 +86,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// ApiResponse of OuterComposite - ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null); + ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = default(OuterComposite)); /// /// /// @@ -95,8 +95,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// decimal? - decimal? FakeOuterNumberSerialize (decimal? body = null); + /// decimal + decimal FakeOuterNumberSerialize (decimal body = default(decimal)); /// /// @@ -106,8 +106,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// ApiResponse of decimal? - ApiResponse FakeOuterNumberSerializeWithHttpInfo (decimal? body = null); + /// ApiResponse of decimal + ApiResponse FakeOuterNumberSerializeWithHttpInfo (decimal body = default(decimal)); /// /// /// @@ -117,7 +117,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// string - string FakeOuterStringSerialize (string body = null); + string FakeOuterStringSerialize (string body = default(string)); /// /// @@ -128,7 +128,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// ApiResponse of string - ApiResponse FakeOuterStringSerializeWithHttpInfo (string body = null); + ApiResponse FakeOuterStringSerializeWithHttpInfo (string body = default(string)); /// /// /// @@ -216,7 +216,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// - void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -240,7 +240,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// ApiResponse of Object(void) - ApiResponse TestEndpointParametersWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + ApiResponse TestEndpointParametersWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)); /// /// To test enum parameters /// @@ -257,7 +257,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// - void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); + void TestEnumParameters (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)); /// /// To test enum parameters @@ -275,7 +275,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// ApiResponse of Object(void) - ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); + ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)); /// /// Fake endpoint to test group parameters (optional) /// @@ -290,7 +290,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// - void TestGroupParameters (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)); /// /// Fake endpoint to test group parameters (optional) @@ -306,7 +306,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// ApiResponse of Object(void) - ApiResponse TestGroupParametersWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + ApiResponse TestGroupParametersWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)); /// /// test inline additionalProperties /// @@ -382,8 +382,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of bool? - System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = null); + /// Task of bool + System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool body = default(bool)); /// /// @@ -393,8 +393,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of ApiResponse (bool?) - System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = null); + /// Task of ApiResponse (bool) + System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool body = default(bool)); /// /// /// @@ -404,7 +404,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// Task of OuterComposite - System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null); + System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = default(OuterComposite)); /// /// @@ -415,7 +415,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// Task of ApiResponse (OuterComposite) - System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null); + System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = default(OuterComposite)); /// /// /// @@ -424,8 +424,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of decimal? - System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = null); + /// Task of decimal + System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal body = default(decimal)); /// /// @@ -435,8 +435,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of ApiResponse (decimal?) - System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = null); + /// Task of ApiResponse (decimal) + System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal body = default(decimal)); /// /// /// @@ -446,7 +446,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// Task of string - System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = null); + System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = default(string)); /// /// @@ -457,7 +457,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// Task of ApiResponse (string) - System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = null); + System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = default(string)); /// /// /// @@ -545,7 +545,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// Task of void - System.Threading.Tasks.Task TestEndpointParametersAsync (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -569,7 +569,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// Task of ApiResponse - System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null); + System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)); /// /// To test enum parameters /// @@ -586,7 +586,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// Task of void - System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); + System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)); /// /// To test enum parameters @@ -604,7 +604,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// Task of ApiResponse - System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null); + System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)); /// /// Fake endpoint to test group parameters (optional) /// @@ -619,7 +619,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// Task of void - System.Threading.Tasks.Task TestGroupParametersAsync (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + System.Threading.Tasks.Task TestGroupParametersAsync (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)); /// /// Fake endpoint to test group parameters (optional) @@ -635,7 +635,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// Task of ApiResponse - System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null); + System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)); /// /// test inline additionalProperties /// @@ -951,10 +951,10 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// bool? - public bool? FakeOuterBooleanSerialize (bool? body = null) + /// bool + public bool FakeOuterBooleanSerialize (bool body = default(bool)) { - ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -963,8 +963,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// ApiResponse of bool? - public ApiResponse< bool? > FakeOuterBooleanSerializeWithHttpInfo (bool? body = null) + /// ApiResponse of bool + public ApiResponse FakeOuterBooleanSerializeWithHttpInfo (bool body = default(bool)) { var localVarPath = "/fake/outer/boolean"; @@ -1011,9 +1011,9 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (bool?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool?))); + (bool) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool))); } /// @@ -1021,10 +1021,10 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of bool? - public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = null) + /// Task of bool + public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool body = default(bool)) { - ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -1034,8 +1034,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of ApiResponse (bool?) - public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = null) + /// Task of ApiResponse (bool) + public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool body = default(bool)) { var localVarPath = "/fake/outer/boolean"; @@ -1082,9 +1082,9 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (bool?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool?))); + (bool) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool))); } /// @@ -1093,7 +1093,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// OuterComposite - public OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) + public OuterComposite FakeOuterCompositeSerialize (OuterComposite body = default(OuterComposite)) { ApiResponse localVarResponse = FakeOuterCompositeSerializeWithHttpInfo(body); return localVarResponse.Data; @@ -1105,7 +1105,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// ApiResponse of OuterComposite - public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null) + public ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = default(OuterComposite)) { var localVarPath = "/fake/outer/composite"; @@ -1163,7 +1163,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// Task of OuterComposite - public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null) + public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = default(OuterComposite)) { ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; @@ -1176,7 +1176,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input composite as post body (optional) /// Task of ApiResponse (OuterComposite) - public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null) + public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = default(OuterComposite)) { var localVarPath = "/fake/outer/composite"; @@ -1233,10 +1233,10 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// decimal? - public decimal? FakeOuterNumberSerialize (decimal? body = null) + /// decimal + public decimal FakeOuterNumberSerialize (decimal body = default(decimal)) { - ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -1245,8 +1245,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// ApiResponse of decimal? - public ApiResponse< decimal? > FakeOuterNumberSerializeWithHttpInfo (decimal? body = null) + /// ApiResponse of decimal + public ApiResponse FakeOuterNumberSerializeWithHttpInfo (decimal body = default(decimal)) { var localVarPath = "/fake/outer/number"; @@ -1293,9 +1293,9 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (decimal?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal?))); + (decimal) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal))); } /// @@ -1303,10 +1303,10 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of decimal? - public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = null) + /// Task of decimal + public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal body = default(decimal)) { - ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -1316,8 +1316,8 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of ApiResponse (decimal?) - public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = null) + /// Task of ApiResponse (decimal) + public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal body = default(decimal)) { var localVarPath = "/fake/outer/number"; @@ -1364,9 +1364,9 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (decimal?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal?))); + (decimal) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal))); } /// @@ -1375,7 +1375,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// string - public string FakeOuterStringSerialize (string body = null) + public string FakeOuterStringSerialize (string body = default(string)) { ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); return localVarResponse.Data; @@ -1387,7 +1387,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// ApiResponse of string - public ApiResponse< string > FakeOuterStringSerializeWithHttpInfo (string body = null) + public ApiResponse FakeOuterStringSerializeWithHttpInfo (string body = default(string)) { var localVarPath = "/fake/outer/string"; @@ -1445,7 +1445,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// Task of string - public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = null) + public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = default(string)) { ApiResponse localVarResponse = await FakeOuterStringSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; @@ -1458,7 +1458,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Input string as post body (optional) /// Task of ApiResponse (string) - public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = null) + public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = default(string)) { var localVarPath = "/fake/outer/string"; @@ -1830,7 +1830,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient body) + public ApiResponse TestClientModelWithHttpInfo (ModelClient body) { // verify the required parameter 'body' is set if (body == null) @@ -1980,7 +1980,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// - public void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + public void TestEndpointParameters (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)) { TestEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); } @@ -2004,7 +2004,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// ApiResponse of Object(void) - public ApiResponse TestEndpointParametersWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + public ApiResponse TestEndpointParametersWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)) { // verify the required parameter 'number' is set if (number == null) @@ -2099,7 +2099,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// Task of void - public async System.Threading.Tasks.Task TestEndpointParametersAsync (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + public async System.Threading.Tasks.Task TestEndpointParametersAsync (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)) { await TestEndpointParametersAsyncWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, _string, binary, date, dateTime, password, callback); @@ -2124,7 +2124,7 @@ namespace Org.OpenAPITools.Api /// None (optional) /// None (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null) + public async System.Threading.Tasks.Task> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int integer = default(int), int int32 = default(int), long int64 = default(long), float _float = default(float), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), string password = default(string), string callback = default(string)) { // verify the required parameter 'number' is set if (number == null) @@ -2213,7 +2213,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// - public void TestEnumParameters (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) + public void TestEnumParameters (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)) { TestEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } @@ -2231,7 +2231,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// ApiResponse of Object(void) - public ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) + public ApiResponse TestEnumParametersWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)) { var localVarPath = "/fake"; @@ -2296,7 +2296,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// Task of void - public async System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) + public async System.Threading.Tasks.Task TestEnumParametersAsync (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)) { await TestEnumParametersAsyncWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); @@ -2315,7 +2315,7 @@ namespace Org.OpenAPITools.Api /// Form parameter enum test (string array) (optional, default to $) /// Form parameter enum test (string) (optional, default to -efg) /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = null, string enumHeaderString = null, List enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List enumFormStringArray = null, string enumFormString = null) + public async System.Threading.Tasks.Task> TestEnumParametersAsyncWithHttpInfo (List enumHeaderStringArray = default(List), string enumHeaderString = default(string), List enumQueryStringArray = default(List), string enumQueryString = default(string), int enumQueryInteger = default(int), double enumQueryDouble = default(double), List enumFormStringArray = default(List), string enumFormString = default(string)) { var localVarPath = "/fake"; @@ -2378,7 +2378,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// - public void TestGroupParameters (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + public void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)) { TestGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } @@ -2394,7 +2394,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// ApiResponse of Object(void) - public ApiResponse TestGroupParametersWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + public ApiResponse TestGroupParametersWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)) { // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup == null) @@ -2463,7 +2463,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// Task of void - public async System.Threading.Tasks.Task TestGroupParametersAsync (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + public async System.Threading.Tasks.Task TestGroupParametersAsync (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)) { await TestGroupParametersAsyncWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); @@ -2480,7 +2480,7 @@ namespace Org.OpenAPITools.Api /// Boolean in group parameters (optional) /// Integer in group parameters (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int? requiredStringGroup, bool? requiredBooleanGroup, long? requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null) + public async System.Threading.Tasks.Task> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int stringGroup = default(int), bool booleanGroup = default(bool), long int64Group = default(long)) { // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup == null) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 34496dfc87d..ed259e8ef95 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -197,7 +197,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// client model /// ApiResponse of ModelClient - public ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient body) + public ApiResponse TestClassnameWithHttpInfo (ModelClient body) { // verify the required parameter 'body' is set if (body == null) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/PetApi.cs index e5abf7996ed..2b83ede5ea2 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/PetApi.cs @@ -55,7 +55,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// - void DeletePet (long? petId, string apiKey = null); + void DeletePet (long petId, string apiKey = default(string)); /// /// Deletes a pet @@ -67,7 +67,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// ApiResponse of Object(void) - ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = null); + ApiResponse DeletePetWithHttpInfo (long petId, string apiKey = default(string)); /// /// Finds Pets by status /// @@ -119,7 +119,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Pet - Pet GetPetById (long? petId); + Pet GetPetById (long petId); /// /// Find pet by ID @@ -130,7 +130,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// ApiResponse of Pet - ApiResponse GetPetByIdWithHttpInfo (long? petId); + ApiResponse GetPetByIdWithHttpInfo (long petId); /// /// Update an existing pet /// @@ -163,7 +163,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// - void UpdatePetWithForm (long? petId, string name = null, string status = null); + void UpdatePetWithForm (long petId, string name = default(string), string status = default(string)); /// /// Updates a pet in the store with form data @@ -176,7 +176,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// ApiResponse of Object(void) - ApiResponse UpdatePetWithFormWithHttpInfo (long? petId, string name = null, string status = null); + ApiResponse UpdatePetWithFormWithHttpInfo (long petId, string name = default(string), string status = default(string)); /// /// uploads an image /// @@ -188,7 +188,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse - ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + ApiResponse UploadFile (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); /// /// uploads an image @@ -201,7 +201,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse of ApiResponse - ApiResponse UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + ApiResponse UploadFileWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); /// /// uploads an image (required) /// @@ -213,7 +213,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// ApiResponse - ApiResponse UploadFileWithRequiredFile (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null); + ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); /// /// uploads an image (required) @@ -226,7 +226,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// ApiResponse of ApiResponse - ApiResponse UploadFileWithRequiredFileWithHttpInfo (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null); + ApiResponse UploadFileWithRequiredFileWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -260,7 +260,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// Task of void - System.Threading.Tasks.Task DeletePetAsync (long? petId, string apiKey = null); + System.Threading.Tasks.Task DeletePetAsync (long petId, string apiKey = default(string)); /// /// Deletes a pet @@ -272,7 +272,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// Task of ApiResponse - System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long? petId, string apiKey = null); + System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string)); /// /// Finds Pets by status /// @@ -324,7 +324,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Task of Pet - System.Threading.Tasks.Task GetPetByIdAsync (long? petId); + System.Threading.Tasks.Task GetPetByIdAsync (long petId); /// /// Find pet by ID @@ -335,7 +335,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Task of ApiResponse (Pet) - System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long? petId); + System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId); /// /// Update an existing pet /// @@ -368,7 +368,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// Task of void - System.Threading.Tasks.Task UpdatePetWithFormAsync (long? petId, string name = null, string status = null); + System.Threading.Tasks.Task UpdatePetWithFormAsync (long petId, string name = default(string), string status = default(string)); /// /// Updates a pet in the store with form data @@ -381,7 +381,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// Task of ApiResponse - System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long? petId, string name = null, string status = null); + System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string)); /// /// uploads an image /// @@ -393,7 +393,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// Task of ApiResponse - System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + System.Threading.Tasks.Task UploadFileAsync (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); /// /// uploads an image @@ -406,7 +406,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// Task of ApiResponse (ApiResponse) - System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)); /// /// uploads an image (required) /// @@ -418,7 +418,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// Task of ApiResponse - System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null); + System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); /// /// uploads an image (required) @@ -431,7 +431,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// Task of ApiResponse (ApiResponse) - System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null); + System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)); #endregion Asynchronous Operations } @@ -709,7 +709,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// - public void DeletePet (long? petId, string apiKey = null) + public void DeletePet (long petId, string apiKey = default(string)) { DeletePetWithHttpInfo(petId, apiKey); } @@ -721,7 +721,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// ApiResponse of Object(void) - public ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = null) + public ApiResponse DeletePetWithHttpInfo (long petId, string apiKey = default(string)) { // verify the required parameter 'petId' is set if (petId == null) @@ -782,7 +782,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// Task of void - public async System.Threading.Tasks.Task DeletePetAsync (long? petId, string apiKey = null) + public async System.Threading.Tasks.Task DeletePetAsync (long petId, string apiKey = default(string)) { await DeletePetAsyncWithHttpInfo(petId, apiKey); @@ -795,7 +795,7 @@ namespace Org.OpenAPITools.Api /// Pet id to delete /// (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long? petId, string apiKey = null) + public async System.Threading.Tasks.Task> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string)) { // verify the required parameter 'petId' is set if (petId == null) @@ -867,7 +867,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Status values that need to be considered for filter /// ApiResponse of List<Pet> - public ApiResponse< List > FindPetsByStatusWithHttpInfo (List status) + public ApiResponse> FindPetsByStatusWithHttpInfo (List status) { // verify the required parameter 'status' is set if (status == null) @@ -1014,7 +1014,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// Tags to filter by /// ApiResponse of List<Pet> - public ApiResponse< List > FindPetsByTagsWithHttpInfo (List tags) + public ApiResponse> FindPetsByTagsWithHttpInfo (List tags) { // verify the required parameter 'tags' is set if (tags == null) @@ -1149,7 +1149,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Pet - public Pet GetPetById (long? petId) + public Pet GetPetById (long petId) { ApiResponse localVarResponse = GetPetByIdWithHttpInfo(petId); return localVarResponse.Data; @@ -1161,7 +1161,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// ApiResponse of Pet - public ApiResponse< Pet > GetPetByIdWithHttpInfo (long? petId) + public ApiResponse GetPetByIdWithHttpInfo (long petId) { // verify the required parameter 'petId' is set if (petId == null) @@ -1221,7 +1221,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Task of Pet - public async System.Threading.Tasks.Task GetPetByIdAsync (long? petId) + public async System.Threading.Tasks.Task GetPetByIdAsync (long petId) { ApiResponse localVarResponse = await GetPetByIdAsyncWithHttpInfo(petId); return localVarResponse.Data; @@ -1234,7 +1234,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet to return /// Task of ApiResponse (Pet) - public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long? petId) + public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHttpInfo (long petId) { // verify the required parameter 'petId' is set if (petId == null) @@ -1455,7 +1455,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// - public void UpdatePetWithForm (long? petId, string name = null, string status = null) + public void UpdatePetWithForm (long petId, string name = default(string), string status = default(string)) { UpdatePetWithFormWithHttpInfo(petId, name, status); } @@ -1468,7 +1468,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// ApiResponse of Object(void) - public ApiResponse UpdatePetWithFormWithHttpInfo (long? petId, string name = null, string status = null) + public ApiResponse UpdatePetWithFormWithHttpInfo (long petId, string name = default(string), string status = default(string)) { // verify the required parameter 'petId' is set if (petId == null) @@ -1532,7 +1532,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// Task of void - public async System.Threading.Tasks.Task UpdatePetWithFormAsync (long? petId, string name = null, string status = null) + public async System.Threading.Tasks.Task UpdatePetWithFormAsync (long petId, string name = default(string), string status = default(string)) { await UpdatePetWithFormAsyncWithHttpInfo(petId, name, status); @@ -1546,7 +1546,7 @@ namespace Org.OpenAPITools.Api /// Updated name of the pet (optional) /// Updated status of the pet (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long? petId, string name = null, string status = null) + public async System.Threading.Tasks.Task> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string)) { // verify the required parameter 'petId' is set if (petId == null) @@ -1610,7 +1610,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse - public ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public ApiResponse UploadFile (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) { ApiResponse localVarResponse = UploadFileWithHttpInfo(petId, additionalMetadata, file); return localVarResponse.Data; @@ -1624,7 +1624,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// ApiResponse of ApiResponse - public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public ApiResponse UploadFileWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) { // verify the required parameter 'petId' is set if (petId == null) @@ -1689,7 +1689,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public async System.Threading.Tasks.Task UploadFileAsync (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) { ApiResponse localVarResponse = await UploadFileAsyncWithHttpInfo(petId, additionalMetadata, file); return localVarResponse.Data; @@ -1704,7 +1704,7 @@ namespace Org.OpenAPITools.Api /// Additional data to pass to server (optional) /// file to upload (optional) /// Task of ApiResponse (ApiResponse) - public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream)) { // verify the required parameter 'petId' is set if (petId == null) @@ -1769,7 +1769,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// ApiResponse - public ApiResponse UploadFileWithRequiredFile (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) + public ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) { ApiResponse localVarResponse = UploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata); return localVarResponse.Data; @@ -1783,7 +1783,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// ApiResponse of ApiResponse - public ApiResponse< ApiResponse > UploadFileWithRequiredFileWithHttpInfo (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) + public ApiResponse UploadFileWithRequiredFileWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) { // verify the required parameter 'petId' is set if (petId == null) @@ -1851,7 +1851,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) + public async System.Threading.Tasks.Task UploadFileWithRequiredFileAsync (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) { ApiResponse localVarResponse = await UploadFileWithRequiredFileAsyncWithHttpInfo(petId, requiredFile, additionalMetadata); return localVarResponse.Data; @@ -1866,7 +1866,7 @@ namespace Org.OpenAPITools.Api /// file to upload /// Additional data to pass to server (optional) /// Task of ApiResponse (ApiResponse) - public async System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long? petId, System.IO.Stream requiredFile, string additionalMetadata = null) + public async System.Threading.Tasks.Task> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string)) { // verify the required parameter 'petId' is set if (petId == null) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/StoreApi.cs index 418c5708547..18a1678b259 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/StoreApi.cs @@ -52,8 +52,8 @@ namespace Org.OpenAPITools.Api /// Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Dictionary<string, int?> - Dictionary GetInventory (); + /// Dictionary<string, int> + Dictionary GetInventory (); /// /// Returns pet inventories by status @@ -62,8 +62,8 @@ namespace Org.OpenAPITools.Api /// Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// ApiResponse of Dictionary<string, int?> - ApiResponse> GetInventoryWithHttpInfo (); + /// ApiResponse of Dictionary<string, int> + ApiResponse> GetInventoryWithHttpInfo (); /// /// Find purchase order by ID /// @@ -73,7 +73,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Order - Order GetOrderById (long? orderId); + Order GetOrderById (long orderId); /// /// Find purchase order by ID @@ -84,7 +84,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// ApiResponse of Order - ApiResponse GetOrderByIdWithHttpInfo (long? orderId); + ApiResponse GetOrderByIdWithHttpInfo (long orderId); /// /// Place an order for a pet /// @@ -136,8 +136,8 @@ namespace Org.OpenAPITools.Api /// Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Task of Dictionary<string, int?> - System.Threading.Tasks.Task> GetInventoryAsync (); + /// Task of Dictionary<string, int> + System.Threading.Tasks.Task> GetInventoryAsync (); /// /// Returns pet inventories by status @@ -146,8 +146,8 @@ namespace Org.OpenAPITools.Api /// Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Task of ApiResponse (Dictionary<string, int?>) - System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (); + /// Task of ApiResponse (Dictionary<string, int>) + System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo (); /// /// Find purchase order by ID /// @@ -157,7 +157,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Task of Order - System.Threading.Tasks.Task GetOrderByIdAsync (long? orderId); + System.Threading.Tasks.Task GetOrderByIdAsync (long orderId); /// /// Find purchase order by ID @@ -168,7 +168,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Task of ApiResponse (Order) - System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long? orderId); + System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId); /// /// Place an order for a pet /// @@ -434,10 +434,10 @@ namespace Org.OpenAPITools.Api /// Returns pet inventories by status Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Dictionary<string, int?> - public Dictionary GetInventory () + /// Dictionary<string, int> + public Dictionary GetInventory () { - ApiResponse> localVarResponse = GetInventoryWithHttpInfo(); + ApiResponse> localVarResponse = GetInventoryWithHttpInfo(); return localVarResponse.Data; } @@ -445,8 +445,8 @@ namespace Org.OpenAPITools.Api /// Returns pet inventories by status Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// ApiResponse of Dictionary<string, int?> - public ApiResponse< Dictionary > GetInventoryWithHttpInfo () + /// ApiResponse of Dictionary<string, int> + public ApiResponse> GetInventoryWithHttpInfo () { var localVarPath = "/store/inventory"; @@ -490,19 +490,19 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse>(localVarStatusCode, + return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); + (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); } /// /// Returns pet inventories by status Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Task of Dictionary<string, int?> - public async System.Threading.Tasks.Task> GetInventoryAsync () + /// Task of Dictionary<string, int> + public async System.Threading.Tasks.Task> GetInventoryAsync () { - ApiResponse> localVarResponse = await GetInventoryAsyncWithHttpInfo(); + ApiResponse> localVarResponse = await GetInventoryAsyncWithHttpInfo(); return localVarResponse.Data; } @@ -511,8 +511,8 @@ namespace Org.OpenAPITools.Api /// Returns pet inventories by status Returns a map of status codes to quantities /// /// Thrown when fails to make API call - /// Task of ApiResponse (Dictionary<string, int?>) - public async System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo () + /// Task of ApiResponse (Dictionary<string, int>) + public async System.Threading.Tasks.Task>> GetInventoryAsyncWithHttpInfo () { var localVarPath = "/store/inventory"; @@ -556,9 +556,9 @@ namespace Org.OpenAPITools.Api if (exception != null) throw exception; } - return new ApiResponse>(localVarStatusCode, + return new ApiResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)), - (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); + (Dictionary) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dictionary))); } /// @@ -567,7 +567,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Order - public Order GetOrderById (long? orderId) + public Order GetOrderById (long orderId) { ApiResponse localVarResponse = GetOrderByIdWithHttpInfo(orderId); return localVarResponse.Data; @@ -579,7 +579,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// ApiResponse of Order - public ApiResponse< Order > GetOrderByIdWithHttpInfo (long? orderId) + public ApiResponse GetOrderByIdWithHttpInfo (long orderId) { // verify the required parameter 'orderId' is set if (orderId == null) @@ -634,7 +634,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Task of Order - public async System.Threading.Tasks.Task GetOrderByIdAsync (long? orderId) + public async System.Threading.Tasks.Task GetOrderByIdAsync (long orderId) { ApiResponse localVarResponse = await GetOrderByIdAsyncWithHttpInfo(orderId); return localVarResponse.Data; @@ -647,7 +647,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// ID of pet that needs to be fetched /// Task of ApiResponse (Order) - public async System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long? orderId) + public async System.Threading.Tasks.Task> GetOrderByIdAsyncWithHttpInfo (long orderId) { // verify the required parameter 'orderId' is set if (orderId == null) @@ -714,7 +714,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// order placed for purchasing the pet /// ApiResponse of Order - public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body) + public ApiResponse PlaceOrderWithHttpInfo (Order body) { // verify the required parameter 'body' is set if (body == null) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/UserApi.cs index e842bd87690..fa56bb06f5a 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Api/UserApi.cs @@ -1053,7 +1053,7 @@ namespace Org.OpenAPITools.Api /// Thrown when fails to make API call /// The name that needs to be fetched. Use user1 for testing. /// ApiResponse of User - public ApiResponse< User > GetUserByNameWithHttpInfo (string username) + public ApiResponse GetUserByNameWithHttpInfo (string username) { // verify the required parameter 'username' is set if (username == null) @@ -1190,7 +1190,7 @@ namespace Org.OpenAPITools.Api /// The user name for login /// The password for login in clear text /// ApiResponse of string - public ApiResponse< string > LoginUserWithHttpInfo (string username, string password) + public ApiResponse LoginUserWithHttpInfo (string username, string password) { // verify the required parameter 'username' is set if (username == null) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs index 388d1e04dd1..f3b7500070d 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs @@ -31,7 +31,7 @@ namespace Org.OpenAPITools.Model /// [DataContract] [ImplementPropertyChanged] - public partial class AdditionalPropertiesBoolean : Dictionary, IEquatable, IValidatableObject + public partial class AdditionalPropertiesBoolean : Dictionary, IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 4a33ca55259..b257a7c94e0 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -47,7 +47,7 @@ namespace Org.OpenAPITools.Model /// anytype1. /// anytype2. /// anytype3. - public AdditionalPropertiesClass(Dictionary mapString = default(Dictionary), Dictionary mapNumber = default(Dictionary), Dictionary mapInteger = default(Dictionary), Dictionary mapBoolean = default(Dictionary), Dictionary> mapArrayInteger = default(Dictionary>), Dictionary> mapArrayAnytype = default(Dictionary>), Dictionary> mapMapString = default(Dictionary>), Dictionary> mapMapAnytype = default(Dictionary>), Object anytype1 = default(Object), Object anytype2 = default(Object), Object anytype3 = default(Object)) + public AdditionalPropertiesClass(Dictionary mapString = default(Dictionary), Dictionary mapNumber = default(Dictionary), Dictionary mapInteger = default(Dictionary), Dictionary mapBoolean = default(Dictionary), Dictionary> mapArrayInteger = default(Dictionary>), Dictionary> mapArrayAnytype = default(Dictionary>), Dictionary> mapMapString = default(Dictionary>), Dictionary> mapMapAnytype = default(Dictionary>), Object anytype1 = default(Object), Object anytype2 = default(Object), Object anytype3 = default(Object)) { this.MapString = mapString; this.MapNumber = mapNumber; @@ -72,25 +72,25 @@ namespace Org.OpenAPITools.Model /// Gets or Sets MapNumber /// [DataMember(Name="map_number", EmitDefaultValue=false)] - public Dictionary MapNumber { get; set; } + public Dictionary MapNumber { get; set; } /// /// Gets or Sets MapInteger /// [DataMember(Name="map_integer", EmitDefaultValue=false)] - public Dictionary MapInteger { get; set; } + public Dictionary MapInteger { get; set; } /// /// Gets or Sets MapBoolean /// [DataMember(Name="map_boolean", EmitDefaultValue=false)] - public Dictionary MapBoolean { get; set; } + public Dictionary MapBoolean { get; set; } /// /// Gets or Sets MapArrayInteger /// [DataMember(Name="map_array_integer", EmitDefaultValue=false)] - public Dictionary> MapArrayInteger { get; set; } + public Dictionary> MapArrayInteger { get; set; } /// /// Gets or Sets MapArrayAnytype diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs index e8e3b801517..616312de4aa 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs @@ -31,7 +31,7 @@ namespace Org.OpenAPITools.Model /// [DataContract] [ImplementPropertyChanged] - public partial class AdditionalPropertiesInteger : Dictionary, IEquatable, IValidatableObject + public partial class AdditionalPropertiesInteger : Dictionary, IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs index 516539fe815..80cee47470f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs @@ -31,7 +31,7 @@ namespace Org.OpenAPITools.Model /// [DataContract] [ImplementPropertyChanged] - public partial class AdditionalPropertiesNumber : Dictionary, IEquatable, IValidatableObject + public partial class AdditionalPropertiesNumber : Dictionary, IEquatable, IValidatableObject { /// /// Initializes a new instance of the class. diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/ApiResponse.cs index 548a95be3bf..98fe54f4345 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -39,7 +39,7 @@ namespace Org.OpenAPITools.Model /// code. /// type. /// message. - public ApiResponse(int? code = default(int?), string type = default(string), string message = default(string)) + public ApiResponse(int code = default(int), string type = default(string), string message = default(string)) { this.Code = code; this.Type = type; @@ -50,7 +50,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Code /// [DataMember(Name="code", EmitDefaultValue=false)] - public int? Code { get; set; } + public int Code { get; set; } /// /// Gets or Sets Type diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 71d3030f3ef..98ae16e5918 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -37,7 +37,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// arrayArrayNumber. - public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber = default(List>)) + public ArrayOfArrayOfNumberOnly(List> arrayArrayNumber = default(List>)) { this.ArrayArrayNumber = arrayArrayNumber; } @@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets ArrayArrayNumber /// [DataMember(Name="ArrayArrayNumber", EmitDefaultValue=false)] - public List> ArrayArrayNumber { get; set; } + public List> ArrayArrayNumber { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 2ba13f02e64..2d50957b75d 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -37,7 +37,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// arrayNumber. - public ArrayOfNumberOnly(List arrayNumber = default(List)) + public ArrayOfNumberOnly(List arrayNumber = default(List)) { this.ArrayNumber = arrayNumber; } @@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets ArrayNumber /// [DataMember(Name="ArrayNumber", EmitDefaultValue=false)] - public List ArrayNumber { get; set; } + public List ArrayNumber { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/ArrayTest.cs index 8a9cf588710..36ed14d9711 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -39,7 +39,7 @@ namespace Org.OpenAPITools.Model /// arrayOfString. /// arrayArrayOfInteger. /// arrayArrayOfModel. - public ArrayTest(List arrayOfString = default(List), List> arrayArrayOfInteger = default(List>), List> arrayArrayOfModel = default(List>)) + public ArrayTest(List arrayOfString = default(List), List> arrayArrayOfInteger = default(List>), List> arrayArrayOfModel = default(List>)) { this.ArrayOfString = arrayOfString; this.ArrayArrayOfInteger = arrayArrayOfInteger; @@ -56,7 +56,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets ArrayArrayOfInteger /// [DataMember(Name="array_array_of_integer", EmitDefaultValue=false)] - public List> ArrayArrayOfInteger { get; set; } + public List> ArrayArrayOfInteger { get; set; } /// /// Gets or Sets ArrayArrayOfModel diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Cat.cs index 1768b043170..fd2292e4052 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Cat.cs @@ -42,7 +42,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// declawed. - public Cat(bool? declawed = default(bool?), string className = default(string), string color = "red") : base(className, color) + public Cat(bool declawed = default(bool), string className = default(string), string color = "red") : base(className, color) { this.Declawed = declawed; } @@ -51,7 +51,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Declawed /// [DataMember(Name="declawed", EmitDefaultValue=false)] - public bool? Declawed { get; set; } + public bool Declawed { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/CatAllOf.cs index b54a65aec98..6ab74ebda94 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/CatAllOf.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -37,7 +37,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// declawed. - public CatAllOf(bool? declawed = default(bool?)) + public CatAllOf(bool declawed = default(bool)) { this.Declawed = declawed; } @@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Declawed /// [DataMember(Name="declawed", EmitDefaultValue=false)] - public bool? Declawed { get; set; } + public bool Declawed { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Category.cs index 511604c24f0..9cbb87b6802 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Category.cs @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// /// id. /// name (required) (default to "default-name"). - public Category(long? id = default(long?), string name = "default-name") + public Category(long id = default(long), string name = "default-name") { // to ensure "name" is required (not null) if (name == null) @@ -62,7 +62,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Name diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/FormatTest.cs index d5e62e6762b..74d043b9b9c 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/FormatTest.cs @@ -54,7 +54,7 @@ namespace Org.OpenAPITools.Model /// dateTime. /// uuid. /// password (required). - public FormatTest(int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), decimal? number = default(decimal?), float? _float = default(float?), double? _double = default(double?), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), Guid? uuid = default(Guid?), string password = default(string)) + public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string)) { // to ensure "number" is required (not null) if (number == null) @@ -111,37 +111,37 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Integer /// [DataMember(Name="integer", EmitDefaultValue=false)] - public int? Integer { get; set; } + public int Integer { get; set; } /// /// Gets or Sets Int32 /// [DataMember(Name="int32", EmitDefaultValue=false)] - public int? Int32 { get; set; } + public int Int32 { get; set; } /// /// Gets or Sets Int64 /// [DataMember(Name="int64", EmitDefaultValue=false)] - public long? Int64 { get; set; } + public long Int64 { get; set; } /// /// Gets or Sets Number /// [DataMember(Name="number", EmitDefaultValue=false)] - public decimal? Number { get; set; } + public decimal Number { get; set; } /// /// Gets or Sets Float /// [DataMember(Name="float", EmitDefaultValue=false)] - public float? Float { get; set; } + public float Float { get; set; } /// /// Gets or Sets Double /// [DataMember(Name="double", EmitDefaultValue=false)] - public double? Double { get; set; } + public double Double { get; set; } /// /// Gets or Sets String @@ -166,19 +166,19 @@ namespace Org.OpenAPITools.Model /// [DataMember(Name="date", EmitDefaultValue=false)] [JsonConverter(typeof(OpenAPIDateConverter))] - public DateTime? Date { get; set; } + public DateTime Date { get; set; } /// /// Gets or Sets DateTime /// [DataMember(Name="dateTime", EmitDefaultValue=false)] - public DateTime? DateTime { get; set; } + public DateTime DateTime { get; set; } /// /// Gets or Sets Uuid /// [DataMember(Name="uuid", EmitDefaultValue=false)] - public Guid? Uuid { get; set; } + public Guid Uuid { get; set; } /// /// Gets or Sets Password @@ -374,62 +374,62 @@ namespace Org.OpenAPITools.Model /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { - // Integer (int?) maximum - if(this.Integer > (int?)100) + // Integer (int) maximum + if(this.Integer > (int)100) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value less than or equal to 100.", new [] { "Integer" }); } - // Integer (int?) minimum - if(this.Integer < (int?)10) + // Integer (int) minimum + if(this.Integer < (int)10) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.", new [] { "Integer" }); } - // Int32 (int?) maximum - if(this.Int32 > (int?)200) + // Int32 (int) maximum + if(this.Int32 > (int)200) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value less than or equal to 200.", new [] { "Int32" }); } - // Int32 (int?) minimum - if(this.Int32 < (int?)20) + // Int32 (int) minimum + if(this.Int32 < (int)20) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } - // Number (decimal?) maximum - if(this.Number > (decimal?)543.2) + // Number (decimal) maximum + if(this.Number > (decimal)543.2) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value less than or equal to 543.2.", new [] { "Number" }); } - // Number (decimal?) minimum - if(this.Number < (decimal?)32.1) + // Number (decimal) minimum + if(this.Number < (decimal)32.1) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.", new [] { "Number" }); } - // Float (float?) maximum - if(this.Float > (float?)987.6) + // Float (float) maximum + if(this.Float > (float)987.6) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value less than or equal to 987.6.", new [] { "Float" }); } - // Float (float?) minimum - if(this.Float < (float?)54.3) + // Float (float) minimum + if(this.Float < (float)54.3) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.", new [] { "Float" }); } - // Double (double?) maximum - if(this.Double > (double?)123.4) + // Double (double) maximum + if(this.Double > (double)123.4) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value less than or equal to 123.4.", new [] { "Double" }); } - // Double (double?) minimum - if(this.Double < (double?)67.8) + // Double (double) minimum + if(this.Double < (double)67.8) { yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.", new [] { "Double" }); } diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/MapTest.cs index 137f03fa785..39e6c4118b4 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/MapTest.cs @@ -66,7 +66,7 @@ namespace Org.OpenAPITools.Model /// mapOfEnumString. /// directMap. /// indirectMap. - public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary), Dictionary directMap = default(Dictionary), Dictionary indirectMap = default(Dictionary)) + public MapTest(Dictionary> mapMapOfString = default(Dictionary>), Dictionary mapOfEnumString = default(Dictionary), Dictionary directMap = default(Dictionary), Dictionary indirectMap = default(Dictionary)) { this.MapMapOfString = mapMapOfString; this.MapOfEnumString = mapOfEnumString; @@ -85,13 +85,13 @@ namespace Org.OpenAPITools.Model /// Gets or Sets DirectMap /// [DataMember(Name="direct_map", EmitDefaultValue=false)] - public Dictionary DirectMap { get; set; } + public Dictionary DirectMap { get; set; } /// /// Gets or Sets IndirectMap /// [DataMember(Name="indirect_map", EmitDefaultValue=false)] - public Dictionary IndirectMap { get; set; } + public Dictionary IndirectMap { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 26882a579be..0c125e4c384 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -39,7 +39,7 @@ namespace Org.OpenAPITools.Model /// uuid. /// dateTime. /// map. - public MixedPropertiesAndAdditionalPropertiesClass(Guid? uuid = default(Guid?), DateTime? dateTime = default(DateTime?), Dictionary map = default(Dictionary)) + public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) { this.Uuid = uuid; this.DateTime = dateTime; @@ -50,13 +50,13 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Uuid /// [DataMember(Name="uuid", EmitDefaultValue=false)] - public Guid? Uuid { get; set; } + public Guid Uuid { get; set; } /// /// Gets or Sets DateTime /// [DataMember(Name="dateTime", EmitDefaultValue=false)] - public DateTime? DateTime { get; set; } + public DateTime DateTime { get; set; } /// /// Gets or Sets Map diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Model200Response.cs index 466c41ff743..5cf0b86e291 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Model200Response.cs @@ -38,7 +38,7 @@ namespace Org.OpenAPITools.Model /// /// name. /// _class. - public Model200Response(int? name = default(int?), string _class = default(string)) + public Model200Response(int name = default(int), string _class = default(string)) { this.Name = name; this.Class = _class; @@ -48,7 +48,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Name /// [DataMember(Name="name", EmitDefaultValue=false)] - public int? Name { get; set; } + public int Name { get; set; } /// /// Gets or Sets Class diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Name.cs index 72ecf4504c4..715ccf58cc3 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Name.cs @@ -43,7 +43,7 @@ namespace Org.OpenAPITools.Model /// /// name (required). /// property. - public Name(int? name = default(int?), string property = default(string)) + public Name(int name = default(int), string property = default(string)) { // to ensure "name" is required (not null) if (name == null) @@ -62,13 +62,13 @@ namespace Org.OpenAPITools.Model /// Gets or Sets _Name /// [DataMember(Name="name", EmitDefaultValue=false)] - public int? _Name { get; set; } + public int _Name { get; set; } /// /// Gets or Sets SnakeCase /// [DataMember(Name="snake_case", EmitDefaultValue=false)] - public int? SnakeCase { get; private set; } + public int SnakeCase { get; private set; } /// /// Gets or Sets Property @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets _123Number /// [DataMember(Name="123Number", EmitDefaultValue=false)] - public int? _123Number { get; private set; } + public int _123Number { get; private set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/NumberOnly.cs index 0da26edb606..8a8eecca6be 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -37,7 +37,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// justNumber. - public NumberOnly(decimal? justNumber = default(decimal?)) + public NumberOnly(decimal justNumber = default(decimal)) { this.JustNumber = justNumber; } @@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets JustNumber /// [DataMember(Name="JustNumber", EmitDefaultValue=false)] - public decimal? JustNumber { get; set; } + public decimal JustNumber { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Order.cs index 46542d45eae..f78f9cfef34 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Order.cs @@ -75,7 +75,7 @@ namespace Org.OpenAPITools.Model /// shipDate. /// Order Status. /// complete (default to false). - public Order(long? id = default(long?), long? petId = default(long?), int? quantity = default(int?), DateTime? shipDate = default(DateTime?), StatusEnum? status = default(StatusEnum?), bool? complete = false) + public Order(long id = default(long), long petId = default(long), int quantity = default(int), DateTime shipDate = default(DateTime), StatusEnum? status = default(StatusEnum?), bool complete = false) { this.Id = id; this.PetId = petId; @@ -97,32 +97,32 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets PetId /// [DataMember(Name="petId", EmitDefaultValue=false)] - public long? PetId { get; set; } + public long PetId { get; set; } /// /// Gets or Sets Quantity /// [DataMember(Name="quantity", EmitDefaultValue=false)] - public int? Quantity { get; set; } + public int Quantity { get; set; } /// /// Gets or Sets ShipDate /// [DataMember(Name="shipDate", EmitDefaultValue=false)] - public DateTime? ShipDate { get; set; } + public DateTime ShipDate { get; set; } /// /// Gets or Sets Complete /// [DataMember(Name="complete", EmitDefaultValue=false)] - public bool? Complete { get; set; } + public bool Complete { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/OuterComposite.cs index a09a24caf1b..c34bb749023 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -39,7 +39,7 @@ namespace Org.OpenAPITools.Model /// myNumber. /// myString. /// myBoolean. - public OuterComposite(decimal? myNumber = default(decimal?), string myString = default(string), bool? myBoolean = default(bool?)) + public OuterComposite(decimal myNumber = default(decimal), string myString = default(string), bool myBoolean = default(bool)) { this.MyNumber = myNumber; this.MyString = myString; @@ -50,7 +50,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets MyNumber /// [DataMember(Name="my_number", EmitDefaultValue=false)] - public decimal? MyNumber { get; set; } + public decimal MyNumber { get; set; } /// /// Gets or Sets MyString @@ -62,7 +62,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets MyBoolean /// [DataMember(Name="my_boolean", EmitDefaultValue=false)] - public bool? MyBoolean { get; set; } + public bool MyBoolean { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Pet.cs index 430a5ad8a2c..6dd381cb46e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Pet.cs @@ -80,7 +80,7 @@ namespace Org.OpenAPITools.Model /// photoUrls (required). /// tags. /// pet status in the store. - public Pet(long? id = default(long?), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) + public Pet(long id = default(long), Category category = default(Category), string name = default(string), List photoUrls = default(List), List tags = default(List), StatusEnum? status = default(StatusEnum?)) { // to ensure "name" is required (not null) if (name == null) @@ -112,7 +112,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Category diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Return.cs index 85512f01a32..097954d9a4c 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Return.cs @@ -37,7 +37,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// _return. - public Return(int? _return = default(int?)) + public Return(int _return = default(int)) { this._Return = _return; } @@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets _Return /// [DataMember(Name="return", EmitDefaultValue=false)] - public int? _Return { get; set; } + public int _Return { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/SpecialModelName.cs index 6d71bc01564..4eab4ce1eda 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -37,7 +37,7 @@ namespace Org.OpenAPITools.Model /// Initializes a new instance of the class. /// /// specialPropertyName. - public SpecialModelName(long? specialPropertyName = default(long?)) + public SpecialModelName(long specialPropertyName = default(long)) { this.SpecialPropertyName = specialPropertyName; } @@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets SpecialPropertyName /// [DataMember(Name="$special[property.name]", EmitDefaultValue=false)] - public long? SpecialPropertyName { get; set; } + public long SpecialPropertyName { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Tag.cs index 224a2066cb6..17fb156f79e 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Tag.cs @@ -38,7 +38,7 @@ namespace Org.OpenAPITools.Model /// /// id. /// name. - public Tag(long? id = default(long?), string name = default(string)) + public Tag(long id = default(long), string name = default(string)) { this.Id = id; this.Name = name; @@ -48,7 +48,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Name diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/TypeHolderDefault.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/TypeHolderDefault.cs index a108b77599f..52a120fb6a4 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/TypeHolderDefault.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/TypeHolderDefault.cs @@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Model /// integerItem (required). /// boolItem (required) (default to true). /// arrayItem (required). - public TypeHolderDefault(string stringItem = "what", decimal? numberItem = default(decimal?), int? integerItem = default(int?), bool? boolItem = true, List arrayItem = default(List)) + public TypeHolderDefault(string stringItem = "what", decimal numberItem = default(decimal), int integerItem = default(int), bool boolItem = true, List arrayItem = default(List)) { // to ensure "stringItem" is required (not null) if (stringItem == null) @@ -110,25 +110,25 @@ namespace Org.OpenAPITools.Model /// Gets or Sets NumberItem /// [DataMember(Name="number_item", EmitDefaultValue=false)] - public decimal? NumberItem { get; set; } + public decimal NumberItem { get; set; } /// /// Gets or Sets IntegerItem /// [DataMember(Name="integer_item", EmitDefaultValue=false)] - public int? IntegerItem { get; set; } + public int IntegerItem { get; set; } /// /// Gets or Sets BoolItem /// [DataMember(Name="bool_item", EmitDefaultValue=false)] - public bool? BoolItem { get; set; } + public bool BoolItem { get; set; } /// /// Gets or Sets ArrayItem /// [DataMember(Name="array_item", EmitDefaultValue=false)] - public List ArrayItem { get; set; } + public List ArrayItem { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/TypeHolderExample.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/TypeHolderExample.cs index f708e96e840..62f9cdb6eae 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/TypeHolderExample.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/TypeHolderExample.cs @@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Model /// integerItem (required). /// boolItem (required). /// arrayItem (required). - public TypeHolderExample(string stringItem = default(string), decimal? numberItem = default(decimal?), int? integerItem = default(int?), bool? boolItem = default(bool?), List arrayItem = default(List)) + public TypeHolderExample(string stringItem = default(string), decimal numberItem = default(decimal), int integerItem = default(int), bool boolItem = default(bool), List arrayItem = default(List)) { // to ensure "stringItem" is required (not null) if (stringItem == null) @@ -110,25 +110,25 @@ namespace Org.OpenAPITools.Model /// Gets or Sets NumberItem /// [DataMember(Name="number_item", EmitDefaultValue=false)] - public decimal? NumberItem { get; set; } + public decimal NumberItem { get; set; } /// /// Gets or Sets IntegerItem /// [DataMember(Name="integer_item", EmitDefaultValue=false)] - public int? IntegerItem { get; set; } + public int IntegerItem { get; set; } /// /// Gets or Sets BoolItem /// [DataMember(Name="bool_item", EmitDefaultValue=false)] - public bool? BoolItem { get; set; } + public bool BoolItem { get; set; } /// /// Gets or Sets ArrayItem /// [DataMember(Name="array_item", EmitDefaultValue=false)] - public List ArrayItem { get; set; } + public List ArrayItem { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/User.cs index 3d370092dfe..da0b0d9b315 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/User.cs @@ -44,7 +44,7 @@ namespace Org.OpenAPITools.Model /// password. /// phone. /// User Status. - public User(long? id = default(long?), string username = default(string), string firstName = default(string), string lastName = default(string), string email = default(string), string password = default(string), string phone = default(string), int? userStatus = default(int?)) + public User(long id = default(long), string username = default(string), string firstName = default(string), string lastName = default(string), string email = default(string), string password = default(string), string phone = default(string), int userStatus = default(int)) { this.Id = id; this.Username = username; @@ -60,7 +60,7 @@ namespace Org.OpenAPITools.Model /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Username @@ -103,7 +103,7 @@ namespace Org.OpenAPITools.Model /// /// User Status [DataMember(Name="userStatus", EmitDefaultValue=false)] - public int? UserStatus { get; set; } + public int UserStatus { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/XmlItem.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/XmlItem.cs index 8e24dc84787..406f0feb6a2 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/XmlItem.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/XmlItem.cs @@ -65,7 +65,7 @@ namespace Org.OpenAPITools.Model /// prefixNsBoolean. /// prefixNsArray. /// prefixNsWrappedArray. - public XmlItem(string attributeString = default(string), decimal? attributeNumber = default(decimal?), int? attributeInteger = default(int?), bool? attributeBoolean = default(bool?), List wrappedArray = default(List), string nameString = default(string), decimal? nameNumber = default(decimal?), int? nameInteger = default(int?), bool? nameBoolean = default(bool?), List nameArray = default(List), List nameWrappedArray = default(List), string prefixString = default(string), decimal? prefixNumber = default(decimal?), int? prefixInteger = default(int?), bool? prefixBoolean = default(bool?), List prefixArray = default(List), List prefixWrappedArray = default(List), string namespaceString = default(string), decimal? namespaceNumber = default(decimal?), int? namespaceInteger = default(int?), bool? namespaceBoolean = default(bool?), List namespaceArray = default(List), List namespaceWrappedArray = default(List), string prefixNsString = default(string), decimal? prefixNsNumber = default(decimal?), int? prefixNsInteger = default(int?), bool? prefixNsBoolean = default(bool?), List prefixNsArray = default(List), List prefixNsWrappedArray = default(List)) + public XmlItem(string attributeString = default(string), decimal attributeNumber = default(decimal), int attributeInteger = default(int), bool attributeBoolean = default(bool), List wrappedArray = default(List), string nameString = default(string), decimal nameNumber = default(decimal), int nameInteger = default(int), bool nameBoolean = default(bool), List nameArray = default(List), List nameWrappedArray = default(List), string prefixString = default(string), decimal prefixNumber = default(decimal), int prefixInteger = default(int), bool prefixBoolean = default(bool), List prefixArray = default(List), List prefixWrappedArray = default(List), string namespaceString = default(string), decimal namespaceNumber = default(decimal), int namespaceInteger = default(int), bool namespaceBoolean = default(bool), List namespaceArray = default(List), List namespaceWrappedArray = default(List), string prefixNsString = default(string), decimal prefixNsNumber = default(decimal), int prefixNsInteger = default(int), bool prefixNsBoolean = default(bool), List prefixNsArray = default(List), List prefixNsWrappedArray = default(List)) { this.AttributeString = attributeString; this.AttributeNumber = attributeNumber; @@ -108,25 +108,25 @@ namespace Org.OpenAPITools.Model /// Gets or Sets AttributeNumber /// [DataMember(Name="attribute_number", EmitDefaultValue=false)] - public decimal? AttributeNumber { get; set; } + public decimal AttributeNumber { get; set; } /// /// Gets or Sets AttributeInteger /// [DataMember(Name="attribute_integer", EmitDefaultValue=false)] - public int? AttributeInteger { get; set; } + public int AttributeInteger { get; set; } /// /// Gets or Sets AttributeBoolean /// [DataMember(Name="attribute_boolean", EmitDefaultValue=false)] - public bool? AttributeBoolean { get; set; } + public bool AttributeBoolean { get; set; } /// /// Gets or Sets WrappedArray /// [DataMember(Name="wrapped_array", EmitDefaultValue=false)] - public List WrappedArray { get; set; } + public List WrappedArray { get; set; } /// /// Gets or Sets NameString @@ -138,31 +138,31 @@ namespace Org.OpenAPITools.Model /// Gets or Sets NameNumber /// [DataMember(Name="name_number", EmitDefaultValue=false)] - public decimal? NameNumber { get; set; } + public decimal NameNumber { get; set; } /// /// Gets or Sets NameInteger /// [DataMember(Name="name_integer", EmitDefaultValue=false)] - public int? NameInteger { get; set; } + public int NameInteger { get; set; } /// /// Gets or Sets NameBoolean /// [DataMember(Name="name_boolean", EmitDefaultValue=false)] - public bool? NameBoolean { get; set; } + public bool NameBoolean { get; set; } /// /// Gets or Sets NameArray /// [DataMember(Name="name_array", EmitDefaultValue=false)] - public List NameArray { get; set; } + public List NameArray { get; set; } /// /// Gets or Sets NameWrappedArray /// [DataMember(Name="name_wrapped_array", EmitDefaultValue=false)] - public List NameWrappedArray { get; set; } + public List NameWrappedArray { get; set; } /// /// Gets or Sets PrefixString @@ -174,31 +174,31 @@ namespace Org.OpenAPITools.Model /// Gets or Sets PrefixNumber /// [DataMember(Name="prefix_number", EmitDefaultValue=false)] - public decimal? PrefixNumber { get; set; } + public decimal PrefixNumber { get; set; } /// /// Gets or Sets PrefixInteger /// [DataMember(Name="prefix_integer", EmitDefaultValue=false)] - public int? PrefixInteger { get; set; } + public int PrefixInteger { get; set; } /// /// Gets or Sets PrefixBoolean /// [DataMember(Name="prefix_boolean", EmitDefaultValue=false)] - public bool? PrefixBoolean { get; set; } + public bool PrefixBoolean { get; set; } /// /// Gets or Sets PrefixArray /// [DataMember(Name="prefix_array", EmitDefaultValue=false)] - public List PrefixArray { get; set; } + public List PrefixArray { get; set; } /// /// Gets or Sets PrefixWrappedArray /// [DataMember(Name="prefix_wrapped_array", EmitDefaultValue=false)] - public List PrefixWrappedArray { get; set; } + public List PrefixWrappedArray { get; set; } /// /// Gets or Sets NamespaceString @@ -210,31 +210,31 @@ namespace Org.OpenAPITools.Model /// Gets or Sets NamespaceNumber /// [DataMember(Name="namespace_number", EmitDefaultValue=false)] - public decimal? NamespaceNumber { get; set; } + public decimal NamespaceNumber { get; set; } /// /// Gets or Sets NamespaceInteger /// [DataMember(Name="namespace_integer", EmitDefaultValue=false)] - public int? NamespaceInteger { get; set; } + public int NamespaceInteger { get; set; } /// /// Gets or Sets NamespaceBoolean /// [DataMember(Name="namespace_boolean", EmitDefaultValue=false)] - public bool? NamespaceBoolean { get; set; } + public bool NamespaceBoolean { get; set; } /// /// Gets or Sets NamespaceArray /// [DataMember(Name="namespace_array", EmitDefaultValue=false)] - public List NamespaceArray { get; set; } + public List NamespaceArray { get; set; } /// /// Gets or Sets NamespaceWrappedArray /// [DataMember(Name="namespace_wrapped_array", EmitDefaultValue=false)] - public List NamespaceWrappedArray { get; set; } + public List NamespaceWrappedArray { get; set; } /// /// Gets or Sets PrefixNsString @@ -246,31 +246,31 @@ namespace Org.OpenAPITools.Model /// Gets or Sets PrefixNsNumber /// [DataMember(Name="prefix_ns_number", EmitDefaultValue=false)] - public decimal? PrefixNsNumber { get; set; } + public decimal PrefixNsNumber { get; set; } /// /// Gets or Sets PrefixNsInteger /// [DataMember(Name="prefix_ns_integer", EmitDefaultValue=false)] - public int? PrefixNsInteger { get; set; } + public int PrefixNsInteger { get; set; } /// /// Gets or Sets PrefixNsBoolean /// [DataMember(Name="prefix_ns_boolean", EmitDefaultValue=false)] - public bool? PrefixNsBoolean { get; set; } + public bool PrefixNsBoolean { get; set; } /// /// Gets or Sets PrefixNsArray /// [DataMember(Name="prefix_ns_array", EmitDefaultValue=false)] - public List PrefixNsArray { get; set; } + public List PrefixNsArray { get; set; } /// /// Gets or Sets PrefixNsWrappedArray /// [DataMember(Name="prefix_ns_wrapped_array", EmitDefaultValue=false)] - public List PrefixNsWrappedArray { get; set; } + public List PrefixNsWrappedArray { get; set; } /// /// Returns the string presentation of the object From 3538c08a8b516b7316be7a297282620beed776d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?An=C4=B1l=20Can=20Ayd=C4=B1n?= Date: Tue, 6 Aug 2019 11:24:29 +0300 Subject: [PATCH 55/75] Readme updated with a new tutorial and company using OpenAPI Generator (#3566) --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 7a70c8adaf8..75aeef76cf7 100644 --- a/README.md +++ b/README.md @@ -550,6 +550,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - [CAM](https://www.cam-inc.co.jp/) - [Camptocamp](https://www.camptocamp.com/en) - [codecentric AG](https://www.codecentric.de/) +- [Commencis](https://www.commencis.com/) - [Cupix](https://www.cupix.com/) - [DB Systel](https://www.dbsystel.de) - [FormAPI](https://formapi.io/) @@ -594,6 +595,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2018/12/09 - [openapi-generator をカスタマイズする方法](https://qiita.com/watiko/items/0961287c02eac9211572) by [@watiko](https://qiita.com/watiko) - 2019/01/03 - [Calling a Swagger service from Apex using openapi-generator](https://lekkimworld.com/2019/01/03/calling-a-swagger-service-from-apex-using-openapi-generator/) by [Mikkel Flindt Heisterberg](https://lekkimworld.com) - 2019/01/13 - [OpenAPI GeneratorでRESTful APIの定義書から色々自動生成する](https://ky-yk-d.hatenablog.com/entry/2019/01/13/234108) by [@ky_yk_d](https://twitter.com/ky_yk_d) +- 2019/01/20 - [Contract-First API Development with OpenAPI Generator and Connexion](https://medium.com/commencis/contract-first-api-development-with-openapi-generator-and-connexion-b21bbf2f9244) by [Anil Can Aydin](https://github.com/anlcnydn) - 2019/01/30 - [Rapid Application Development With API First Approach Using Open-API Generator](https://dzone.com/articles/rapid-api-development-using-open-api-generator) by [Milan Sonkar](https://dzone.com/users/828329/milan_sonkar.html) - 2019/02/02 - [平静を保ち、コードを生成せよ 〜 OpenAPI Generator誕生の背景と軌跡 〜](https://speakerdeck.com/akihito_nakano/gunmaweb34) by [中野暁人](https://github.com/ackintosh) at [Gunma.web #34 スキーマ駆動開発](https://gunmaweb.connpass.com/event/113974/) - 2019/02/20 - [An adventure in OpenAPI V3 code generation](https://mux.com/blog/an-adventure-in-openapi-v3-api-code-generation/) by [Phil Cluff](https://mux.com/blog/author/philc/) From b8295afa272dd22a2f5a0fb53c37c710bcc8b5e6 Mon Sep 17 00:00:00 2001 From: unintended Date: Tue, 6 Aug 2019 13:56:43 +0300 Subject: [PATCH 56/75] Expand path templates via resttemplate's uriTemplateHandler (#3500) * Expand path templates via resttemplate's uriTemplateHandler * fix tests and compilation on lower jdk version * fix typo * re-generate samples --- .../libraries/resttemplate/ApiClient.mustache | 10 +++++++ .../Java/libraries/resttemplate/api.mustache | 3 ++- .../org/openapitools/client/ApiClient.java | 10 +++++++ .../client/api/AnotherFakeApi.java | 3 ++- .../org/openapitools/client/api/FakeApi.java | 27 ++++++++++--------- .../client/api/FakeClassnameTags123Api.java | 3 ++- .../org/openapitools/client/api/PetApi.java | 19 ++++++------- .../org/openapitools/client/api/StoreApi.java | 9 ++++--- .../org/openapitools/client/api/UserApi.java | 17 ++++++------ .../org/openapitools/client/ApiClient.java | 10 +++++++ .../client/api/AnotherFakeApi.java | 3 ++- .../org/openapitools/client/api/FakeApi.java | 27 ++++++++++--------- .../client/api/FakeClassnameTags123Api.java | 3 ++- .../org/openapitools/client/api/PetApi.java | 19 ++++++------- .../org/openapitools/client/api/StoreApi.java | 9 ++++--- .../org/openapitools/client/api/UserApi.java | 17 ++++++------ 16 files changed, 116 insertions(+), 73 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache index 4deaacb19ee..52e5f96e994 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache @@ -555,6 +555,16 @@ public class ApiClient { return isForm ? formParams : obj; } + /** + * Expand path template with variables + * @param pathTemplate path template with placeholders + * @param variables variables to replace + * @return path with placeholders replaced by variables + */ + public String expandPath(String pathTemplate, Map variables) { + return restTemplate.getUriTemplateHandler().expand(pathTemplate, variables).toString(); + } + /** * Invoke API by sending HTTP request with the given options. * diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache index 040d776efe9..79cdcd51ac1 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache @@ -6,6 +6,7 @@ import {{invokerPackage}}.ApiClient; {{/imports}} {{^fullJavaUtil}}import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Locale; @@ -72,7 +73,7 @@ public class {{classname}} { // create path and map variables final Map uriVariables = new HashMap();{{#pathParams}} uriVariables.put("{{baseName}}", {{#collectionFormat}}apiClient.collectionPathParameterToString(ApiClient.CollectionFormat.valueOf("{{{collectionFormat}}}".toUpperCase()), {{{paramName}}}){{/collectionFormat}}{{^collectionFormat}}{{{paramName}}}{{/collectionFormat}});{{/pathParams}}{{/hasPathParams}} - String path = UriComponentsBuilder.fromPath("{{{path}}}"){{#hasPathParams}}.buildAndExpand(uriVariables){{/hasPathParams}}{{^hasPathParams}}.build(){{/hasPathParams}}.toUriString(); + String path = apiClient.expandPath("{{{path}}}", {{#hasPathParams}}uriVariables{{/hasPathParams}}{{^hasPathParams}}Collections.emptyMap(){{/hasPathParams}}); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java index 6a61b3961c8..6ccafb53cc2 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java @@ -543,6 +543,16 @@ public class ApiClient { return isForm ? formParams : obj; } + /** + * Expand path template with variables + * @param pathTemplate path template with placeholders + * @param variables variables to replace + * @return path with placeholders replaced by variables + */ + public String expandPath(String pathTemplate, Map variables) { + return restTemplate.getUriTemplateHandler().expand(pathTemplate, variables).toString(); + } + /** * Invoke API by sending HTTP request with the given options. * diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index b8f6e65d3e3..ffb5afa7d04 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -5,6 +5,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.model.Client; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Locale; @@ -62,7 +63,7 @@ public class AnotherFakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling call123testSpecialTags"); } - String path = UriComponentsBuilder.fromPath("/another-fake/dummy").build().toUriString(); + String path = apiClient.expandPath("/another-fake/dummy", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java index 9d607296978..4981d7ea3a8 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeApi.java @@ -13,6 +13,7 @@ import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Locale; @@ -69,7 +70,7 @@ public class FakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'xmlItem' when calling createXmlItem"); } - String path = UriComponentsBuilder.fromPath("/fake/create_xml_item").build().toUriString(); + String path = apiClient.expandPath("/fake/create_xml_item", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -98,7 +99,7 @@ public class FakeApi { public Boolean fakeOuterBooleanSerialize(Boolean body) throws RestClientException { Object postBody = body; - String path = UriComponentsBuilder.fromPath("/fake/outer/boolean").build().toUriString(); + String path = apiClient.expandPath("/fake/outer/boolean", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -127,7 +128,7 @@ public class FakeApi { public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws RestClientException { Object postBody = body; - String path = UriComponentsBuilder.fromPath("/fake/outer/composite").build().toUriString(); + String path = apiClient.expandPath("/fake/outer/composite", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -156,7 +157,7 @@ public class FakeApi { public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws RestClientException { Object postBody = body; - String path = UriComponentsBuilder.fromPath("/fake/outer/number").build().toUriString(); + String path = apiClient.expandPath("/fake/outer/number", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -185,7 +186,7 @@ public class FakeApi { public String fakeOuterStringSerialize(String body) throws RestClientException { Object postBody = body; - String path = UriComponentsBuilder.fromPath("/fake/outer/string").build().toUriString(); + String path = apiClient.expandPath("/fake/outer/string", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -218,7 +219,7 @@ public class FakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testBodyWithFileSchema"); } - String path = UriComponentsBuilder.fromPath("/fake/body-with-file-schema").build().toUriString(); + String path = apiClient.expandPath("/fake/body-with-file-schema", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -257,7 +258,7 @@ public class FakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testBodyWithQueryParams"); } - String path = UriComponentsBuilder.fromPath("/fake/body-with-query-params").build().toUriString(); + String path = apiClient.expandPath("/fake/body-with-query-params", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -293,7 +294,7 @@ public class FakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testClientModel"); } - String path = UriComponentsBuilder.fromPath("/fake").build().toUriString(); + String path = apiClient.expandPath("/fake", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -357,7 +358,7 @@ public class FakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter '_byte' when calling testEndpointParameters"); } - String path = UriComponentsBuilder.fromPath("/fake").build().toUriString(); + String path = apiClient.expandPath("/fake", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -422,7 +423,7 @@ public class FakeApi { public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws RestClientException { Object postBody = null; - String path = UriComponentsBuilder.fromPath("/fake").build().toUriString(); + String path = apiClient.expandPath("/fake", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -485,7 +486,7 @@ public class FakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requiredInt64Group' when calling testGroupParameters"); } - String path = UriComponentsBuilder.fromPath("/fake").build().toUriString(); + String path = apiClient.expandPath("/fake", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -526,7 +527,7 @@ public class FakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param' when calling testInlineAdditionalProperties"); } - String path = UriComponentsBuilder.fromPath("/fake/inline-additionalProperties").build().toUriString(); + String path = apiClient.expandPath("/fake/inline-additionalProperties", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -565,7 +566,7 @@ public class FakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param2' when calling testJsonFormData"); } - String path = UriComponentsBuilder.fromPath("/fake/jsonFormData").build().toUriString(); + String path = apiClient.expandPath("/fake/jsonFormData", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index c0e2aef1afe..b619b51c261 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -5,6 +5,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.model.Client; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Locale; @@ -62,7 +63,7 @@ public class FakeClassnameTags123Api { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testClassname"); } - String path = UriComponentsBuilder.fromPath("/fake_classname_test").build().toUriString(); + String path = apiClient.expandPath("/fake_classname_test", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java index 4adb3a4e2a4..d012578f0fa 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java @@ -7,6 +7,7 @@ import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Locale; @@ -64,7 +65,7 @@ public class PetApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling addPet"); } - String path = UriComponentsBuilder.fromPath("/pet").build().toUriString(); + String path = apiClient.expandPath("/pet", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -102,7 +103,7 @@ public class PetApi { // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("petId", petId); - String path = UriComponentsBuilder.fromPath("/pet/{petId}").buildAndExpand(uriVariables).toUriString(); + String path = apiClient.expandPath("/pet/{petId}", uriVariables); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -138,7 +139,7 @@ public class PetApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'status' when calling findPetsByStatus"); } - String path = UriComponentsBuilder.fromPath("/pet/findByStatus").build().toUriString(); + String path = apiClient.expandPath("/pet/findByStatus", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -175,7 +176,7 @@ public class PetApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'tags' when calling findPetsByTags"); } - String path = UriComponentsBuilder.fromPath("/pet/findByTags").build().toUriString(); + String path = apiClient.expandPath("/pet/findByTags", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -216,7 +217,7 @@ public class PetApi { // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("petId", petId); - String path = UriComponentsBuilder.fromPath("/pet/{petId}").buildAndExpand(uriVariables).toUriString(); + String path = apiClient.expandPath("/pet/{petId}", uriVariables); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -252,7 +253,7 @@ public class PetApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling updatePet"); } - String path = UriComponentsBuilder.fromPath("/pet").build().toUriString(); + String path = apiClient.expandPath("/pet", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -290,7 +291,7 @@ public class PetApi { // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("petId", petId); - String path = UriComponentsBuilder.fromPath("/pet/{petId}").buildAndExpand(uriVariables).toUriString(); + String path = apiClient.expandPath("/pet/{petId}", uriVariables); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -334,7 +335,7 @@ public class PetApi { // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("petId", petId); - String path = UriComponentsBuilder.fromPath("/pet/{petId}/uploadImage").buildAndExpand(uriVariables).toUriString(); + String path = apiClient.expandPath("/pet/{petId}/uploadImage", uriVariables); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -385,7 +386,7 @@ public class PetApi { // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("petId", petId); - String path = UriComponentsBuilder.fromPath("/fake/{petId}/uploadImageWithRequiredFile").buildAndExpand(uriVariables).toUriString(); + String path = apiClient.expandPath("/fake/{petId}/uploadImageWithRequiredFile", uriVariables); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/StoreApi.java index 0bf4604d28d..4488bd0ae0a 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/StoreApi.java @@ -5,6 +5,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.model.Order; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Locale; @@ -65,7 +66,7 @@ public class StoreApi { // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("order_id", orderId); - String path = UriComponentsBuilder.fromPath("/store/order/{order_id}").buildAndExpand(uriVariables).toUriString(); + String path = apiClient.expandPath("/store/order/{order_id}", uriVariables); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -91,7 +92,7 @@ public class StoreApi { public Map getInventory() throws RestClientException { Object postBody = null; - String path = UriComponentsBuilder.fromPath("/store/inventory").build().toUriString(); + String path = apiClient.expandPath("/store/inventory", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -130,7 +131,7 @@ public class StoreApi { // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("order_id", orderId); - String path = UriComponentsBuilder.fromPath("/store/order/{order_id}").buildAndExpand(uriVariables).toUriString(); + String path = apiClient.expandPath("/store/order/{order_id}", uriVariables); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -165,7 +166,7 @@ public class StoreApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling placeOrder"); } - String path = UriComponentsBuilder.fromPath("/store/order").build().toUriString(); + String path = apiClient.expandPath("/store/order", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java index 586e2320a80..1d2d59616b6 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java @@ -5,6 +5,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.model.User; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Locale; @@ -61,7 +62,7 @@ public class UserApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUser"); } - String path = UriComponentsBuilder.fromPath("/user").build().toUriString(); + String path = apiClient.expandPath("/user", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -92,7 +93,7 @@ public class UserApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUsersWithArrayInput"); } - String path = UriComponentsBuilder.fromPath("/user/createWithArray").build().toUriString(); + String path = apiClient.expandPath("/user/createWithArray", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -123,7 +124,7 @@ public class UserApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUsersWithListInput"); } - String path = UriComponentsBuilder.fromPath("/user/createWithList").build().toUriString(); + String path = apiClient.expandPath("/user/createWithList", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -158,7 +159,7 @@ public class UserApi { // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("username", username); - String path = UriComponentsBuilder.fromPath("/user/{username}").buildAndExpand(uriVariables).toUriString(); + String path = apiClient.expandPath("/user/{username}", uriVariables); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -195,7 +196,7 @@ public class UserApi { // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("username", username); - String path = UriComponentsBuilder.fromPath("/user/{username}").buildAndExpand(uriVariables).toUriString(); + String path = apiClient.expandPath("/user/{username}", uriVariables); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -236,7 +237,7 @@ public class UserApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'password' when calling loginUser"); } - String path = UriComponentsBuilder.fromPath("/user/login").build().toUriString(); + String path = apiClient.expandPath("/user/login", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -266,7 +267,7 @@ public class UserApi { public void logoutUser() throws RestClientException { Object postBody = null; - String path = UriComponentsBuilder.fromPath("/user/logout").build().toUriString(); + String path = apiClient.expandPath("/user/logout", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -307,7 +308,7 @@ public class UserApi { // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("username", username); - String path = UriComponentsBuilder.fromPath("/user/{username}").buildAndExpand(uriVariables).toUriString(); + String path = apiClient.expandPath("/user/{username}", uriVariables); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java index ad850d363d7..c49d73bcfb0 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java @@ -538,6 +538,16 @@ public class ApiClient { return isForm ? formParams : obj; } + /** + * Expand path template with variables + * @param pathTemplate path template with placeholders + * @param variables variables to replace + * @return path with placeholders replaced by variables + */ + public String expandPath(String pathTemplate, Map variables) { + return restTemplate.getUriTemplateHandler().expand(pathTemplate, variables).toString(); + } + /** * Invoke API by sending HTTP request with the given options. * diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index b8f6e65d3e3..ffb5afa7d04 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -5,6 +5,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.model.Client; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Locale; @@ -62,7 +63,7 @@ public class AnotherFakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling call123testSpecialTags"); } - String path = UriComponentsBuilder.fromPath("/another-fake/dummy").build().toUriString(); + String path = apiClient.expandPath("/another-fake/dummy", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java index 9d607296978..4981d7ea3a8 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeApi.java @@ -13,6 +13,7 @@ import org.openapitools.client.model.User; import org.openapitools.client.model.XmlItem; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Locale; @@ -69,7 +70,7 @@ public class FakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'xmlItem' when calling createXmlItem"); } - String path = UriComponentsBuilder.fromPath("/fake/create_xml_item").build().toUriString(); + String path = apiClient.expandPath("/fake/create_xml_item", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -98,7 +99,7 @@ public class FakeApi { public Boolean fakeOuterBooleanSerialize(Boolean body) throws RestClientException { Object postBody = body; - String path = UriComponentsBuilder.fromPath("/fake/outer/boolean").build().toUriString(); + String path = apiClient.expandPath("/fake/outer/boolean", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -127,7 +128,7 @@ public class FakeApi { public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws RestClientException { Object postBody = body; - String path = UriComponentsBuilder.fromPath("/fake/outer/composite").build().toUriString(); + String path = apiClient.expandPath("/fake/outer/composite", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -156,7 +157,7 @@ public class FakeApi { public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws RestClientException { Object postBody = body; - String path = UriComponentsBuilder.fromPath("/fake/outer/number").build().toUriString(); + String path = apiClient.expandPath("/fake/outer/number", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -185,7 +186,7 @@ public class FakeApi { public String fakeOuterStringSerialize(String body) throws RestClientException { Object postBody = body; - String path = UriComponentsBuilder.fromPath("/fake/outer/string").build().toUriString(); + String path = apiClient.expandPath("/fake/outer/string", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -218,7 +219,7 @@ public class FakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testBodyWithFileSchema"); } - String path = UriComponentsBuilder.fromPath("/fake/body-with-file-schema").build().toUriString(); + String path = apiClient.expandPath("/fake/body-with-file-schema", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -257,7 +258,7 @@ public class FakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testBodyWithQueryParams"); } - String path = UriComponentsBuilder.fromPath("/fake/body-with-query-params").build().toUriString(); + String path = apiClient.expandPath("/fake/body-with-query-params", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -293,7 +294,7 @@ public class FakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testClientModel"); } - String path = UriComponentsBuilder.fromPath("/fake").build().toUriString(); + String path = apiClient.expandPath("/fake", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -357,7 +358,7 @@ public class FakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter '_byte' when calling testEndpointParameters"); } - String path = UriComponentsBuilder.fromPath("/fake").build().toUriString(); + String path = apiClient.expandPath("/fake", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -422,7 +423,7 @@ public class FakeApi { public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws RestClientException { Object postBody = null; - String path = UriComponentsBuilder.fromPath("/fake").build().toUriString(); + String path = apiClient.expandPath("/fake", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -485,7 +486,7 @@ public class FakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requiredInt64Group' when calling testGroupParameters"); } - String path = UriComponentsBuilder.fromPath("/fake").build().toUriString(); + String path = apiClient.expandPath("/fake", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -526,7 +527,7 @@ public class FakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param' when calling testInlineAdditionalProperties"); } - String path = UriComponentsBuilder.fromPath("/fake/inline-additionalProperties").build().toUriString(); + String path = apiClient.expandPath("/fake/inline-additionalProperties", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -565,7 +566,7 @@ public class FakeApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param2' when calling testJsonFormData"); } - String path = UriComponentsBuilder.fromPath("/fake/jsonFormData").build().toUriString(); + String path = apiClient.expandPath("/fake/jsonFormData", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index c0e2aef1afe..b619b51c261 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -5,6 +5,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.model.Client; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Locale; @@ -62,7 +63,7 @@ public class FakeClassnameTags123Api { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testClassname"); } - String path = UriComponentsBuilder.fromPath("/fake_classname_test").build().toUriString(); + String path = apiClient.expandPath("/fake_classname_test", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java index 4adb3a4e2a4..d012578f0fa 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java @@ -7,6 +7,7 @@ import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Locale; @@ -64,7 +65,7 @@ public class PetApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling addPet"); } - String path = UriComponentsBuilder.fromPath("/pet").build().toUriString(); + String path = apiClient.expandPath("/pet", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -102,7 +103,7 @@ public class PetApi { // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("petId", petId); - String path = UriComponentsBuilder.fromPath("/pet/{petId}").buildAndExpand(uriVariables).toUriString(); + String path = apiClient.expandPath("/pet/{petId}", uriVariables); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -138,7 +139,7 @@ public class PetApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'status' when calling findPetsByStatus"); } - String path = UriComponentsBuilder.fromPath("/pet/findByStatus").build().toUriString(); + String path = apiClient.expandPath("/pet/findByStatus", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -175,7 +176,7 @@ public class PetApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'tags' when calling findPetsByTags"); } - String path = UriComponentsBuilder.fromPath("/pet/findByTags").build().toUriString(); + String path = apiClient.expandPath("/pet/findByTags", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -216,7 +217,7 @@ public class PetApi { // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("petId", petId); - String path = UriComponentsBuilder.fromPath("/pet/{petId}").buildAndExpand(uriVariables).toUriString(); + String path = apiClient.expandPath("/pet/{petId}", uriVariables); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -252,7 +253,7 @@ public class PetApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling updatePet"); } - String path = UriComponentsBuilder.fromPath("/pet").build().toUriString(); + String path = apiClient.expandPath("/pet", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -290,7 +291,7 @@ public class PetApi { // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("petId", petId); - String path = UriComponentsBuilder.fromPath("/pet/{petId}").buildAndExpand(uriVariables).toUriString(); + String path = apiClient.expandPath("/pet/{petId}", uriVariables); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -334,7 +335,7 @@ public class PetApi { // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("petId", petId); - String path = UriComponentsBuilder.fromPath("/pet/{petId}/uploadImage").buildAndExpand(uriVariables).toUriString(); + String path = apiClient.expandPath("/pet/{petId}/uploadImage", uriVariables); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -385,7 +386,7 @@ public class PetApi { // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("petId", petId); - String path = UriComponentsBuilder.fromPath("/fake/{petId}/uploadImageWithRequiredFile").buildAndExpand(uriVariables).toUriString(); + String path = apiClient.expandPath("/fake/{petId}/uploadImageWithRequiredFile", uriVariables); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/StoreApi.java index 0bf4604d28d..4488bd0ae0a 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/StoreApi.java @@ -5,6 +5,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.model.Order; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Locale; @@ -65,7 +66,7 @@ public class StoreApi { // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("order_id", orderId); - String path = UriComponentsBuilder.fromPath("/store/order/{order_id}").buildAndExpand(uriVariables).toUriString(); + String path = apiClient.expandPath("/store/order/{order_id}", uriVariables); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -91,7 +92,7 @@ public class StoreApi { public Map getInventory() throws RestClientException { Object postBody = null; - String path = UriComponentsBuilder.fromPath("/store/inventory").build().toUriString(); + String path = apiClient.expandPath("/store/inventory", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -130,7 +131,7 @@ public class StoreApi { // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("order_id", orderId); - String path = UriComponentsBuilder.fromPath("/store/order/{order_id}").buildAndExpand(uriVariables).toUriString(); + String path = apiClient.expandPath("/store/order/{order_id}", uriVariables); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -165,7 +166,7 @@ public class StoreApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling placeOrder"); } - String path = UriComponentsBuilder.fromPath("/store/order").build().toUriString(); + String path = apiClient.expandPath("/store/order", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java index 586e2320a80..1d2d59616b6 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java @@ -5,6 +5,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.model.User; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Locale; @@ -61,7 +62,7 @@ public class UserApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUser"); } - String path = UriComponentsBuilder.fromPath("/user").build().toUriString(); + String path = apiClient.expandPath("/user", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -92,7 +93,7 @@ public class UserApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUsersWithArrayInput"); } - String path = UriComponentsBuilder.fromPath("/user/createWithArray").build().toUriString(); + String path = apiClient.expandPath("/user/createWithArray", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -123,7 +124,7 @@ public class UserApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUsersWithListInput"); } - String path = UriComponentsBuilder.fromPath("/user/createWithList").build().toUriString(); + String path = apiClient.expandPath("/user/createWithList", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -158,7 +159,7 @@ public class UserApi { // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("username", username); - String path = UriComponentsBuilder.fromPath("/user/{username}").buildAndExpand(uriVariables).toUriString(); + String path = apiClient.expandPath("/user/{username}", uriVariables); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -195,7 +196,7 @@ public class UserApi { // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("username", username); - String path = UriComponentsBuilder.fromPath("/user/{username}").buildAndExpand(uriVariables).toUriString(); + String path = apiClient.expandPath("/user/{username}", uriVariables); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -236,7 +237,7 @@ public class UserApi { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'password' when calling loginUser"); } - String path = UriComponentsBuilder.fromPath("/user/login").build().toUriString(); + String path = apiClient.expandPath("/user/login", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -266,7 +267,7 @@ public class UserApi { public void logoutUser() throws RestClientException { Object postBody = null; - String path = UriComponentsBuilder.fromPath("/user/logout").build().toUriString(); + String path = apiClient.expandPath("/user/logout", Collections.emptyMap()); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); @@ -307,7 +308,7 @@ public class UserApi { // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("username", username); - String path = UriComponentsBuilder.fromPath("/user/{username}").buildAndExpand(uriVariables).toUriString(); + String path = apiClient.expandPath("/user/{username}", uriVariables); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); From 9e659d13ed42faa2f630511deac8f3230f74c82a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20C=C3=B4t=C3=A9?= Date: Tue, 6 Aug 2019 10:08:38 -0400 Subject: [PATCH 57/75] Fix NPM build for Typescript-fetch (#3403) * -Fix bug in fetch -> Missing "runtime" -Move fetch files to an "src" folder instead of doing everything at the root which removes the bugs when using the library itself -Fix the distribution of fetch using npm * Move the .ts files to an `src` folder which is more common in npm package * Add missing mustache * Add missing .npmignore --- .../languages/TypeScriptFetchClientCodegen.java | 11 ++++++----- .../resources/typescript-fetch/npmignore.mustache | 1 + .../main/resources/typescript-fetch/package.mustache | 2 +- .../main/resources/typescript-fetch/tsconfig.mustache | 1 - .../builds/default/{ => src}/apis/PetApi.ts | 0 .../builds/default/{ => src}/apis/StoreApi.ts | 0 .../builds/default/{ => src}/apis/UserApi.ts | 0 .../builds/default/{ => src}/apis/index.ts | 0 .../builds/default/{ => src}/index.ts | 0 .../builds/default/{ => src}/models/Category.ts | 0 .../default/{ => src}/models/ModelApiResponse.ts | 0 .../builds/default/{ => src}/models/Order.ts | 0 .../builds/default/{ => src}/models/Pet.ts | 0 .../builds/default/{ => src}/models/Tag.ts | 0 .../builds/default/{ => src}/models/User.ts | 0 .../builds/default/{ => src}/models/index.ts | 0 .../builds/default/{ => src}/runtime.ts | 0 .../typescript-fetch/builds/default/tsconfig.json | 1 - .../typescript-fetch/builds/es6-target/.npmignore | 1 + .../typescript-fetch/builds/es6-target/package.json | 2 +- .../builds/es6-target/{ => src}/apis/PetApi.ts | 0 .../builds/es6-target/{ => src}/apis/StoreApi.ts | 0 .../builds/es6-target/{ => src}/apis/UserApi.ts | 0 .../builds/es6-target/{ => src}/apis/index.ts | 0 .../builds/es6-target/{ => src}/index.ts | 0 .../builds/es6-target/{ => src}/models/Category.ts | 0 .../es6-target/{ => src}/models/ModelApiResponse.ts | 0 .../builds/es6-target/{ => src}/models/Order.ts | 0 .../builds/es6-target/{ => src}/models/Pet.ts | 0 .../builds/es6-target/{ => src}/models/Tag.ts | 0 .../builds/es6-target/{ => src}/models/User.ts | 0 .../builds/es6-target/{ => src}/models/index.ts | 0 .../builds/es6-target/{ => src}/runtime.ts | 0 .../typescript-fetch/builds/es6-target/tsconfig.json | 1 - .../multiple-parameters/{ => src}/apis/PetApi.ts | 0 .../multiple-parameters/{ => src}/apis/StoreApi.ts | 0 .../multiple-parameters/{ => src}/apis/UserApi.ts | 0 .../multiple-parameters/{ => src}/apis/index.ts | 0 .../builds/multiple-parameters/{ => src}/index.ts | 0 .../multiple-parameters/{ => src}/models/Category.ts | 0 .../{ => src}/models/ModelApiResponse.ts | 0 .../multiple-parameters/{ => src}/models/Order.ts | 0 .../multiple-parameters/{ => src}/models/Pet.ts | 0 .../multiple-parameters/{ => src}/models/Tag.ts | 0 .../multiple-parameters/{ => src}/models/User.ts | 0 .../multiple-parameters/{ => src}/models/index.ts | 0 .../builds/multiple-parameters/{ => src}/runtime.ts | 0 .../builds/multiple-parameters/tsconfig.json | 1 - .../builds/with-interfaces/{ => src}/apis/PetApi.ts | 0 .../builds/with-interfaces/{ => src}/apis/StoreApi.ts | 0 .../builds/with-interfaces/{ => src}/apis/UserApi.ts | 0 .../builds/with-interfaces/{ => src}/apis/index.ts | 0 .../builds/with-interfaces/{ => src}/index.ts | 0 .../with-interfaces/{ => src}/models/Category.ts | 0 .../{ => src}/models/ModelApiResponse.ts | 0 .../builds/with-interfaces/{ => src}/models/Order.ts | 0 .../builds/with-interfaces/{ => src}/models/Pet.ts | 0 .../builds/with-interfaces/{ => src}/models/Tag.ts | 0 .../builds/with-interfaces/{ => src}/models/User.ts | 0 .../builds/with-interfaces/{ => src}/models/index.ts | 0 .../builds/with-interfaces/{ => src}/runtime.ts | 0 .../builds/with-interfaces/tsconfig.json | 1 - .../builds/with-npm-version/.npmignore | 1 + .../builds/with-npm-version/package.json | 2 +- .../builds/with-npm-version/{ => src}/apis/PetApi.ts | 0 .../with-npm-version/{ => src}/apis/StoreApi.ts | 0 .../builds/with-npm-version/{ => src}/apis/UserApi.ts | 0 .../builds/with-npm-version/{ => src}/apis/index.ts | 0 .../builds/with-npm-version/{ => src}/index.ts | 0 .../with-npm-version/{ => src}/models/Category.ts | 0 .../{ => src}/models/ModelApiResponse.ts | 0 .../builds/with-npm-version/{ => src}/models/Order.ts | 0 .../builds/with-npm-version/{ => src}/models/Pet.ts | 0 .../builds/with-npm-version/{ => src}/models/Tag.ts | 0 .../builds/with-npm-version/{ => src}/models/User.ts | 0 .../builds/with-npm-version/{ => src}/models/index.ts | 0 .../builds/with-npm-version/{ => src}/runtime.ts | 0 .../builds/with-npm-version/tsconfig.json | 1 - 78 files changed, 12 insertions(+), 14 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/typescript-fetch/npmignore.mustache rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/apis/PetApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/apis/StoreApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/apis/UserApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/apis/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/models/Category.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/models/ModelApiResponse.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/models/Order.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/models/Pet.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/models/Tag.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/models/User.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/models/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/default/{ => src}/runtime.ts (100%) create mode 100644 samples/client/petstore/typescript-fetch/builds/es6-target/.npmignore rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/apis/PetApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/apis/StoreApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/apis/UserApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/apis/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/models/Category.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/models/ModelApiResponse.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/models/Order.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/models/Pet.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/models/Tag.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/models/User.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/models/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/es6-target/{ => src}/runtime.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/apis/PetApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/apis/StoreApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/apis/UserApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/apis/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/models/Category.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/models/ModelApiResponse.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/models/Order.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/models/Pet.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/models/Tag.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/models/User.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/models/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/multiple-parameters/{ => src}/runtime.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/apis/PetApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/apis/StoreApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/apis/UserApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/apis/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/models/Category.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/models/ModelApiResponse.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/models/Order.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/models/Pet.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/models/Tag.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/models/User.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/models/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-interfaces/{ => src}/runtime.ts (100%) create mode 100644 samples/client/petstore/typescript-fetch/builds/with-npm-version/.npmignore rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/apis/PetApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/apis/StoreApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/apis/UserApi.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/apis/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/models/Category.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/models/ModelApiResponse.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/models/Order.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/models/Pet.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/models/Tag.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/models/User.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/models/index.ts (100%) rename samples/client/petstore/typescript-fetch/builds/with-npm-version/{ => src}/runtime.ts (100%) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java index f6634095610..41986aa24fc 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java @@ -50,9 +50,9 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege outputFolder = "generated-code/typescript-fetch"; embeddedTemplateDir = templateDir = "typescript-fetch"; - this.apiPackage = "apis"; + this.apiPackage = "src" + File.separator +"apis"; + this.modelPackage = "src" + File.separator + "models"; this.apiTemplateFiles.put("apis.mustache", ".ts"); - this.modelPackage = "models"; this.modelTemplateFiles.put("models.mustache", ".ts"); this.addExtraReservedWords(); @@ -84,8 +84,8 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege super.processOpts(); additionalProperties.put("isOriginalModelPropertyNaming", getModelPropertyNaming().equals("original")); additionalProperties.put("modelPropertyNaming", getModelPropertyNaming()); - supportingFiles.add(new SupportingFile("index.mustache", "", "index.ts")); - supportingFiles.add(new SupportingFile("runtime.mustache", "", "runtime.ts")); + supportingFiles.add(new SupportingFile("index.mustache", "src", "index.ts")); + supportingFiles.add(new SupportingFile("runtime.mustache", "src", "runtime.ts")); supportingFiles.add(new SupportingFile("tsconfig.mustache", "", "tsconfig.json")); supportingFiles.add(new SupportingFile("gitignore", "", ".gitignore")); @@ -188,6 +188,7 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege //Files for building our lib supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); supportingFiles.add(new SupportingFile("package.mustache", "", "package.json")); + supportingFiles.add(new SupportingFile("npmignore.mustache", "", ".npmignore")); } @Override @@ -216,7 +217,7 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege // models for a given operation. List> imports = (List>) operations.get("imports"); for (Map im : imports) { - im.put("className", im.get("import").toString().replace("models.", "")); + im.put("className", im.get("import").toString().replace(modelPackage() + ".", "")); } } diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/npmignore.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/npmignore.mustache new file mode 100644 index 00000000000..42061c01a1c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/npmignore.mustache @@ -0,0 +1 @@ +README.md \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/package.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/package.mustache index 5bfbc1a9236..1c9d9e55bbf 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/package.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/package.mustache @@ -6,7 +6,7 @@ "main": "./dist/index.js", "typings": "./dist/index.d.ts", "scripts" : { - "build": "tsc --outDir dist/", + "build": "tsc", "prepare": "npm run build" }, "devDependencies": { diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/tsconfig.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/tsconfig.mustache index 328c7d4e141..420c3a44f88 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/tsconfig.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/tsconfig.mustache @@ -5,7 +5,6 @@ "module": "commonjs", "moduleResolution": "node", "outDir": "dist", - "rootDir": ".", {{^supportsES6}} "lib": [ "es6", diff --git a/samples/client/petstore/typescript-fetch/builds/default/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/default/src/apis/PetApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/apis/PetApi.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/apis/PetApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/default/src/apis/StoreApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/apis/StoreApi.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/apis/StoreApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/default/src/apis/UserApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/apis/UserApi.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/apis/UserApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/apis/index.ts b/samples/client/petstore/typescript-fetch/builds/default/src/apis/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/apis/index.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/apis/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/index.ts b/samples/client/petstore/typescript-fetch/builds/default/src/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/index.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/Category.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/models/Category.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/models/Category.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/ModelApiResponse.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/models/ModelApiResponse.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/models/ModelApiResponse.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/Order.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/models/Order.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/models/Order.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/Pet.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/models/Pet.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/models/Pet.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/Tag.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/models/Tag.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/models/Tag.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/User.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/User.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/models/User.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/models/User.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/models/index.ts b/samples/client/petstore/typescript-fetch/builds/default/src/models/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/models/index.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/models/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/runtime.ts b/samples/client/petstore/typescript-fetch/builds/default/src/runtime.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/default/runtime.ts rename to samples/client/petstore/typescript-fetch/builds/default/src/runtime.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/tsconfig.json b/samples/client/petstore/typescript-fetch/builds/default/tsconfig.json index d65f2a95afc..4567ec19899 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/tsconfig.json +++ b/samples/client/petstore/typescript-fetch/builds/default/tsconfig.json @@ -5,7 +5,6 @@ "module": "commonjs", "moduleResolution": "node", "outDir": "dist", - "rootDir": ".", "lib": [ "es6", "dom" diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/.npmignore b/samples/client/petstore/typescript-fetch/builds/es6-target/.npmignore new file mode 100644 index 00000000000..42061c01a1c --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/.npmignore @@ -0,0 +1 @@ +README.md \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/package.json b/samples/client/petstore/typescript-fetch/builds/es6-target/package.json index 84e82f3f158..3ea8a1ec706 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/package.json +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/package.json @@ -6,7 +6,7 @@ "main": "./dist/index.js", "typings": "./dist/index.d.ts", "scripts" : { - "build": "tsc --outDir dist/", + "build": "tsc", "prepare": "npm run build" }, "devDependencies": { diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/PetApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/apis/PetApi.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/PetApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/StoreApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/apis/StoreApi.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/StoreApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/UserApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/apis/UserApi.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/UserApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/apis/index.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/apis/index.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/apis/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/index.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/index.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Category.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/models/Category.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Category.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/ModelApiResponse.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/models/ModelApiResponse.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/models/ModelApiResponse.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Order.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/models/Order.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Order.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Pet.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/models/Pet.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Pet.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Tag.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/models/Tag.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/models/Tag.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/models/User.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/User.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/models/User.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/models/User.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/models/index.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/models/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/models/index.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/models/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/runtime.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/es6-target/runtime.ts rename to samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/tsconfig.json b/samples/client/petstore/typescript-fetch/builds/es6-target/tsconfig.json index 6cc02878fb7..250280d9ab0 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/tsconfig.json +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/tsconfig.json @@ -5,7 +5,6 @@ "module": "commonjs", "moduleResolution": "node", "outDir": "dist", - "rootDir": ".", "typeRoots": [ "node_modules/@types" ] diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/PetApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/PetApi.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/PetApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/StoreApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/StoreApi.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/StoreApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/UserApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/UserApi.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/UserApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/index.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/apis/index.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/apis/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/index.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/index.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Category.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Category.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Category.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/ModelApiResponse.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/ModelApiResponse.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/ModelApiResponse.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Order.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Order.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Order.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Pet.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Pet.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Pet.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Tag.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/Tag.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/Tag.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/User.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/User.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/User.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/User.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/index.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/models/index.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/models/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/runtime.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/multiple-parameters/runtime.ts rename to samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/runtime.ts diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/tsconfig.json b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/tsconfig.json index d65f2a95afc..4567ec19899 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/tsconfig.json +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/tsconfig.json @@ -5,7 +5,6 @@ "module": "commonjs", "moduleResolution": "node", "outDir": "dist", - "rootDir": ".", "lib": [ "es6", "dom" diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/PetApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/PetApi.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/PetApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/StoreApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/StoreApi.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/StoreApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/UserApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/UserApi.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/UserApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/index.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/apis/index.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/apis/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/index.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/index.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Category.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Category.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Category.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/ModelApiResponse.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/models/ModelApiResponse.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/ModelApiResponse.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Order.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Order.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Order.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Pet.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Pet.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Pet.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Tag.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/models/Tag.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/Tag.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/User.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/User.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/models/User.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/User.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/models/index.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/models/index.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/models/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/runtime.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-interfaces/runtime.ts rename to samples/client/petstore/typescript-fetch/builds/with-interfaces/src/runtime.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/tsconfig.json b/samples/client/petstore/typescript-fetch/builds/with-interfaces/tsconfig.json index d65f2a95afc..4567ec19899 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/tsconfig.json +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/tsconfig.json @@ -5,7 +5,6 @@ "module": "commonjs", "moduleResolution": "node", "outDir": "dist", - "rootDir": ".", "lib": [ "es6", "dom" diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.npmignore b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.npmignore new file mode 100644 index 00000000000..42061c01a1c --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.npmignore @@ -0,0 +1 @@ +README.md \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json b/samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json index 84e82f3f158..3ea8a1ec706 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json @@ -6,7 +6,7 @@ "main": "./dist/index.js", "typings": "./dist/index.d.ts", "scripts" : { - "build": "tsc --outDir dist/", + "build": "tsc", "prepare": "npm run build" }, "devDependencies": { diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/PetApi.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/PetApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/PetApi.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/PetApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/StoreApi.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/StoreApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/StoreApi.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/StoreApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/UserApi.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/UserApi.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/UserApi.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/UserApi.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/index.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/apis/index.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/apis/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/index.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/index.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/Category.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Category.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/models/Category.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Category.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/ModelApiResponse.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/ModelApiResponse.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/models/ModelApiResponse.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/ModelApiResponse.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/Order.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Order.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/models/Order.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Order.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/Pet.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Pet.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/models/Pet.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Pet.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/Tag.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Tag.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/models/Tag.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/Tag.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/User.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/User.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/models/User.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/User.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/models/index.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/index.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/models/index.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/models/index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/runtime.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts similarity index 100% rename from samples/client/petstore/typescript-fetch/builds/with-npm-version/runtime.ts rename to samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/tsconfig.json b/samples/client/petstore/typescript-fetch/builds/with-npm-version/tsconfig.json index d65f2a95afc..4567ec19899 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/tsconfig.json +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/tsconfig.json @@ -5,7 +5,6 @@ "module": "commonjs", "moduleResolution": "node", "outDir": "dist", - "rootDir": ".", "lib": [ "es6", "dom" From 4478f429278405f15828fa6104ca8e35ad00770b Mon Sep 17 00:00:00 2001 From: Richard Whitehouse Date: Tue, 6 Aug 2019 18:44:51 +0100 Subject: [PATCH 58/75] [Rust Server] Generate valid Rustdocs for lazy_static items (#3556) Generate valid Rustdocs for lazy_static items and update samples --- .../resources/rust-server/mimetypes.mustache | 9 +- .../output/multipart-v3/src/mimetypes.rs | 3 +- .../output/openapi-v3/src/mimetypes.rs | 21 ++-- .../src/mimetypes.rs | 111 ++++++++++++------ .../output/rust-server-test/src/mimetypes.rs | 15 ++- 5 files changed, 106 insertions(+), 53 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/rust-server/mimetypes.mustache b/modules/openapi-generator/src/main/resources/rust-server/mimetypes.mustache index d0acd71dc0a..b8492bebf98 100644 --- a/modules/openapi-generator/src/main/resources/rust-server/mimetypes.mustache +++ b/modules/openapi-generator/src/main/resources/rust-server/mimetypes.mustache @@ -4,8 +4,9 @@ pub mod responses { use hyper::mime::*; // The macro is called per-operation to beat the recursion limit -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}{{#responses}}{{#produces}}{{#-first}}{{#dataType}} /// Create Mime objects for the response content types for {{{operationId}}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}{{#responses}}{{#produces}}{{#-first}}{{#dataType}} lazy_static! { + /// Create Mime objects for the response content types for {{{operationId}}} pub static ref {{#vendorExtensions}}{{{uppercase_operation_id}}}_{{x-uppercaseResponseId}}{{/vendorExtensions}}: Mime = "{{{mediaType}}}".parse().unwrap(); } {{/dataType}}{{/-first}}{{/produces}}{{/responses}}{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} @@ -13,12 +14,14 @@ pub mod responses { pub mod requests { use hyper::mime::*; -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}{{#bodyParam}} /// Create Mime objects for the request content types for {{{operationId}}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}{{#bodyParam}} lazy_static! { + /// Create Mime objects for the request content types for {{{operationId}}} pub static ref {{#vendorExtensions}}{{{uppercase_operation_id}}}{{/vendorExtensions}}: Mime = "{{#consumes}}{{#-first}}{{{mediaType}}}{{/-first}}{{/consumes}}{{^consumes}}application/json{{/consumes}}".parse().unwrap(); } -{{/bodyParam}}{{^bodyParam}}{{#vendorExtensions}}{{#formParams}}{{#-first}} /// Create Mime objects for the request content types for {{{operationId}}} +{{/bodyParam}}{{^bodyParam}}{{#vendorExtensions}}{{#formParams}}{{#-first}} lazy_static! { + /// Create Mime objects for the request content types for {{{operationId}}} pub static ref {{#vendorExtensions}}{{{uppercase_operation_id}}}{{/vendorExtensions}}: Mime = "{{#consumes}}{{#-first}}{{{mediaType}}}{{/-first}}{{/consumes}}{{^consumes}}application/x-www-form-urlencoded{{/consumes}}".parse().unwrap(); } {{/-first}}{{/formParams}}{{/vendorExtensions}}{{/bodyParam}}{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} diff --git a/samples/server/petstore/rust-server/output/multipart-v3/src/mimetypes.rs b/samples/server/petstore/rust-server/output/multipart-v3/src/mimetypes.rs index 45d98f894cd..8ad9f7780eb 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/src/mimetypes.rs +++ b/samples/server/petstore/rust-server/output/multipart-v3/src/mimetypes.rs @@ -9,8 +9,9 @@ pub mod responses { pub mod requests { use hyper::mime::*; - /// Create Mime objects for the request content types for MultipartRequestPost + lazy_static! { + /// Create Mime objects for the request content types for MultipartRequestPost pub static ref MULTIPART_REQUEST_POST: Mime = "multipart/form-data".parse().unwrap(); } diff --git a/samples/server/petstore/rust-server/output/openapi-v3/src/mimetypes.rs b/samples/server/petstore/rust-server/output/openapi-v3/src/mimetypes.rs index 13936792a1f..aabb888501a 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/src/mimetypes.rs +++ b/samples/server/petstore/rust-server/output/openapi-v3/src/mimetypes.rs @@ -4,8 +4,9 @@ pub mod responses { use hyper::mime::*; // The macro is called per-operation to beat the recursion limit - /// Create Mime objects for the response content types for UuidGet + lazy_static! { + /// Create Mime objects for the response content types for UuidGet pub static ref UUID_GET_DUPLICATE_RESPONSE_LONG_TEXT: Mime = "application/json".parse().unwrap(); } @@ -13,28 +14,34 @@ pub mod responses { pub mod requests { use hyper::mime::*; - /// Create Mime objects for the request content types for RequiredOctetStreamPut + lazy_static! { + /// Create Mime objects for the request content types for RequiredOctetStreamPut pub static ref REQUIRED_OCTET_STREAM_PUT: Mime = "application/octet-stream".parse().unwrap(); } - /// Create Mime objects for the request content types for XmlExtraPost + lazy_static! { + /// Create Mime objects for the request content types for XmlExtraPost pub static ref XML_EXTRA_POST: Mime = "application/xml".parse().unwrap(); } - /// Create Mime objects for the request content types for XmlOtherPost + lazy_static! { + /// Create Mime objects for the request content types for XmlOtherPost pub static ref XML_OTHER_POST: Mime = "application/xml".parse().unwrap(); } - /// Create Mime objects for the request content types for XmlOtherPut + lazy_static! { + /// Create Mime objects for the request content types for XmlOtherPut pub static ref XML_OTHER_PUT: Mime = "application/xml".parse().unwrap(); } - /// Create Mime objects for the request content types for XmlPost + lazy_static! { + /// Create Mime objects for the request content types for XmlPost pub static ref XML_POST: Mime = "application/xml".parse().unwrap(); } - /// Create Mime objects for the request content types for XmlPut + lazy_static! { + /// Create Mime objects for the request content types for XmlPut pub static ref XML_PUT: Mime = "application/xml".parse().unwrap(); } diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/mimetypes.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/mimetypes.rs index afe949238ce..e947e94b363 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/mimetypes.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/mimetypes.rs @@ -4,68 +4,84 @@ pub mod responses { use hyper::mime::*; // The macro is called per-operation to beat the recursion limit - /// Create Mime objects for the response content types for TestSpecialTags + lazy_static! { + /// Create Mime objects for the response content types for TestSpecialTags pub static ref TEST_SPECIAL_TAGS_SUCCESSFUL_OPERATION: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the response content types for FakeOuterBooleanSerialize + lazy_static! { + /// Create Mime objects for the response content types for FakeOuterBooleanSerialize pub static ref FAKE_OUTER_BOOLEAN_SERIALIZE_OUTPUT_BOOLEAN: Mime = "*/*".parse().unwrap(); } - /// Create Mime objects for the response content types for FakeOuterCompositeSerialize + lazy_static! { + /// Create Mime objects for the response content types for FakeOuterCompositeSerialize pub static ref FAKE_OUTER_COMPOSITE_SERIALIZE_OUTPUT_COMPOSITE: Mime = "*/*".parse().unwrap(); } - /// Create Mime objects for the response content types for FakeOuterNumberSerialize + lazy_static! { + /// Create Mime objects for the response content types for FakeOuterNumberSerialize pub static ref FAKE_OUTER_NUMBER_SERIALIZE_OUTPUT_NUMBER: Mime = "*/*".parse().unwrap(); } - /// Create Mime objects for the response content types for FakeOuterStringSerialize + lazy_static! { + /// Create Mime objects for the response content types for FakeOuterStringSerialize pub static ref FAKE_OUTER_STRING_SERIALIZE_OUTPUT_STRING: Mime = "*/*".parse().unwrap(); } - /// Create Mime objects for the response content types for TestClientModel + lazy_static! { + /// Create Mime objects for the response content types for TestClientModel pub static ref TEST_CLIENT_MODEL_SUCCESSFUL_OPERATION: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the response content types for TestClassname + lazy_static! { + /// Create Mime objects for the response content types for TestClassname pub static ref TEST_CLASSNAME_SUCCESSFUL_OPERATION: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the response content types for FindPetsByStatus + lazy_static! { + /// Create Mime objects for the response content types for FindPetsByStatus pub static ref FIND_PETS_BY_STATUS_SUCCESSFUL_OPERATION: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the response content types for FindPetsByTags + lazy_static! { + /// Create Mime objects for the response content types for FindPetsByTags pub static ref FIND_PETS_BY_TAGS_SUCCESSFUL_OPERATION: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the response content types for GetPetById + lazy_static! { + /// Create Mime objects for the response content types for GetPetById pub static ref GET_PET_BY_ID_SUCCESSFUL_OPERATION: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the response content types for UploadFile + lazy_static! { + /// Create Mime objects for the response content types for UploadFile pub static ref UPLOAD_FILE_SUCCESSFUL_OPERATION: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the response content types for GetInventory + lazy_static! { + /// Create Mime objects for the response content types for GetInventory pub static ref GET_INVENTORY_SUCCESSFUL_OPERATION: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the response content types for GetOrderById + lazy_static! { + /// Create Mime objects for the response content types for GetOrderById pub static ref GET_ORDER_BY_ID_SUCCESSFUL_OPERATION: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the response content types for PlaceOrder + lazy_static! { + /// Create Mime objects for the response content types for PlaceOrder pub static ref PLACE_ORDER_SUCCESSFUL_OPERATION: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the response content types for GetUserByName + lazy_static! { + /// Create Mime objects for the response content types for GetUserByName pub static ref GET_USER_BY_NAME_SUCCESSFUL_OPERATION: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the response content types for LoginUser + lazy_static! { + /// Create Mime objects for the response content types for LoginUser pub static ref LOGIN_USER_SUCCESSFUL_OPERATION: Mime = "application/json".parse().unwrap(); } @@ -73,88 +89,109 @@ pub mod responses { pub mod requests { use hyper::mime::*; - /// Create Mime objects for the request content types for TestSpecialTags + lazy_static! { + /// Create Mime objects for the request content types for TestSpecialTags pub static ref TEST_SPECIAL_TAGS: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the request content types for FakeOuterBooleanSerialize + lazy_static! { + /// Create Mime objects for the request content types for FakeOuterBooleanSerialize pub static ref FAKE_OUTER_BOOLEAN_SERIALIZE: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the request content types for FakeOuterCompositeSerialize + lazy_static! { + /// Create Mime objects for the request content types for FakeOuterCompositeSerialize pub static ref FAKE_OUTER_COMPOSITE_SERIALIZE: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the request content types for FakeOuterNumberSerialize + lazy_static! { + /// Create Mime objects for the request content types for FakeOuterNumberSerialize pub static ref FAKE_OUTER_NUMBER_SERIALIZE: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the request content types for FakeOuterStringSerialize + lazy_static! { + /// Create Mime objects for the request content types for FakeOuterStringSerialize pub static ref FAKE_OUTER_STRING_SERIALIZE: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the request content types for TestBodyWithQueryParams + lazy_static! { + /// Create Mime objects for the request content types for TestBodyWithQueryParams pub static ref TEST_BODY_WITH_QUERY_PARAMS: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the request content types for TestClientModel + lazy_static! { + /// Create Mime objects for the request content types for TestClientModel pub static ref TEST_CLIENT_MODEL: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the request content types for TestEndpointParameters + lazy_static! { + /// Create Mime objects for the request content types for TestEndpointParameters pub static ref TEST_ENDPOINT_PARAMETERS: Mime = "application/x-www-form-urlencoded".parse().unwrap(); } - /// Create Mime objects for the request content types for TestEnumParameters + lazy_static! { + /// Create Mime objects for the request content types for TestEnumParameters pub static ref TEST_ENUM_PARAMETERS: Mime = "application/x-www-form-urlencoded".parse().unwrap(); } - /// Create Mime objects for the request content types for TestInlineAdditionalProperties + lazy_static! { + /// Create Mime objects for the request content types for TestInlineAdditionalProperties pub static ref TEST_INLINE_ADDITIONAL_PROPERTIES: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the request content types for TestJsonFormData + lazy_static! { + /// Create Mime objects for the request content types for TestJsonFormData pub static ref TEST_JSON_FORM_DATA: Mime = "application/x-www-form-urlencoded".parse().unwrap(); } - /// Create Mime objects for the request content types for TestClassname + lazy_static! { + /// Create Mime objects for the request content types for TestClassname pub static ref TEST_CLASSNAME: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the request content types for AddPet + lazy_static! { + /// Create Mime objects for the request content types for AddPet pub static ref ADD_PET: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the request content types for UpdatePet + lazy_static! { + /// Create Mime objects for the request content types for UpdatePet pub static ref UPDATE_PET: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the request content types for UpdatePetWithForm + lazy_static! { + /// Create Mime objects for the request content types for UpdatePetWithForm pub static ref UPDATE_PET_WITH_FORM: Mime = "application/x-www-form-urlencoded".parse().unwrap(); } - /// Create Mime objects for the request content types for UploadFile + lazy_static! { + /// Create Mime objects for the request content types for UploadFile pub static ref UPLOAD_FILE: Mime = "multipart/form-data".parse().unwrap(); } - /// Create Mime objects for the request content types for PlaceOrder + lazy_static! { + /// Create Mime objects for the request content types for PlaceOrder pub static ref PLACE_ORDER: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the request content types for CreateUser + lazy_static! { + /// Create Mime objects for the request content types for CreateUser pub static ref CREATE_USER: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the request content types for CreateUsersWithArrayInput + lazy_static! { + /// Create Mime objects for the request content types for CreateUsersWithArrayInput pub static ref CREATE_USERS_WITH_ARRAY_INPUT: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the request content types for CreateUsersWithListInput + lazy_static! { + /// Create Mime objects for the request content types for CreateUsersWithListInput pub static ref CREATE_USERS_WITH_LIST_INPUT: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the request content types for UpdateUser + lazy_static! { + /// Create Mime objects for the request content types for UpdateUser pub static ref UPDATE_USER: Mime = "application/json".parse().unwrap(); } diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/mimetypes.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/mimetypes.rs index 01fdce1e902..301f2481658 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/src/mimetypes.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/mimetypes.rs @@ -4,16 +4,19 @@ pub mod responses { use hyper::mime::*; // The macro is called per-operation to beat the recursion limit - /// Create Mime objects for the response content types for FileResponseGet + lazy_static! { + /// Create Mime objects for the response content types for FileResponseGet pub static ref FILE_RESPONSE_GET_SUCCESS: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the response content types for HtmlPost + lazy_static! { + /// Create Mime objects for the response content types for HtmlPost pub static ref HTML_POST_SUCCESS: Mime = "text/html".parse().unwrap(); } - /// Create Mime objects for the response content types for RawJsonGet + lazy_static! { + /// Create Mime objects for the response content types for RawJsonGet pub static ref RAW_JSON_GET_SUCCESS: Mime = "*/*".parse().unwrap(); } @@ -21,12 +24,14 @@ pub mod responses { pub mod requests { use hyper::mime::*; - /// Create Mime objects for the request content types for DummyPut + lazy_static! { + /// Create Mime objects for the request content types for DummyPut pub static ref DUMMY_PUT: Mime = "application/json".parse().unwrap(); } - /// Create Mime objects for the request content types for HtmlPost + lazy_static! { + /// Create Mime objects for the request content types for HtmlPost pub static ref HTML_POST: Mime = "text/html".parse().unwrap(); } From 411199bc9954c14779201e569d5f475ffb3e4be0 Mon Sep 17 00:00:00 2001 From: cgensoul <53224246+cgensoul@users.noreply.github.com> Date: Wed, 7 Aug 2019 05:25:32 +0200 Subject: [PATCH 59/75] [OCaml] Added optional params support in API operations (#3568) * Added handling of api keys in headers. * Added handling of optional arguments in api functions. * Optional header params. * Fixed a bug in path param replacement. * Relaxed deserializing of model records with @@deriving yojson { strict = false }. It allows receiving more fields in the JSon payload than declared in the OCaml record, fields not matching any record field are ignored. * Reformatted api-impl.mustache. * Generate shorter enum value names by allowing underscore character. * Cleanup of optional params generation. * Updated the OCaml samples with the latest version of the generator. * Corrected a bug encountered when generating default value for optional enum fields. * Added v3 version of the samples for the OCaml generator. --- .../codegen/languages/OCamlClientCodegen.java | 16 +- .../main/resources/ocaml/api-impl.mustache | 63 ++++++-- .../main/resources/ocaml/api-intf.mustache | 2 +- .../src/main/resources/ocaml/model.mustache | 4 +- .../src/main/resources/ocaml/support.mustache | 53 ++++++- .../ocaml/to_optional_prefix.mustache | 1 + .../main/resources/ocaml/to_param.mustache | 1 + .../main/resources/ocaml/to_string.mustache | 2 +- .../client/petstore/ocaml/src/apis/pet_api.ml | 39 ++--- .../petstore/ocaml/src/apis/pet_api.mli | 16 +- .../petstore/ocaml/src/apis/store_api.ml | 11 +- .../petstore/ocaml/src/apis/store_api.mli | 6 +- .../petstore/ocaml/src/apis/user_api.ml | 24 +-- .../petstore/ocaml/src/apis/user_api.mli | 14 +- .../petstore/ocaml/src/models/api_response.ml | 2 +- .../petstore/ocaml/src/models/category.ml | 2 +- .../client/petstore/ocaml/src/models/order.ml | 2 +- .../client/petstore/ocaml/src/models/pet.ml | 2 +- .../client/petstore/ocaml/src/models/tag.ml | 2 +- .../client/petstore/ocaml/src/models/user.ml | 2 +- .../petstore/ocaml/src/support/request.ml | 53 ++++++- .../petstore/ocaml/.openapi-generator-ignore | 23 +++ .../petstore/ocaml/.openapi-generator/VERSION | 1 + .../openapi3/client/petstore/ocaml/README.md | 27 ++++ samples/openapi3/client/petstore/ocaml/dune | 9 ++ .../client/petstore/ocaml/dune-project | 2 + .../petstore/ocaml/petstore_client.opam | 15 ++ .../ocaml/src/apis/another_fake_api.ml | 15 ++ .../ocaml/src/apis/another_fake_api.mli | 8 + .../petstore/ocaml/src/apis/default_api.ml | 14 ++ .../petstore/ocaml/src/apis/default_api.mli | 8 + .../petstore/ocaml/src/apis/fake_api.ml | 143 ++++++++++++++++++ .../petstore/ocaml/src/apis/fake_api.mli | 20 +++ .../src/apis/fake_classname_tags123_api.ml | 16 ++ .../src/apis/fake_classname_tags123_api.mli | 8 + .../client/petstore/ocaml/src/apis/pet_api.ml | 93 ++++++++++++ .../petstore/ocaml/src/apis/pet_api.mli | 16 ++ .../petstore/ocaml/src/apis/store_api.ml | 39 +++++ .../petstore/ocaml/src/apis/store_api.mli | 11 ++ .../petstore/ocaml/src/apis/user_api.ml | 72 +++++++++ .../petstore/ocaml/src/apis/user_api.mli | 15 ++ .../src/models/additional_properties_class.ml | 17 +++ .../petstore/ocaml/src/models/animal.ml | 17 +++ .../petstore/ocaml/src/models/api_response.ml | 19 +++ .../models/array_of_array_of_number_only.ml | 15 ++ .../ocaml/src/models/array_of_number_only.ml | 15 ++ .../petstore/ocaml/src/models/array_test.ml | 19 +++ .../ocaml/src/models/capitalization.ml | 26 ++++ .../client/petstore/ocaml/src/models/cat.ml | 19 +++ .../petstore/ocaml/src/models/cat_all_of.ml | 15 ++ .../petstore/ocaml/src/models/category.ml | 17 +++ .../petstore/ocaml/src/models/class_model.ml | 17 +++ .../petstore/ocaml/src/models/client.ml | 15 ++ .../client/petstore/ocaml/src/models/dog.ml | 19 +++ .../petstore/ocaml/src/models/dog_all_of.ml | 15 ++ .../petstore/ocaml/src/models/enum_arrays.ml | 17 +++ .../petstore/ocaml/src/models/enum_test.ml | 29 ++++ .../client/petstore/ocaml/src/models/file.ml | 18 +++ .../src/models/file_schema_test_class.ml | 17 +++ .../client/petstore/ocaml/src/models/foo.ml | 15 ++ .../petstore/ocaml/src/models/format_test.ml | 45 ++++++ .../ocaml/src/models/has_only_read_only.ml | 17 +++ .../ocaml/src/models/health_check_result.ml | 17 +++ .../ocaml/src/models/inline_object.ml | 19 +++ .../ocaml/src/models/inline_object_1.ml | 19 +++ .../ocaml/src/models/inline_object_2.ml | 19 +++ .../ocaml/src/models/inline_object_3.ml | 55 +++++++ .../ocaml/src/models/inline_object_4.ml | 19 +++ .../ocaml/src/models/inline_object_5.ml | 19 +++ .../src/models/inline_response_default.ml | 15 ++ .../petstore/ocaml/src/models/map_test.ml | 21 +++ ...perties_and_additional_properties_class.ml | 19 +++ .../ocaml/src/models/model_200_response.ml | 19 +++ .../src/models/model__special_model_name_.ml | 15 ++ .../client/petstore/ocaml/src/models/name.ml | 23 +++ .../ocaml/src/models/nullable_class.ml | 37 +++++ .../petstore/ocaml/src/models/number_only.ml | 15 ++ .../client/petstore/ocaml/src/models/order.ml | 26 ++++ .../ocaml/src/models/outer_composite.ml | 19 +++ .../client/petstore/ocaml/src/models/pet.ml | 26 ++++ .../ocaml/src/models/read_only_first.ml | 17 +++ .../petstore/ocaml/src/models/return.ml | 17 +++ .../client/petstore/ocaml/src/models/tag.ml | 17 +++ .../client/petstore/ocaml/src/models/user.ml | 30 ++++ .../petstore/ocaml/src/support/enums.ml | 142 +++++++++++++++++ .../petstore/ocaml/src/support/jsonSupport.ml | 55 +++++++ .../petstore/ocaml/src/support/request.ml | 97 ++++++++++++ 87 files changed, 1962 insertions(+), 90 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/ocaml/to_optional_prefix.mustache create mode 100644 modules/openapi-generator/src/main/resources/ocaml/to_param.mustache create mode 100644 samples/openapi3/client/petstore/ocaml/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/ocaml/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/ocaml/README.md create mode 100644 samples/openapi3/client/petstore/ocaml/dune create mode 100644 samples/openapi3/client/petstore/ocaml/dune-project create mode 100644 samples/openapi3/client/petstore/ocaml/petstore_client.opam create mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/another_fake_api.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/another_fake_api.mli create mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/default_api.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/default_api.mli create mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/fake_api.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/fake_api.mli create mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/fake_classname_tags123_api.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/fake_classname_tags123_api.mli create mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/pet_api.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/pet_api.mli create mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/store_api.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/store_api.mli create mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/user_api.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/user_api.mli create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/additional_properties_class.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/animal.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/api_response.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/array_of_array_of_number_only.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/array_of_number_only.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/array_test.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/capitalization.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/cat.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/cat_all_of.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/category.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/class_model.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/client.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/dog.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/dog_all_of.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/enum_arrays.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/enum_test.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/file.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/file_schema_test_class.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/foo.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/format_test.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/has_only_read_only.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/health_check_result.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/inline_object.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/inline_object_1.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/inline_object_2.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/inline_object_3.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/inline_object_4.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/inline_object_5.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/inline_response_default.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/map_test.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/mixed_properties_and_additional_properties_class.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/model_200_response.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/model__special_model_name_.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/name.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/nullable_class.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/number_only.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/order.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/outer_composite.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/pet.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/read_only_first.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/return.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/tag.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/models/user.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/support/enums.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/support/jsonSupport.ml create mode 100644 samples/openapi3/client/petstore/ocaml/src/support/request.ml diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java index 2e388012b15..a1fc7753de3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java @@ -33,6 +33,7 @@ import java.util.*; import java.util.stream.Collectors; import static org.apache.commons.lang3.StringUtils.capitalize; +import static org.openapitools.codegen.utils.StringUtils.escape; import static org.openapitools.codegen.utils.StringUtils.underscore; public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig { @@ -631,9 +632,19 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig return result; } + public String toEnumValueName(String name) { + if (reservedWords.contains(name)) { + return escapeReservedWord(name); + } else if (((CharSequence) name).chars().anyMatch(character -> specialCharReplacements.keySet().contains("" + ((char) character)))) { + return escape(name, specialCharReplacements, Collections.singletonList("_"), null); + } else { + return name; + } + } + private String ocamlizeEnumValue(String value) { String sanitizedValue = - super.toVarName(value.isEmpty() ? "empty" : value) + toEnumValueName(value.isEmpty() ? "empty" : value) .replace(" ", "_"); if (!sanitizedValue.matches("^[a-zA-Z_].*")) { @@ -735,6 +746,9 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig @Override public String toDefaultValue(Schema p) { if (p.getDefault() != null) { + if (p.getEnum() != null) { + return ocamlizeEnumValue(p.getDefault().toString()); + } return p.getDefault().toString(); } else { return null; diff --git a/modules/openapi-generator/src/main/resources/ocaml/api-impl.mustache b/modules/openapi-generator/src/main/resources/ocaml/api-impl.mustache index dc0c5d96776..8e86eeb45ab 100644 --- a/modules/openapi-generator/src/main/resources/ocaml/api-impl.mustache +++ b/modules/openapi-generator/src/main/resources/ocaml/api-impl.mustache @@ -10,21 +10,58 @@ {{#operations}} {{#operation}} -let {{{operationId}}} {{^hasParams}}(){{/hasParams}}{{#allParams}}{{{paramName}}}{{#hasMore}} {{/hasMore}}{{/allParams}} = +let {{{operationId}}} {{^hasParams}}(){{/hasParams}}{{#allParams}}{{> to_param}}{{#hasMore}} {{/hasMore}}{{#-last}}{{^required}} (){{/required}}{{/-last}}{{/allParams}} = let open Lwt in let uri = Request.build_uri "{{{path}}}" in - let headers = Request.default_headers in{{#headerParams}} - let headers = Cohttp.Header.add{{#isContainer}}_multi{{/isContainer}} headers "{{baseName}}" ({{> to_string}}{{paramName}}) in{{/headerParams}}{{#pathParams}} - let uri = Request.replace_path_param uri "{{{baseName}}}" ({{> to_string}}{{{paramName}}}) in{{/pathParams}}{{#queryParams}} - let uri = Uri.add_query_param{{^isListContainer}}'{{/isListContainer}} uri ("{{{baseName}}}", {{> to_string}}{{{paramName}}}) in{{/queryParams}}{{#hasAuthMethods}}{{#authMethods}}{{#isApiKey}}{{#isKeyInQuery}} - let uri = Uri.add_query_param' uri ("{{{keyParamName}}}", Request.api_key) in{{/isKeyInQuery}}{{/isApiKey}}{{/authMethods}}{{/hasAuthMethods}}{{#bodyParams}} - let body = Request.{{#isFreeFormObject}}write_json_body{{/isFreeFormObject}}{{#isByteArray}}write_string_body{{/isByteArray}}{{^isFreeFormObject}}{{^isByteArray}}write_as_json_body{{/isByteArray}}{{/isFreeFormObject}} {{> to_json}} {{{paramName}}} in{{/bodyParams}}{{^hasBodyParam}}{{#hasFormParams}} - let body = Request.init_form_encoded_body () in{{/hasFormParams}}{{#formParams}} - let body = Request.add_form_encoded_body_param{{#isContainer}}s{{/isContainer}} body ("{{{paramName}}}", {{> to_string}}{{{paramName}}}) in{{/formParams}}{{#hasFormParams}} - let body = Request.finalize_form_encoded_body body in{{/hasFormParams}}{{/hasBodyParam}} - Cohttp_lwt_unix.Client.call `{{{httpMethod}}} uri ~headers {{#hasBodyParam}}~body {{/hasBodyParam}}{{^hasBodyParam}}{{#hasFormParams}}~body {{/hasFormParams}}{{/hasBodyParam}}>>= fun (resp, body) ->{{^returnType}} - Request.handle_unit_response resp{{/returnType}}{{#returnType}} - Request.read_json_body{{#returnContainer}}{{#isListContainer}}_as_list{{/isListContainer}}{{#isMapContainer}}_as_map{{/isMapContainer}}{{#returnBaseType}}{{^vendorExtensions.x-returnFreeFormObject}}_of{{/vendorExtensions.x-returnFreeFormObject}}{{/returnBaseType}}{{/returnContainer}}{{^returnContainer}}{{#returnBaseType}}{{^vendorExtensions.x-returnFreeFormObject}}_as{{/vendorExtensions.x-returnFreeFormObject}}{{/returnBaseType}}{{/returnContainer}} {{#returnType}}{{^vendorExtensions.x-returnFreeFormObject}}({{> of_json}}){{/vendorExtensions.x-returnFreeFormObject}}{{/returnType}} resp body{{/returnType}} + let headers = Request.default_headers in +{{#hasAuthMethods}} + {{#authMethods}} + {{#isApiKey}} + {{#isKeyInHeader}} + let headers = Cohttp.Header.add headers "{{{keyParamName}}}" Request.api_key in + {{/isKeyInHeader}} + {{/isApiKey}} + {{/authMethods}} +{{/hasAuthMethods}} +{{#headerParams}} + let headers = Request.{{> to_optional_prefix}}add_header{{#isContainer}}_multi{{/isContainer}} headers "{{baseName}}" {{> to_string}} {{{paramName}}} in +{{/headerParams}} +{{#pathParams}} + let uri = Request.{{> to_optional_prefix}}replace_path_param uri "{{{baseName}}}" {{> to_string}} {{{paramName}}} in +{{/pathParams}} +{{#queryParams}} + let uri = Request.{{> to_optional_prefix}}add_query_param{{#isListContainer}}_list{{/isListContainer}} uri "{{{baseName}}}" {{> to_string}} {{{paramName}}} in +{{/queryParams}} +{{#hasAuthMethods}} + {{#authMethods}} + {{#isApiKey}} + {{#isKeyInQuery}} + let uri = Uri.add_query_param' uri ("{{{keyParamName}}}", Request.api_key) in + {{/isKeyInQuery}} + {{/isApiKey}} + {{/authMethods}} +{{/hasAuthMethods}} +{{#bodyParams}} + let body = Request.{{#isFreeFormObject}}write_json_body{{/isFreeFormObject}}{{#isByteArray}}write_string_body{{/isByteArray}}{{^isFreeFormObject}}{{^isByteArray}}write_as_json_body{{/isByteArray}}{{/isFreeFormObject}} {{> to_json}} {{{paramName}}} in +{{/bodyParams}} +{{^hasBodyParam}} + {{#hasFormParams}} + let body = Request.init_form_encoded_body () in + {{/hasFormParams}} + {{#formParams}} + let body = Request.{{> to_optional_prefix}}add_form_encoded_body_param{{#isContainer}}_list{{/isContainer}} body "{{{paramName}}}" {{> to_string}} {{{paramName}}} in + {{/formParams}} + {{#hasFormParams}} + let body = Request.finalize_form_encoded_body body in + {{/hasFormParams}} +{{/hasBodyParam}} + Cohttp_lwt_unix.Client.call `{{{httpMethod}}} uri ~headers {{#hasBodyParam}}~body {{/hasBodyParam}}{{^hasBodyParam}}{{#hasFormParams}}~body {{/hasFormParams}}{{/hasBodyParam}}>>= fun (resp, body) -> +{{^returnType}} + Request.handle_unit_response resp +{{/returnType}} +{{#returnType}} + Request.read_json_body{{#returnContainer}}{{#isListContainer}}_as_list{{/isListContainer}}{{#isMapContainer}}_as_map{{/isMapContainer}}{{#returnBaseType}}{{^vendorExtensions.x-returnFreeFormObject}}_of{{/vendorExtensions.x-returnFreeFormObject}}{{/returnBaseType}}{{/returnContainer}}{{^returnContainer}}{{#returnBaseType}}{{^vendorExtensions.x-returnFreeFormObject}}_as{{/vendorExtensions.x-returnFreeFormObject}}{{/returnBaseType}}{{/returnContainer}} {{#returnType}}{{^vendorExtensions.x-returnFreeFormObject}}({{> of_json}}){{/vendorExtensions.x-returnFreeFormObject}}{{/returnType}} resp body +{{/returnType}} {{/operation}} {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/ocaml/api-intf.mustache b/modules/openapi-generator/src/main/resources/ocaml/api-intf.mustache index 8bd8de3a4e6..42525de317c 100644 --- a/modules/openapi-generator/src/main/resources/ocaml/api-intf.mustache +++ b/modules/openapi-generator/src/main/resources/ocaml/api-intf.mustache @@ -10,6 +10,6 @@ {{#operations}} {{#operation}} -val {{{operationId}}} : {{^hasParams}}unit{{/hasParams}}{{#allParams}}{{#isEnum}}Enums.{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#hasMore}} -> {{/hasMore}}{{/allParams}} -> {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}unit{{/returnType}} Lwt.t +val {{{operationId}}} : {{^hasParams}}unit{{/hasParams}}{{#allParams}}{{#required}}{{{paramName}}}{{/required}}{{^required}}{{^isBodyParam}}?{{/isBodyParam}}{{{paramName}}}{{/required}}:{{#isEnum}}Enums.{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#hasMore}} -> {{/hasMore}}{{#-last}}{{^required}} -> unit{{/required}}{{/-last}}{{/allParams}} -> {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}unit{{/returnType}} Lwt.t {{/operation}} {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/ocaml/model.mustache b/modules/openapi-generator/src/main/resources/ocaml/model.mustache index 33fc27af079..dd45db1915b 100644 --- a/modules/openapi-generator/src/main/resources/ocaml/model.mustache +++ b/modules/openapi-generator/src/main/resources/ocaml/model.mustache @@ -16,13 +16,13 @@ type t = { (* {{{description}}} *) {{/description}} {{#isEnum}} - {{{name}}}: {{^isMapContainer}}Enums.{{/isMapContainer}}{{{datatypeWithEnum}}}{{^isContainer}}{{#defaultValue}}[@default {{{defaultValue}}}]{{/defaultValue}}{{/isContainer}}{{^isContainer}}{{#required}}{{#isNullable}} option [@default None]{{/isNullable}}{{/required}}{{/isContainer}}{{^isContainer}}{{^required}} option [@default None]{{/required}}{{/isContainer}}; + {{{name}}}: {{^isMapContainer}}Enums.{{/isMapContainer}}{{{datatypeWithEnum}}}{{^isContainer}}{{#required}}{{#defaultValue}}[@default {{{defaultValue}}}]{{/defaultValue}}{{/required}}{{/isContainer}}{{^isContainer}}{{#required}}{{#isNullable}} option [@default {{#defaultValue}}Some({{{defaultValue}}}){{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}]{{/isNullable}}{{/required}}{{/isContainer}}{{^isContainer}}{{^required}} option [@default {{#defaultValue}}Some({{{defaultValue}}}){{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}]{{/required}}{{/isContainer}}; {{/isEnum}} {{^isEnum}} {{{name}}}: {{{datatypeWithEnum}}}{{^isContainer}}{{#required}}{{#isNullable}} option{{/isNullable}}{{/required}}{{/isContainer}}{{^isContainer}}{{^required}} option [@default None]{{/required}}{{/isContainer}}; {{/isEnum}} {{/vars}} -} [@@deriving yojson, show ];; +} [@@deriving yojson { strict = false }, show ];; {{#description}} (** {{{description}}} *) diff --git a/modules/openapi-generator/src/main/resources/ocaml/support.mustache b/modules/openapi-generator/src/main/resources/ocaml/support.mustache index 09e5b1a922e..bc6d7a86f98 100644 --- a/modules/openapi-generator/src/main/resources/ocaml/support.mustache +++ b/modules/openapi-generator/src/main/resources/ocaml/support.mustache @@ -2,8 +2,31 @@ let api_key = "" let base_url = "{{{basePath}}}" let default_headers = Cohttp.Header.init_with "Content-Type" "application/json" +let option_fold f default o = + match o with + | Some v -> f v + | None -> default + let build_uri operation_path = Uri.of_string (base_url ^ operation_path) +let add_string_header headers key value = + Cohttp.Header.add headers key value + +let add_string_header_multi headers key values = + Cohttp.Header.add_multi headers key values + +let add_header headers key to_string value = + Cohttp.Header.add headers key (to_string value) + +let add_header_multi headers key to_string value = + Cohttp.Header.add_multi headers key (to_string value) + +let maybe_add_header headers key to_string value = + option_fold (add_header headers key to_string) headers value + +let maybe_add_header_multi headers key to_string value = + option_fold (add_header_multi headers key to_string) headers value + let write_string_body s = Cohttp_lwt.Body.of_string s let write_json_body payload = @@ -37,20 +60,38 @@ let read_json_body_as_map resp body = let read_json_body_as_map_of of_json resp body = Lwt.(read_json_body_as_map resp body >|= List.map (fun (s, v) -> (s, of_json v))) -let replace_path_param uri param_name param_value = +let replace_string_path_param uri param_name param_value = let regexp = Str.regexp (Str.quote ("{" ^ param_name ^ "}")) in - let path = Str.global_replace regexp param_value (Uri.path uri) in + let path = Str.global_replace regexp param_value (Uri.pct_decode (Uri.path uri)) in Uri.with_path uri path +let replace_path_param uri param_name to_string param_value = + replace_string_path_param uri param_name (to_string param_value) + +let maybe_replace_path_param uri param_name to_string param_value = + option_fold (replace_path_param uri param_name to_string) uri param_value + +let add_query_param uri param_name to_string param_value = + Uri.add_query_param' uri (param_name, to_string param_value) + +let add_query_param_list uri param_name to_string param_value = + Uri.add_query_param uri (param_name, to_string param_value) + +let maybe_add_query_param uri param_name to_string param_value = + option_fold (add_query_param uri param_name to_string) uri param_value + let init_form_encoded_body () = "" -let add_form_encoded_body_param params (paramName, paramValue) = - let new_param_enc = Printf.sprintf {|%s=%s|} (Uri.pct_encode paramName) (Uri.pct_encode paramValue) in +let add_form_encoded_body_param params param_name to_string param_value = + let new_param_enc = Printf.sprintf {|%s=%s|} (Uri.pct_encode param_name) (Uri.pct_encode (to_string param_value)) in if params = "" then new_param_enc else Printf.sprintf {|%s&%s|} params new_param_enc -let add_form_encoded_body_params params (paramName, new_params) = - add_form_encoded_body_param params (paramName, String.concat "," new_params) +let add_form_encoded_body_param_list params param_name to_string new_params = + add_form_encoded_body_param params param_name (String.concat ",") (to_string new_params) + +let maybe_add_form_encoded_body_param params param_name to_string param_value = + option_fold (add_form_encoded_body_param params param_name to_string) params param_value let finalize_form_encoded_body body = Cohttp_lwt.Body.of_string body diff --git a/modules/openapi-generator/src/main/resources/ocaml/to_optional_prefix.mustache b/modules/openapi-generator/src/main/resources/ocaml/to_optional_prefix.mustache new file mode 100644 index 00000000000..aa35be7da04 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/ocaml/to_optional_prefix.mustache @@ -0,0 +1 @@ +{{^required}}{{^defaultValue}}{{^isContainer}}maybe_{{/isContainer}}{{/defaultValue}}{{/required}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/ocaml/to_param.mustache b/modules/openapi-generator/src/main/resources/ocaml/to_param.mustache new file mode 100644 index 00000000000..59bd7672b9c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/ocaml/to_param.mustache @@ -0,0 +1 @@ +{{^isBodyParam}}{{^required}}?{{#defaultValue}}({{{paramName}}} = {{^isEnum}}{{#isString}}"{{{defaultValue}}}"{{/isString}}{{#isBoolean}}{{{defaultValue}}}{{/isBoolean}}{{#isShort}}{{{defaultValue}}}{{/isShort}}{{#isInteger}}{{{defaultValue}}}l{{/isInteger}}{{#isLong}}{{{defaultValue}}}L{{/isLong}}{{#isFloat}}{{{defaultValue}}}.{{/isFloat}}{{#isNumber}}{{{defaultValue}}}.{{/isNumber}}{{/isEnum}}{{#isEnum}}{{#isContainer}}[{{{defaultValue}}}]{{/isContainer}}{{^isContainer}}{{{defaultValue}}}{{/isContainer}}{{/isEnum}}){{/defaultValue}}{{^defaultValue}}{{^isContainer}}{{{paramName}}}{{/isContainer}}{{#isContainer}}({{{paramName}}} = []){{/isContainer}}{{/defaultValue}}{{/required}}{{#required}}~{{{paramName}}}{{/required}}{{/isBodyParam}}{{#isBodyParam}}~{{{paramName}}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/ocaml/to_string.mustache b/modules/openapi-generator/src/main/resources/ocaml/to_string.mustache index 9e5b60af842..0588ac5ab4f 100644 --- a/modules/openapi-generator/src/main/resources/ocaml/to_string.mustache +++ b/modules/openapi-generator/src/main/resources/ocaml/to_string.mustache @@ -1 +1 @@ -{{#isContainer}}{{#items}}{{#isEnum}}List.map {{> to_string}}{{/isEnum}}{{#isModel}}List.map {{> to_string}}{{/isModel}}{{/items}}{{/isContainer}}{{^isEnum}}{{#isString}}{{/isString}}{{#isLong}}Int64.to_string {{/isLong}}{{#isInteger}}Int32.to_string {{/isInteger}}{{#isFloat}}string_of_float {{/isFloat}}{{#isNumber}}string_of_float {{/isNumber}}{{#isDouble}}string_of_float {{/isDouble}}{{#isBoolean}}string_of_bool {{/isBoolean}}{{#isByteArray}}{{/isByteArray}}{{#isModel}}{{{vendorExtensions.x-modelModule}}}.show {{/isModel}}{{/isEnum}}{{^isModel}}{{^isContainer}}{{#isEnum}}Enums.show_{{{datatypeWithEnum}}} {{/isEnum}}{{/isContainer}}{{/isModel}} \ No newline at end of file +{{#isContainer}}{{#items}}(List.map {{> to_string}}){{/items}}{{/isContainer}}{{^isEnum}}{{#isLong}}Int64.to_string{{/isLong}}{{#isInteger}}Int32.to_string{{/isInteger}}{{#isFloat}}string_of_float{{/isFloat}}{{#isNumber}}string_of_float{{/isNumber}}{{#isDouble}}string_of_float{{/isDouble}}{{#isBoolean}}string_of_bool{{/isBoolean}}{{#isFile}}(fun x -> x){{/isFile}}{{#isDate}}(fun x -> x){{/isDate}}{{#isDateTime}}(fun x -> x){{/isDateTime}}{{#isString}}(fun x -> x){{/isString}}{{#isByteArray}}(fun x -> x){{/isByteArray}}{{#isModel}}{{{vendorExtensions.x-modelModule}}}.show{{/isModel}}{{/isEnum}}{{^isModel}}{{^isContainer}}{{#isEnum}}Enums.show_{{{datatypeWithEnum}}}{{/isEnum}}{{/isContainer}}{{/isModel}} \ No newline at end of file diff --git a/samples/client/petstore/ocaml/src/apis/pet_api.ml b/samples/client/petstore/ocaml/src/apis/pet_api.ml index bb0ebbc55e7..ec3d3674fb2 100644 --- a/samples/client/petstore/ocaml/src/apis/pet_api.ml +++ b/samples/client/petstore/ocaml/src/apis/pet_api.ml @@ -5,7 +5,7 @@ * *) -let add_pet body = +let add_pet ~body = let open Lwt in let uri = Request.build_uri "/pet" in let headers = Request.default_headers in @@ -13,40 +13,41 @@ let add_pet body = Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> Request.handle_unit_response resp -let delete_pet pet_id api_key = +let delete_pet ~pet_id ?api_key () = let open Lwt in let uri = Request.build_uri "/pet/{petId}" in let headers = Request.default_headers in - let headers = Cohttp.Header.add headers "api_key" (api_key) in - let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in + let headers = Request.maybe_add_header headers "api_key" (fun x -> x) api_key in + let uri = Request.replace_path_param uri "petId" Int64.to_string pet_id in Cohttp_lwt_unix.Client.call `DELETE uri ~headers >>= fun (resp, body) -> Request.handle_unit_response resp -let find_pets_by_status status = +let find_pets_by_status ~status = let open Lwt in let uri = Request.build_uri "/pet/findByStatus" in let headers = Request.default_headers in - let uri = Uri.add_query_param uri ("status", List.map Enums.show_pet_status status) in + let uri = Request.add_query_param_list uri "status" (List.map Enums.show_pet_status) status in Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> Request.read_json_body_as_list_of (JsonSupport.unwrap Pet.of_yojson) resp body -let find_pets_by_tags tags = +let find_pets_by_tags ~tags = let open Lwt in let uri = Request.build_uri "/pet/findByTags" in let headers = Request.default_headers in - let uri = Uri.add_query_param uri ("tags", tags) in + let uri = Request.add_query_param_list uri "tags" (List.map (fun x -> x)) tags in Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> Request.read_json_body_as_list_of (JsonSupport.unwrap Pet.of_yojson) resp body -let get_pet_by_id pet_id = +let get_pet_by_id ~pet_id = let open Lwt in let uri = Request.build_uri "/pet/{petId}" in let headers = Request.default_headers in - let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in + let headers = Cohttp.Header.add headers "api_key" Request.api_key in + let uri = Request.replace_path_param uri "petId" Int64.to_string pet_id in Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> Request.read_json_body_as (JsonSupport.unwrap Pet.of_yojson) resp body -let update_pet body = +let update_pet ~body = let open Lwt in let uri = Request.build_uri "/pet" in let headers = Request.default_headers in @@ -54,26 +55,26 @@ let update_pet body = Cohttp_lwt_unix.Client.call `PUT uri ~headers ~body >>= fun (resp, body) -> Request.handle_unit_response resp -let update_pet_with_form pet_id name status = +let update_pet_with_form ~pet_id ?name ?status () = let open Lwt in let uri = Request.build_uri "/pet/{petId}" in let headers = Request.default_headers in - let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in + let uri = Request.replace_path_param uri "petId" Int64.to_string pet_id in let body = Request.init_form_encoded_body () in - let body = Request.add_form_encoded_body_param body ("name", name) in - let body = Request.add_form_encoded_body_param body ("status", status) in + let body = Request.maybe_add_form_encoded_body_param body "name" (fun x -> x) name in + let body = Request.maybe_add_form_encoded_body_param body "status" (fun x -> x) status in let body = Request.finalize_form_encoded_body body in Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> Request.handle_unit_response resp -let upload_file pet_id additional_metadata file = +let upload_file ~pet_id ?additional_metadata ?file () = let open Lwt in let uri = Request.build_uri "/pet/{petId}/uploadImage" in let headers = Request.default_headers in - let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in + let uri = Request.replace_path_param uri "petId" Int64.to_string pet_id in let body = Request.init_form_encoded_body () in - let body = Request.add_form_encoded_body_param body ("additional_metadata", additional_metadata) in - let body = Request.add_form_encoded_body_param body ("file", file) in + let body = Request.maybe_add_form_encoded_body_param body "additional_metadata" (fun x -> x) additional_metadata in + let body = Request.maybe_add_form_encoded_body_param body "file" (fun x -> x) file in let body = Request.finalize_form_encoded_body body in Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> Request.read_json_body_as (JsonSupport.unwrap Api_response.of_yojson) resp body diff --git a/samples/client/petstore/ocaml/src/apis/pet_api.mli b/samples/client/petstore/ocaml/src/apis/pet_api.mli index 0cc31e085cf..301beaa2c72 100644 --- a/samples/client/petstore/ocaml/src/apis/pet_api.mli +++ b/samples/client/petstore/ocaml/src/apis/pet_api.mli @@ -5,11 +5,11 @@ * *) -val add_pet : Pet.t -> unit Lwt.t -val delete_pet : int64 -> string -> unit Lwt.t -val find_pets_by_status : Enums.pet_status list -> Pet.t list Lwt.t -val find_pets_by_tags : string list -> Pet.t list Lwt.t -val get_pet_by_id : int64 -> Pet.t Lwt.t -val update_pet : Pet.t -> unit Lwt.t -val update_pet_with_form : int64 -> string -> string -> unit Lwt.t -val upload_file : int64 -> string -> string -> Api_response.t Lwt.t +val add_pet : body:Pet.t -> unit Lwt.t +val delete_pet : pet_id:int64 -> ?api_key:string -> unit -> unit Lwt.t +val find_pets_by_status : status:Enums.pet_status list -> Pet.t list Lwt.t +val find_pets_by_tags : tags:string list -> Pet.t list Lwt.t +val get_pet_by_id : pet_id:int64 -> Pet.t Lwt.t +val update_pet : body:Pet.t -> unit Lwt.t +val update_pet_with_form : pet_id:int64 -> ?name:string -> ?status:string -> unit -> unit Lwt.t +val upload_file : pet_id:int64 -> ?additional_metadata:string -> ?file:string -> unit -> Api_response.t Lwt.t diff --git a/samples/client/petstore/ocaml/src/apis/store_api.ml b/samples/client/petstore/ocaml/src/apis/store_api.ml index b9e7f536388..187cbbb5188 100644 --- a/samples/client/petstore/ocaml/src/apis/store_api.ml +++ b/samples/client/petstore/ocaml/src/apis/store_api.ml @@ -5,11 +5,11 @@ * *) -let delete_order order_id = +let delete_order ~order_id = let open Lwt in let uri = Request.build_uri "/store/order/{orderId}" in let headers = Request.default_headers in - let uri = Request.replace_path_param uri "orderId" (order_id) in + let uri = Request.replace_path_param uri "orderId" (fun x -> x) order_id in Cohttp_lwt_unix.Client.call `DELETE uri ~headers >>= fun (resp, body) -> Request.handle_unit_response resp @@ -17,18 +17,19 @@ let get_inventory () = let open Lwt in let uri = Request.build_uri "/store/inventory" in let headers = Request.default_headers in + let headers = Cohttp.Header.add headers "api_key" Request.api_key in Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> Request.read_json_body_as_map_of (JsonSupport.to_int32) resp body -let get_order_by_id order_id = +let get_order_by_id ~order_id = let open Lwt in let uri = Request.build_uri "/store/order/{orderId}" in let headers = Request.default_headers in - let uri = Request.replace_path_param uri "orderId" (Int64.to_string order_id) in + let uri = Request.replace_path_param uri "orderId" Int64.to_string order_id in Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> Request.read_json_body_as (JsonSupport.unwrap Order.of_yojson) resp body -let place_order body = +let place_order ~body = let open Lwt in let uri = Request.build_uri "/store/order" in let headers = Request.default_headers in diff --git a/samples/client/petstore/ocaml/src/apis/store_api.mli b/samples/client/petstore/ocaml/src/apis/store_api.mli index bc3c93eb494..53c81ec52c7 100644 --- a/samples/client/petstore/ocaml/src/apis/store_api.mli +++ b/samples/client/petstore/ocaml/src/apis/store_api.mli @@ -5,7 +5,7 @@ * *) -val delete_order : string -> unit Lwt.t +val delete_order : order_id:string -> unit Lwt.t val get_inventory : unit -> (string * int32) list Lwt.t -val get_order_by_id : int64 -> Order.t Lwt.t -val place_order : Order.t -> Order.t Lwt.t +val get_order_by_id : order_id:int64 -> Order.t Lwt.t +val place_order : body:Order.t -> Order.t Lwt.t diff --git a/samples/client/petstore/ocaml/src/apis/user_api.ml b/samples/client/petstore/ocaml/src/apis/user_api.ml index bf6e7cfc52d..5c1027f601c 100644 --- a/samples/client/petstore/ocaml/src/apis/user_api.ml +++ b/samples/client/petstore/ocaml/src/apis/user_api.ml @@ -5,7 +5,7 @@ * *) -let create_user body = +let create_user ~body = let open Lwt in let uri = Request.build_uri "/user" in let headers = Request.default_headers in @@ -13,7 +13,7 @@ let create_user body = Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> Request.handle_unit_response resp -let create_users_with_array_input body = +let create_users_with_array_input ~body = let open Lwt in let uri = Request.build_uri "/user/createWithArray" in let headers = Request.default_headers in @@ -21,7 +21,7 @@ let create_users_with_array_input body = Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> Request.handle_unit_response resp -let create_users_with_list_input body = +let create_users_with_list_input ~body = let open Lwt in let uri = Request.build_uri "/user/createWithList" in let headers = Request.default_headers in @@ -29,28 +29,28 @@ let create_users_with_list_input body = Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> Request.handle_unit_response resp -let delete_user username = +let delete_user ~username = let open Lwt in let uri = Request.build_uri "/user/{username}" in let headers = Request.default_headers in - let uri = Request.replace_path_param uri "username" (username) in + let uri = Request.replace_path_param uri "username" (fun x -> x) username in Cohttp_lwt_unix.Client.call `DELETE uri ~headers >>= fun (resp, body) -> Request.handle_unit_response resp -let get_user_by_name username = +let get_user_by_name ~username = let open Lwt in let uri = Request.build_uri "/user/{username}" in let headers = Request.default_headers in - let uri = Request.replace_path_param uri "username" (username) in + let uri = Request.replace_path_param uri "username" (fun x -> x) username in Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> Request.read_json_body_as (JsonSupport.unwrap User.of_yojson) resp body -let login_user username password = +let login_user ~username ~password = let open Lwt in let uri = Request.build_uri "/user/login" in let headers = Request.default_headers in - let uri = Uri.add_query_param' uri ("username", username) in - let uri = Uri.add_query_param' uri ("password", password) in + let uri = Request.add_query_param uri "username" (fun x -> x) username in + let uri = Request.add_query_param uri "password" (fun x -> x) password in Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> Request.read_json_body_as (JsonSupport.to_string) resp body @@ -61,11 +61,11 @@ let logout_user () = Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> Request.handle_unit_response resp -let update_user username body = +let update_user ~username ~body = let open Lwt in let uri = Request.build_uri "/user/{username}" in let headers = Request.default_headers in - let uri = Request.replace_path_param uri "username" (username) in + let uri = Request.replace_path_param uri "username" (fun x -> x) username in let body = Request.write_as_json_body User.to_yojson body in Cohttp_lwt_unix.Client.call `PUT uri ~headers ~body >>= fun (resp, body) -> Request.handle_unit_response resp diff --git a/samples/client/petstore/ocaml/src/apis/user_api.mli b/samples/client/petstore/ocaml/src/apis/user_api.mli index 5191a2ea41b..5ea7ba2471f 100644 --- a/samples/client/petstore/ocaml/src/apis/user_api.mli +++ b/samples/client/petstore/ocaml/src/apis/user_api.mli @@ -5,11 +5,11 @@ * *) -val create_user : User.t -> unit Lwt.t -val create_users_with_array_input : User.t list -> unit Lwt.t -val create_users_with_list_input : User.t list -> unit Lwt.t -val delete_user : string -> unit Lwt.t -val get_user_by_name : string -> User.t Lwt.t -val login_user : string -> string -> string Lwt.t +val create_user : body:User.t -> unit Lwt.t +val create_users_with_array_input : body:User.t list -> unit Lwt.t +val create_users_with_list_input : body:User.t list -> unit Lwt.t +val delete_user : username:string -> unit Lwt.t +val get_user_by_name : username:string -> User.t Lwt.t +val login_user : username:string -> password:string -> string Lwt.t val logout_user : unit -> unit Lwt.t -val update_user : string -> User.t -> unit Lwt.t +val update_user : username:string -> body:User.t -> unit Lwt.t diff --git a/samples/client/petstore/ocaml/src/models/api_response.ml b/samples/client/petstore/ocaml/src/models/api_response.ml index f1b960d1449..1b5a0aabac2 100644 --- a/samples/client/petstore/ocaml/src/models/api_response.ml +++ b/samples/client/petstore/ocaml/src/models/api_response.ml @@ -10,7 +10,7 @@ type t = { code: int32 option [@default None]; _type: string option [@default None]; message: string option [@default None]; -} [@@deriving yojson, show ];; +} [@@deriving yojson { strict = false }, show ];; (** Describes the result of uploading an image resource *) let create () : t = { diff --git a/samples/client/petstore/ocaml/src/models/category.ml b/samples/client/petstore/ocaml/src/models/category.ml index 31b9c3aab1d..830f34bc07b 100644 --- a/samples/client/petstore/ocaml/src/models/category.ml +++ b/samples/client/petstore/ocaml/src/models/category.ml @@ -9,7 +9,7 @@ type t = { id: int64 option [@default None]; name: string option [@default None]; -} [@@deriving yojson, show ];; +} [@@deriving yojson { strict = false }, show ];; (** A category for a pet *) let create () : t = { diff --git a/samples/client/petstore/ocaml/src/models/order.ml b/samples/client/petstore/ocaml/src/models/order.ml index 6130f88fd95..e9f6a808003 100644 --- a/samples/client/petstore/ocaml/src/models/order.ml +++ b/samples/client/petstore/ocaml/src/models/order.ml @@ -14,7 +14,7 @@ type t = { (* Order Status *) status: Enums.status option [@default None]; complete: bool option [@default None]; -} [@@deriving yojson, show ];; +} [@@deriving yojson { strict = false }, show ];; (** An order for a pets from the pet store *) let create () : t = { diff --git a/samples/client/petstore/ocaml/src/models/pet.ml b/samples/client/petstore/ocaml/src/models/pet.ml index 5d267ef32db..a1f379778ab 100644 --- a/samples/client/petstore/ocaml/src/models/pet.ml +++ b/samples/client/petstore/ocaml/src/models/pet.ml @@ -14,7 +14,7 @@ type t = { tags: Tag.t list; (* pet status in the store *) status: Enums.pet_status option [@default None]; -} [@@deriving yojson, show ];; +} [@@deriving yojson { strict = false }, show ];; (** A pet for sale in the pet store *) let create (name : string) (photo_urls : string list) : t = { diff --git a/samples/client/petstore/ocaml/src/models/tag.ml b/samples/client/petstore/ocaml/src/models/tag.ml index 5570d9c8eaf..3c33625f198 100644 --- a/samples/client/petstore/ocaml/src/models/tag.ml +++ b/samples/client/petstore/ocaml/src/models/tag.ml @@ -9,7 +9,7 @@ type t = { id: int64 option [@default None]; name: string option [@default None]; -} [@@deriving yojson, show ];; +} [@@deriving yojson { strict = false }, show ];; (** A tag for a pet *) let create () : t = { diff --git a/samples/client/petstore/ocaml/src/models/user.ml b/samples/client/petstore/ocaml/src/models/user.ml index a9483d72889..586ef26b537 100644 --- a/samples/client/petstore/ocaml/src/models/user.ml +++ b/samples/client/petstore/ocaml/src/models/user.ml @@ -16,7 +16,7 @@ type t = { phone: string option [@default None]; (* User Status *) user_status: int32 option [@default None]; -} [@@deriving yojson, show ];; +} [@@deriving yojson { strict = false }, show ];; (** A User who is purchasing from the pet store *) let create () : t = { diff --git a/samples/client/petstore/ocaml/src/support/request.ml b/samples/client/petstore/ocaml/src/support/request.ml index 3d7fd640e54..35123b9ec90 100644 --- a/samples/client/petstore/ocaml/src/support/request.ml +++ b/samples/client/petstore/ocaml/src/support/request.ml @@ -2,8 +2,31 @@ let api_key = "" let base_url = "http://petstore.swagger.io/v2" let default_headers = Cohttp.Header.init_with "Content-Type" "application/json" +let option_fold f default o = + match o with + | Some v -> f v + | None -> default + let build_uri operation_path = Uri.of_string (base_url ^ operation_path) +let add_string_header headers key value = + Cohttp.Header.add headers key value + +let add_string_header_multi headers key values = + Cohttp.Header.add_multi headers key values + +let add_header headers key to_string value = + Cohttp.Header.add headers key (to_string value) + +let add_header_multi headers key to_string value = + Cohttp.Header.add_multi headers key (to_string value) + +let maybe_add_header headers key to_string value = + option_fold (add_header headers key to_string) headers value + +let maybe_add_header_multi headers key to_string value = + option_fold (add_header_multi headers key to_string) headers value + let write_string_body s = Cohttp_lwt.Body.of_string s let write_json_body payload = @@ -37,20 +60,38 @@ let read_json_body_as_map resp body = let read_json_body_as_map_of of_json resp body = Lwt.(read_json_body_as_map resp body >|= List.map (fun (s, v) -> (s, of_json v))) -let replace_path_param uri param_name param_value = +let replace_string_path_param uri param_name param_value = let regexp = Str.regexp (Str.quote ("{" ^ param_name ^ "}")) in - let path = Str.global_replace regexp param_value (Uri.path uri) in + let path = Str.global_replace regexp param_value (Uri.pct_decode (Uri.path uri)) in Uri.with_path uri path +let replace_path_param uri param_name to_string param_value = + replace_string_path_param uri param_name (to_string param_value) + +let maybe_replace_path_param uri param_name to_string param_value = + option_fold (replace_path_param uri param_name to_string) uri param_value + +let add_query_param uri param_name to_string param_value = + Uri.add_query_param' uri (param_name, to_string param_value) + +let add_query_param_list uri param_name to_string param_value = + Uri.add_query_param uri (param_name, to_string param_value) + +let maybe_add_query_param uri param_name to_string param_value = + option_fold (add_query_param uri param_name to_string) uri param_value + let init_form_encoded_body () = "" -let add_form_encoded_body_param params (paramName, paramValue) = - let new_param_enc = Printf.sprintf {|%s=%s|} (Uri.pct_encode paramName) (Uri.pct_encode paramValue) in +let add_form_encoded_body_param params param_name to_string param_value = + let new_param_enc = Printf.sprintf {|%s=%s|} (Uri.pct_encode param_name) (Uri.pct_encode (to_string param_value)) in if params = "" then new_param_enc else Printf.sprintf {|%s&%s|} params new_param_enc -let add_form_encoded_body_params params (paramName, new_params) = - add_form_encoded_body_param params (paramName, String.concat "," new_params) +let add_form_encoded_body_param_list params param_name to_string new_params = + add_form_encoded_body_param params param_name (String.concat ",") (to_string new_params) + +let maybe_add_form_encoded_body_param params param_name to_string param_value = + option_fold (add_form_encoded_body_param params param_name to_string) params param_value let finalize_form_encoded_body body = Cohttp_lwt.Body.of_string body diff --git a/samples/openapi3/client/petstore/ocaml/.openapi-generator-ignore b/samples/openapi3/client/petstore/ocaml/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/openapi3/client/petstore/ocaml/.openapi-generator/VERSION b/samples/openapi3/client/petstore/ocaml/.openapi-generator/VERSION new file mode 100644 index 00000000000..83a328a9227 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ocaml/README.md b/samples/openapi3/client/petstore/ocaml/README.md new file mode 100644 index 00000000000..0f61cbb94ec --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/README.md @@ -0,0 +1,27 @@ +# +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \'' \\ + +This OCaml package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.OCamlClientCodegen + +## Requirements. + +OCaml 4.x + +## Installation + +Please run the following commands to build the package `petstore_client`: + +```sh +opam install ppx_deriving_yojson cohttp ppx_deriving cohttp-lwt-unix +eval $(opam env) +dune build +``` + +## Getting Started + +TODO + diff --git a/samples/openapi3/client/petstore/ocaml/dune b/samples/openapi3/client/petstore/ocaml/dune new file mode 100644 index 00000000000..ed1c4d90e3d --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/dune @@ -0,0 +1,9 @@ +(include_subdirs unqualified) +(library + (name petstore_client) + (public_name petstore_client) + (flags (:standard -w -27)) + (libraries str cohttp-lwt-unix lwt yojson ppx_deriving_yojson.runtime) + (preprocess (pps ppx_deriving_yojson ppx_deriving.std)) + (wrapped true) +) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ocaml/dune-project b/samples/openapi3/client/petstore/ocaml/dune-project new file mode 100644 index 00000000000..79d86e3c901 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/dune-project @@ -0,0 +1,2 @@ +(lang dune 1.10) +(name petstore_client) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ocaml/petstore_client.opam b/samples/openapi3/client/petstore/ocaml/petstore_client.opam new file mode 100644 index 00000000000..3c3603c2f14 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/petstore_client.opam @@ -0,0 +1,15 @@ +opam-version: "2.0" +name: "petstore_client" +version: "1.0.0" +synopsis: "" +description: """ +Longer description +""" +maintainer: "Name " +authors: "Name " +license: "" +homepage: "" +bug-reports: "" +dev-repo: "" +depends: [ "ocaml" "ocamlfind" ] +build: ["dune" "build" "-p" name] \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/another_fake_api.ml b/samples/openapi3/client/petstore/ocaml/src/apis/another_fake_api.ml new file mode 100644 index 00000000000..c147d4d0579 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/another_fake_api.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +let call_123_test_special_tags ~client_t = + let open Lwt in + let uri = Request.build_uri "/another-fake/dummy" in + let headers = Request.default_headers in + let body = Request.write_as_json_body Client.to_yojson client_t in + Cohttp_lwt_unix.Client.call `PATCH uri ~headers ~body >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Client.of_yojson) resp body + diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/another_fake_api.mli b/samples/openapi3/client/petstore/ocaml/src/apis/another_fake_api.mli new file mode 100644 index 00000000000..3e9e0c80484 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/another_fake_api.mli @@ -0,0 +1,8 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +val call_123_test_special_tags : client_t:Client.t -> Client.t Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/default_api.ml b/samples/openapi3/client/petstore/ocaml/src/apis/default_api.ml new file mode 100644 index 00000000000..f220c4ba598 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/default_api.ml @@ -0,0 +1,14 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +let foo_get () = + let open Lwt in + let uri = Request.build_uri "/foo" in + let headers = Request.default_headers in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Inline_response_default.of_yojson) resp body + diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/default_api.mli b/samples/openapi3/client/petstore/ocaml/src/apis/default_api.mli new file mode 100644 index 00000000000..f1392d7621c --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/default_api.mli @@ -0,0 +1,8 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +val foo_get : unit -> Inline_response_default.t Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/fake_api.ml b/samples/openapi3/client/petstore/ocaml/src/apis/fake_api.ml new file mode 100644 index 00000000000..e9fce6261b9 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/fake_api.ml @@ -0,0 +1,143 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +let fake_health_get () = + let open Lwt in + let uri = Request.build_uri "/fake/health" in + let headers = Request.default_headers in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Health_check_result.of_yojson) resp body + +let fake_outer_boolean_serialize ~body () = + let open Lwt in + let uri = Request.build_uri "/fake/outer/boolean" in + let headers = Request.default_headers in + let body = Request.write_as_json_body JsonSupport.of_bool body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.to_bool) resp body + +let fake_outer_composite_serialize ~outer_composite_t () = + let open Lwt in + let uri = Request.build_uri "/fake/outer/composite" in + let headers = Request.default_headers in + let body = Request.write_as_json_body Outer_composite.to_yojson outer_composite_t in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Outer_composite.of_yojson) resp body + +let fake_outer_number_serialize ~body () = + let open Lwt in + let uri = Request.build_uri "/fake/outer/number" in + let headers = Request.default_headers in + let body = Request.write_as_json_body JsonSupport.of_float body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.to_float) resp body + +let fake_outer_string_serialize ~body () = + let open Lwt in + let uri = Request.build_uri "/fake/outer/string" in + let headers = Request.default_headers in + let body = Request.write_as_json_body JsonSupport.of_string body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.to_string) resp body + +let test_body_with_file_schema ~file_schema_test_class_t = + let open Lwt in + let uri = Request.build_uri "/fake/body-with-file-schema" in + let headers = Request.default_headers in + let body = Request.write_as_json_body File_schema_test_class.to_yojson file_schema_test_class_t in + Cohttp_lwt_unix.Client.call `PUT uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let test_body_with_query_params ~query ~user_t = + let open Lwt in + let uri = Request.build_uri "/fake/body-with-query-params" in + let headers = Request.default_headers in + let uri = Request.add_query_param uri "query" (fun x -> x) query in + let body = Request.write_as_json_body User.to_yojson user_t in + Cohttp_lwt_unix.Client.call `PUT uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let test_client_model ~client_t = + let open Lwt in + let uri = Request.build_uri "/fake" in + let headers = Request.default_headers in + let body = Request.write_as_json_body Client.to_yojson client_t in + Cohttp_lwt_unix.Client.call `PATCH uri ~headers ~body >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Client.of_yojson) resp body + +let test_endpoint_parameters ~number ~double ~pattern_without_delimiter ~byte ?integer ?int32 ?int64 ?float ?string ?binary ?date ?date_time ?password ?callback () = + let open Lwt in + let uri = Request.build_uri "/fake" in + let headers = Request.default_headers in + let body = Request.init_form_encoded_body () in + let body = Request.maybe_add_form_encoded_body_param body "integer" Int32.to_string integer in + let body = Request.maybe_add_form_encoded_body_param body "int32" Int32.to_string int32 in + let body = Request.maybe_add_form_encoded_body_param body "int64" Int64.to_string int64 in + let body = Request.add_form_encoded_body_param body "number" string_of_float number in + let body = Request.maybe_add_form_encoded_body_param body "float" string_of_float float in + let body = Request.add_form_encoded_body_param body "double" string_of_float double in + let body = Request.maybe_add_form_encoded_body_param body "string" (fun x -> x) string in + let body = Request.add_form_encoded_body_param body "pattern_without_delimiter" (fun x -> x) pattern_without_delimiter in + let body = Request.add_form_encoded_body_param body "byte" (fun x -> x) byte in + let body = Request.maybe_add_form_encoded_body_param body "binary" (fun x -> x) binary in + let body = Request.maybe_add_form_encoded_body_param body "date" (fun x -> x) date in + let body = Request.maybe_add_form_encoded_body_param body "date_time" (fun x -> x) date_time in + let body = Request.maybe_add_form_encoded_body_param body "password" (fun x -> x) password in + let body = Request.maybe_add_form_encoded_body_param body "callback" (fun x -> x) callback in + let body = Request.finalize_form_encoded_body body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let test_enum_parameters ?(enum_header_string_array = []) ?(enum_header_string = `Minusefg) ?(enum_query_string_array = []) ?(enum_query_string = `Minusefg) ?enum_query_integer ?enum_query_double ?(enum_form_string_array = [`Dollar]) ?(enum_form_string = `Minusefg) () = + let open Lwt in + let uri = Request.build_uri "/fake" in + let headers = Request.default_headers in + let headers = Request.add_header_multi headers "enum_header_string_array" (List.map Enums.show_enum_form_string_array) enum_header_string_array in + let headers = Request.add_header headers "enum_header_string" Enums.show_enumclass enum_header_string in + let uri = Request.add_query_param_list uri "enum_query_string_array" (List.map Enums.show_enum_form_string_array) enum_query_string_array in + let uri = Request.add_query_param uri "enum_query_string" Enums.show_enumclass enum_query_string in + let uri = Request.maybe_add_query_param uri "enum_query_integer" Enums.show_enum_query_integer enum_query_integer in + let uri = Request.maybe_add_query_param uri "enum_query_double" Enums.show_enum_number enum_query_double in + let body = Request.init_form_encoded_body () in + let body = Request.add_form_encoded_body_param_list body "enum_form_string_array" (List.map Enums.show_enum_form_string_array) enum_form_string_array in + let body = Request.add_form_encoded_body_param body "enum_form_string" Enums.show_enumclass enum_form_string in + let body = Request.finalize_form_encoded_body body in + Cohttp_lwt_unix.Client.call `GET uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let test_group_parameters ~required_string_group ~required_boolean_group ~required_int64_group ?string_group ?boolean_group ?int64_group () = + let open Lwt in + let uri = Request.build_uri "/fake" in + let headers = Request.default_headers in + let headers = Request.add_header headers "required_boolean_group" string_of_bool required_boolean_group in + let headers = Request.maybe_add_header headers "boolean_group" string_of_bool boolean_group in + let uri = Request.add_query_param uri "required_string_group" Int32.to_string required_string_group in + let uri = Request.add_query_param uri "required_int64_group" Int64.to_string required_int64_group in + let uri = Request.maybe_add_query_param uri "string_group" Int32.to_string string_group in + let uri = Request.maybe_add_query_param uri "int64_group" Int64.to_string int64_group in + Cohttp_lwt_unix.Client.call `DELETE uri ~headers >>= fun (resp, body) -> + Request.handle_unit_response resp + +let test_inline_additional_properties ~request_body = + let open Lwt in + let uri = Request.build_uri "/fake/inline-additionalProperties" in + let headers = Request.default_headers in + let body = Request.write_as_json_body (JsonSupport.of_map_of JsonSupport.of_string) request_body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let test_json_form_data ~param ~param2 = + let open Lwt in + let uri = Request.build_uri "/fake/jsonFormData" in + let headers = Request.default_headers in + let body = Request.init_form_encoded_body () in + let body = Request.add_form_encoded_body_param body "param" (fun x -> x) param in + let body = Request.add_form_encoded_body_param body "param2" (fun x -> x) param2 in + let body = Request.finalize_form_encoded_body body in + Cohttp_lwt_unix.Client.call `GET uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/fake_api.mli b/samples/openapi3/client/petstore/ocaml/src/apis/fake_api.mli new file mode 100644 index 00000000000..b10b27d6fb0 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/fake_api.mli @@ -0,0 +1,20 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +val fake_health_get : unit -> Health_check_result.t Lwt.t +val fake_outer_boolean_serialize : body:bool -> unit -> bool Lwt.t +val fake_outer_composite_serialize : outer_composite_t:Outer_composite.t -> unit -> Outer_composite.t Lwt.t +val fake_outer_number_serialize : body:float -> unit -> float Lwt.t +val fake_outer_string_serialize : body:string -> unit -> string Lwt.t +val test_body_with_file_schema : file_schema_test_class_t:File_schema_test_class.t -> unit Lwt.t +val test_body_with_query_params : query:string -> user_t:User.t -> unit Lwt.t +val test_client_model : client_t:Client.t -> Client.t Lwt.t +val test_endpoint_parameters : number:float -> double:float -> pattern_without_delimiter:string -> byte:string -> ?integer:int32 -> ?int32:int32 -> ?int64:int64 -> ?float:float -> ?string:string -> ?binary:string -> ?date:string -> ?date_time:string -> ?password:string -> ?callback:string -> unit -> unit Lwt.t +val test_enum_parameters : ?enum_header_string_array:Enums.enum_form_string_array list -> ?enum_header_string:Enums.enumclass -> ?enum_query_string_array:Enums.enum_form_string_array list -> ?enum_query_string:Enums.enumclass -> ?enum_query_integer:Enums.enum_query_integer -> ?enum_query_double:Enums.enum_number -> ?enum_form_string_array:Enums.enum_form_string_array list -> ?enum_form_string:Enums.enumclass -> unit -> unit Lwt.t +val test_group_parameters : required_string_group:int32 -> required_boolean_group:bool -> required_int64_group:int64 -> ?string_group:int32 -> ?boolean_group:bool -> ?int64_group:int64 -> unit -> unit Lwt.t +val test_inline_additional_properties : request_body:(string * string) list -> unit Lwt.t +val test_json_form_data : param:string -> param2:string -> unit Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/fake_classname_tags123_api.ml b/samples/openapi3/client/petstore/ocaml/src/apis/fake_classname_tags123_api.ml new file mode 100644 index 00000000000..09bf9c3d63e --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/fake_classname_tags123_api.ml @@ -0,0 +1,16 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +let test_classname ~client_t = + let open Lwt in + let uri = Request.build_uri "/fake_classname_test" in + let headers = Request.default_headers in + let uri = Uri.add_query_param' uri ("api_key_query", Request.api_key) in + let body = Request.write_as_json_body Client.to_yojson client_t in + Cohttp_lwt_unix.Client.call `PATCH uri ~headers ~body >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Client.of_yojson) resp body + diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/fake_classname_tags123_api.mli b/samples/openapi3/client/petstore/ocaml/src/apis/fake_classname_tags123_api.mli new file mode 100644 index 00000000000..0f9a292c507 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/fake_classname_tags123_api.mli @@ -0,0 +1,8 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +val test_classname : client_t:Client.t -> Client.t Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/pet_api.ml b/samples/openapi3/client/petstore/ocaml/src/apis/pet_api.ml new file mode 100644 index 00000000000..64fbc19ba0f --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/pet_api.ml @@ -0,0 +1,93 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +let add_pet ~pet_t = + let open Lwt in + let uri = Request.build_uri "/pet" in + let headers = Request.default_headers in + let body = Request.write_as_json_body Pet.to_yojson pet_t in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let delete_pet ~pet_id ?api_key () = + let open Lwt in + let uri = Request.build_uri "/pet/{petId}" in + let headers = Request.default_headers in + let headers = Request.maybe_add_header headers "api_key" (fun x -> x) api_key in + let uri = Request.replace_path_param uri "petId" Int64.to_string pet_id in + Cohttp_lwt_unix.Client.call `DELETE uri ~headers >>= fun (resp, body) -> + Request.handle_unit_response resp + +let find_pets_by_status ~status = + let open Lwt in + let uri = Request.build_uri "/pet/findByStatus" in + let headers = Request.default_headers in + let uri = Request.add_query_param_list uri "status" (List.map Enums.show_pet_status) status in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as_list_of (JsonSupport.unwrap Pet.of_yojson) resp body + +let find_pets_by_tags ~tags = + let open Lwt in + let uri = Request.build_uri "/pet/findByTags" in + let headers = Request.default_headers in + let uri = Request.add_query_param_list uri "tags" (List.map (fun x -> x)) tags in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as_list_of (JsonSupport.unwrap Pet.of_yojson) resp body + +let get_pet_by_id ~pet_id = + let open Lwt in + let uri = Request.build_uri "/pet/{petId}" in + let headers = Request.default_headers in + let headers = Cohttp.Header.add headers "api_key" Request.api_key in + let uri = Request.replace_path_param uri "petId" Int64.to_string pet_id in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Pet.of_yojson) resp body + +let update_pet ~pet_t = + let open Lwt in + let uri = Request.build_uri "/pet" in + let headers = Request.default_headers in + let body = Request.write_as_json_body Pet.to_yojson pet_t in + Cohttp_lwt_unix.Client.call `PUT uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let update_pet_with_form ~pet_id ?name ?status () = + let open Lwt in + let uri = Request.build_uri "/pet/{petId}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "petId" Int64.to_string pet_id in + let body = Request.init_form_encoded_body () in + let body = Request.maybe_add_form_encoded_body_param body "name" (fun x -> x) name in + let body = Request.maybe_add_form_encoded_body_param body "status" (fun x -> x) status in + let body = Request.finalize_form_encoded_body body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let upload_file ~pet_id ?additional_metadata ?file () = + let open Lwt in + let uri = Request.build_uri "/pet/{petId}/uploadImage" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "petId" Int64.to_string pet_id in + let body = Request.init_form_encoded_body () in + let body = Request.maybe_add_form_encoded_body_param body "additional_metadata" (fun x -> x) additional_metadata in + let body = Request.maybe_add_form_encoded_body_param body "file" (fun x -> x) file in + let body = Request.finalize_form_encoded_body body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Api_response.of_yojson) resp body + +let upload_file_with_required_file ~pet_id ~required_file ?additional_metadata () = + let open Lwt in + let uri = Request.build_uri "/fake/{petId}/uploadImageWithRequiredFile" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "petId" Int64.to_string pet_id in + let body = Request.init_form_encoded_body () in + let body = Request.maybe_add_form_encoded_body_param body "additional_metadata" (fun x -> x) additional_metadata in + let body = Request.add_form_encoded_body_param body "required_file" (fun x -> x) required_file in + let body = Request.finalize_form_encoded_body body in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Api_response.of_yojson) resp body + diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/pet_api.mli b/samples/openapi3/client/petstore/ocaml/src/apis/pet_api.mli new file mode 100644 index 00000000000..b3f4af03ce5 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/pet_api.mli @@ -0,0 +1,16 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +val add_pet : pet_t:Pet.t -> unit Lwt.t +val delete_pet : pet_id:int64 -> ?api_key:string -> unit -> unit Lwt.t +val find_pets_by_status : status:Enums.pet_status list -> Pet.t list Lwt.t +val find_pets_by_tags : tags:string list -> Pet.t list Lwt.t +val get_pet_by_id : pet_id:int64 -> Pet.t Lwt.t +val update_pet : pet_t:Pet.t -> unit Lwt.t +val update_pet_with_form : pet_id:int64 -> ?name:string -> ?status:string -> unit -> unit Lwt.t +val upload_file : pet_id:int64 -> ?additional_metadata:string -> ?file:string -> unit -> Api_response.t Lwt.t +val upload_file_with_required_file : pet_id:int64 -> required_file:string -> ?additional_metadata:string -> unit -> Api_response.t Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/store_api.ml b/samples/openapi3/client/petstore/ocaml/src/apis/store_api.ml new file mode 100644 index 00000000000..f88b0217bfd --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/store_api.ml @@ -0,0 +1,39 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +let delete_order ~order_id = + let open Lwt in + let uri = Request.build_uri "/store/order/{order_id}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "order_id" (fun x -> x) order_id in + Cohttp_lwt_unix.Client.call `DELETE uri ~headers >>= fun (resp, body) -> + Request.handle_unit_response resp + +let get_inventory () = + let open Lwt in + let uri = Request.build_uri "/store/inventory" in + let headers = Request.default_headers in + let headers = Cohttp.Header.add headers "api_key" Request.api_key in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as_map_of (JsonSupport.to_int32) resp body + +let get_order_by_id ~order_id = + let open Lwt in + let uri = Request.build_uri "/store/order/{order_id}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "order_id" Int64.to_string order_id in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Order.of_yojson) resp body + +let place_order ~order_t = + let open Lwt in + let uri = Request.build_uri "/store/order" in + let headers = Request.default_headers in + let body = Request.write_as_json_body Order.to_yojson order_t in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap Order.of_yojson) resp body + diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/store_api.mli b/samples/openapi3/client/petstore/ocaml/src/apis/store_api.mli new file mode 100644 index 00000000000..63b09db9ca5 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/store_api.mli @@ -0,0 +1,11 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +val delete_order : order_id:string -> unit Lwt.t +val get_inventory : unit -> (string * int32) list Lwt.t +val get_order_by_id : order_id:int64 -> Order.t Lwt.t +val place_order : order_t:Order.t -> Order.t Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/user_api.ml b/samples/openapi3/client/petstore/ocaml/src/apis/user_api.ml new file mode 100644 index 00000000000..9d1a563d1e8 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/user_api.ml @@ -0,0 +1,72 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +let create_user ~user_t = + let open Lwt in + let uri = Request.build_uri "/user" in + let headers = Request.default_headers in + let body = Request.write_as_json_body User.to_yojson user_t in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let create_users_with_array_input ~user = + let open Lwt in + let uri = Request.build_uri "/user/createWithArray" in + let headers = Request.default_headers in + let body = Request.write_as_json_body (JsonSupport.of_list_of User.to_yojson) user in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let create_users_with_list_input ~user = + let open Lwt in + let uri = Request.build_uri "/user/createWithList" in + let headers = Request.default_headers in + let body = Request.write_as_json_body (JsonSupport.of_list_of User.to_yojson) user in + Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + +let delete_user ~username = + let open Lwt in + let uri = Request.build_uri "/user/{username}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "username" (fun x -> x) username in + Cohttp_lwt_unix.Client.call `DELETE uri ~headers >>= fun (resp, body) -> + Request.handle_unit_response resp + +let get_user_by_name ~username = + let open Lwt in + let uri = Request.build_uri "/user/{username}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "username" (fun x -> x) username in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.unwrap User.of_yojson) resp body + +let login_user ~username ~password = + let open Lwt in + let uri = Request.build_uri "/user/login" in + let headers = Request.default_headers in + let uri = Request.add_query_param uri "username" (fun x -> x) username in + let uri = Request.add_query_param uri "password" (fun x -> x) password in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.read_json_body_as (JsonSupport.to_string) resp body + +let logout_user () = + let open Lwt in + let uri = Request.build_uri "/user/logout" in + let headers = Request.default_headers in + Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> + Request.handle_unit_response resp + +let update_user ~username ~user_t = + let open Lwt in + let uri = Request.build_uri "/user/{username}" in + let headers = Request.default_headers in + let uri = Request.replace_path_param uri "username" (fun x -> x) username in + let body = Request.write_as_json_body User.to_yojson user_t in + Cohttp_lwt_unix.Client.call `PUT uri ~headers ~body >>= fun (resp, body) -> + Request.handle_unit_response resp + diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/user_api.mli b/samples/openapi3/client/petstore/ocaml/src/apis/user_api.mli new file mode 100644 index 00000000000..9a7e8e59c3a --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/apis/user_api.mli @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +val create_user : user_t:User.t -> unit Lwt.t +val create_users_with_array_input : user:User.t list -> unit Lwt.t +val create_users_with_list_input : user:User.t list -> unit Lwt.t +val delete_user : username:string -> unit Lwt.t +val get_user_by_name : username:string -> User.t Lwt.t +val login_user : username:string -> password:string -> string Lwt.t +val logout_user : unit -> unit Lwt.t +val update_user : username:string -> user_t:User.t -> unit Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml/src/models/additional_properties_class.ml b/samples/openapi3/client/petstore/ocaml/src/models/additional_properties_class.ml new file mode 100644 index 00000000000..9dcaf86f9ec --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/additional_properties_class.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + map_property: (string * string) list; + map_of_map_property: (string * (string * string) list) list; +} [@@deriving yojson { strict = false }, show ];; + +let create () : t = { + map_property = []; + map_of_map_property = []; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/animal.ml b/samples/openapi3/client/petstore/ocaml/src/models/animal.ml new file mode 100644 index 00000000000..ac1ea09d155 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/animal.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + class_name: string; + color: string option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +let create (class_name : string) : t = { + class_name = class_name; + color = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/api_response.ml b/samples/openapi3/client/petstore/ocaml/src/models/api_response.ml new file mode 100644 index 00000000000..7e79b466928 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/api_response.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + code: int32 option [@default None]; + _type: string option [@default None]; + message: string option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +let create () : t = { + code = None; + _type = None; + message = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/array_of_array_of_number_only.ml b/samples/openapi3/client/petstore/ocaml/src/models/array_of_array_of_number_only.ml new file mode 100644 index 00000000000..b88dfe66f25 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/array_of_array_of_number_only.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + array_array_number: float list list; +} [@@deriving yojson { strict = false }, show ];; + +let create () : t = { + array_array_number = []; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/array_of_number_only.ml b/samples/openapi3/client/petstore/ocaml/src/models/array_of_number_only.ml new file mode 100644 index 00000000000..88d8440639c --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/array_of_number_only.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + array_number: float list; +} [@@deriving yojson { strict = false }, show ];; + +let create () : t = { + array_number = []; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/array_test.ml b/samples/openapi3/client/petstore/ocaml/src/models/array_test.ml new file mode 100644 index 00000000000..dc3ec34c9f9 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/array_test.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + array_of_string: string list; + array_array_of_integer: int64 list list; + array_array_of_model: Read_only_first.t list list; +} [@@deriving yojson { strict = false }, show ];; + +let create () : t = { + array_of_string = []; + array_array_of_integer = []; + array_array_of_model = []; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/capitalization.ml b/samples/openapi3/client/petstore/ocaml/src/models/capitalization.ml new file mode 100644 index 00000000000..7ea60bc00ad --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/capitalization.ml @@ -0,0 +1,26 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + small_camel: string option [@default None]; + capital_camel: string option [@default None]; + small_snake: string option [@default None]; + capital_snake: string option [@default None]; + sca_eth_flow_points: string option [@default None]; + (* Name of the pet *) + att_name: string option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +let create () : t = { + small_camel = None; + capital_camel = None; + small_snake = None; + capital_snake = None; + sca_eth_flow_points = None; + att_name = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/cat.ml b/samples/openapi3/client/petstore/ocaml/src/models/cat.ml new file mode 100644 index 00000000000..bd28b8ab731 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/cat.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + class_name: string; + color: string option [@default None]; + declawed: bool option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +let create (class_name : string) : t = { + class_name = class_name; + color = None; + declawed = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/cat_all_of.ml b/samples/openapi3/client/petstore/ocaml/src/models/cat_all_of.ml new file mode 100644 index 00000000000..8ef4045a61f --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/cat_all_of.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + declawed: bool option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +let create () : t = { + declawed = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/category.ml b/samples/openapi3/client/petstore/ocaml/src/models/category.ml new file mode 100644 index 00000000000..cb4c98edec4 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/category.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + id: int64 option [@default None]; + name: string; +} [@@deriving yojson { strict = false }, show ];; + +let create (name : string) : t = { + id = None; + name = name; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/class_model.ml b/samples/openapi3/client/petstore/ocaml/src/models/class_model.ml new file mode 100644 index 00000000000..69dfbf46dcc --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/class_model.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema Class_model.t : Model for testing model with \''_class\'' property + *) + +type t = { + _class: string option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +(** Model for testing model with \''_class\'' property *) +let create () : t = { + _class = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/client.ml b/samples/openapi3/client/petstore/ocaml/src/models/client.ml new file mode 100644 index 00000000000..20ccd895114 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/client.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + client: string option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +let create () : t = { + client = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/dog.ml b/samples/openapi3/client/petstore/ocaml/src/models/dog.ml new file mode 100644 index 00000000000..e3dd000c8d6 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/dog.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + class_name: string; + color: string option [@default None]; + breed: string option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +let create (class_name : string) : t = { + class_name = class_name; + color = None; + breed = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/dog_all_of.ml b/samples/openapi3/client/petstore/ocaml/src/models/dog_all_of.ml new file mode 100644 index 00000000000..1a02a8d8b9a --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/dog_all_of.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + breed: string option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +let create () : t = { + breed = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/enum_arrays.ml b/samples/openapi3/client/petstore/ocaml/src/models/enum_arrays.ml new file mode 100644 index 00000000000..99953247de1 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/enum_arrays.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + just_symbol: Enums.just_symbol option [@default None]; + array_enum: Enums.array_enum list; +} [@@deriving yojson { strict = false }, show ];; + +let create () : t = { + just_symbol = None; + array_enum = []; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/enum_test.ml b/samples/openapi3/client/petstore/ocaml/src/models/enum_test.ml new file mode 100644 index 00000000000..67d474406f5 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/enum_test.ml @@ -0,0 +1,29 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + enum_string: Enums.enum_string option [@default None]; + enum_string_required: Enums.enum_string; + enum_integer: Enums.enum_integer option [@default None]; + enum_number: Enums.enum_number option [@default None]; + outer_enum: Enums.status option [@default None]; + outer_enum_integer: Enums.outerenuminteger option [@default None]; + outer_enum_default_value: Enums.status option [@default None]; + outer_enum_integer_default_value: Enums.outerenuminteger option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +let create (enum_string_required : Enums.enum_string) : t = { + enum_string = None; + enum_string_required = enum_string_required; + enum_integer = None; + enum_number = None; + outer_enum = None; + outer_enum_integer = None; + outer_enum_default_value = None; + outer_enum_integer_default_value = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/file.ml b/samples/openapi3/client/petstore/ocaml/src/models/file.ml new file mode 100644 index 00000000000..72df1e20230 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/file.ml @@ -0,0 +1,18 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema File.t : Must be named `File` for test. + *) + +type t = { + (* Test capitalization *) + source_uri: string option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +(** Must be named `File` for test. *) +let create () : t = { + source_uri = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/file_schema_test_class.ml b/samples/openapi3/client/petstore/ocaml/src/models/file_schema_test_class.ml new file mode 100644 index 00000000000..6ce6e13efda --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/file_schema_test_class.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + file: File.t option [@default None]; + files: File.t list; +} [@@deriving yojson { strict = false }, show ];; + +let create () : t = { + file = None; + files = []; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/foo.ml b/samples/openapi3/client/petstore/ocaml/src/models/foo.ml new file mode 100644 index 00000000000..73821fc1aaf --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/foo.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + bar: string option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +let create () : t = { + bar = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/format_test.ml b/samples/openapi3/client/petstore/ocaml/src/models/format_test.ml new file mode 100644 index 00000000000..a2c8bc72c5a --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/format_test.ml @@ -0,0 +1,45 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + integer: int32 option [@default None]; + int32: int32 option [@default None]; + int64: int64 option [@default None]; + number: float; + float: float option [@default None]; + double: float option [@default None]; + string: string option [@default None]; + byte: string; + binary: string option [@default None]; + date: string; + date_time: string option [@default None]; + uuid: string option [@default None]; + password: string; + (* A string that is a 10 digit number. Can have leading zeros. *) + pattern_with_digits: string option [@default None]; + (* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. *) + pattern_with_digits_and_delimiter: string option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +let create (number : float) (byte : string) (date : string) (password : string) : t = { + integer = None; + int32 = None; + int64 = None; + number = number; + float = None; + double = None; + string = None; + byte = byte; + binary = None; + date = date; + date_time = None; + uuid = None; + password = password; + pattern_with_digits = None; + pattern_with_digits_and_delimiter = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/has_only_read_only.ml b/samples/openapi3/client/petstore/ocaml/src/models/has_only_read_only.ml new file mode 100644 index 00000000000..54db5e69ad7 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/has_only_read_only.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + bar: string option [@default None]; + foo: string option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +let create () : t = { + bar = None; + foo = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/health_check_result.ml b/samples/openapi3/client/petstore/ocaml/src/models/health_check_result.ml new file mode 100644 index 00000000000..4ff90c6cb4d --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/health_check_result.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema Health_check_result.t : Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + *) + +type t = { + nullable_message: string option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +(** Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. *) +let create () : t = { + nullable_message = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/inline_object.ml b/samples/openapi3/client/petstore/ocaml/src/models/inline_object.ml new file mode 100644 index 00000000000..37a44a8d683 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/inline_object.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + (* Updated name of the pet *) + name: string option [@default None]; + (* Updated status of the pet *) + status: string option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +let create () : t = { + name = None; + status = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/inline_object_1.ml b/samples/openapi3/client/petstore/ocaml/src/models/inline_object_1.ml new file mode 100644 index 00000000000..2d453134c43 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/inline_object_1.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + (* Additional data to pass to server *) + additional_metadata: string option [@default None]; + (* file to upload *) + file: string option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +let create () : t = { + additional_metadata = None; + file = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/inline_object_2.ml b/samples/openapi3/client/petstore/ocaml/src/models/inline_object_2.ml new file mode 100644 index 00000000000..1a007a7afe4 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/inline_object_2.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + (* Form parameter enum test (string array) *) + enum_form_string_array: Enums.enum_form_string_array list; + (* Form parameter enum test (string) *) + enum_form_string: Enums.enumclass option [@default Some(`Minusefg)]; +} [@@deriving yojson { strict = false }, show ];; + +let create () : t = { + enum_form_string_array = []; + enum_form_string = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/inline_object_3.ml b/samples/openapi3/client/petstore/ocaml/src/models/inline_object_3.ml new file mode 100644 index 00000000000..7d58d3cdbe5 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/inline_object_3.ml @@ -0,0 +1,55 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + (* None *) + integer: int32 option [@default None]; + (* None *) + int32: int32 option [@default None]; + (* None *) + int64: int64 option [@default None]; + (* None *) + number: float; + (* None *) + float: float option [@default None]; + (* None *) + double: float; + (* None *) + string: string option [@default None]; + (* None *) + pattern_without_delimiter: string; + (* None *) + byte: string; + (* None *) + binary: string option [@default None]; + (* None *) + date: string option [@default None]; + (* None *) + date_time: string option [@default None]; + (* None *) + password: string option [@default None]; + (* None *) + callback: string option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +let create (number : float) (double : float) (pattern_without_delimiter : string) (byte : string) : t = { + integer = None; + int32 = None; + int64 = None; + number = number; + float = None; + double = double; + string = None; + pattern_without_delimiter = pattern_without_delimiter; + byte = byte; + binary = None; + date = None; + date_time = None; + password = None; + callback = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/inline_object_4.ml b/samples/openapi3/client/petstore/ocaml/src/models/inline_object_4.ml new file mode 100644 index 00000000000..8914801491a --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/inline_object_4.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + (* field1 *) + param: string; + (* field2 *) + param2: string; +} [@@deriving yojson { strict = false }, show ];; + +let create (param : string) (param2 : string) : t = { + param = param; + param2 = param2; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/inline_object_5.ml b/samples/openapi3/client/petstore/ocaml/src/models/inline_object_5.ml new file mode 100644 index 00000000000..14ca3e41a98 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/inline_object_5.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + (* Additional data to pass to server *) + additional_metadata: string option [@default None]; + (* file to upload *) + required_file: string; +} [@@deriving yojson { strict = false }, show ];; + +let create (required_file : string) : t = { + additional_metadata = None; + required_file = required_file; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/inline_response_default.ml b/samples/openapi3/client/petstore/ocaml/src/models/inline_response_default.ml new file mode 100644 index 00000000000..b30b92591bd --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/inline_response_default.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + string: Foo.t option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +let create () : t = { + string = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/map_test.ml b/samples/openapi3/client/petstore/ocaml/src/models/map_test.ml new file mode 100644 index 00000000000..2bdd8f156b4 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/map_test.ml @@ -0,0 +1,21 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + map_map_of_string: (string * (string * string) list) list; + map_of_enum_string: (string * Enums.map_of_enum_string) list; + direct_map: (string * bool) list; + indirect_map: (string * bool) list; +} [@@deriving yojson { strict = false }, show ];; + +let create () : t = { + map_map_of_string = []; + map_of_enum_string = []; + direct_map = []; + indirect_map = []; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/mixed_properties_and_additional_properties_class.ml b/samples/openapi3/client/petstore/ocaml/src/models/mixed_properties_and_additional_properties_class.ml new file mode 100644 index 00000000000..ba41c7e7069 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/mixed_properties_and_additional_properties_class.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + uuid: string option [@default None]; + date_time: string option [@default None]; + map: (string * Animal.t) list; +} [@@deriving yojson { strict = false }, show ];; + +let create () : t = { + uuid = None; + date_time = None; + map = []; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/model_200_response.ml b/samples/openapi3/client/petstore/ocaml/src/models/model_200_response.ml new file mode 100644 index 00000000000..4cd900d8a58 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/model_200_response.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema Model_200_response.t : Model for testing model name starting with number + *) + +type t = { + name: int32 option [@default None]; + _class: string option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +(** Model for testing model name starting with number *) +let create () : t = { + name = None; + _class = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/model__special_model_name_.ml b/samples/openapi3/client/petstore/ocaml/src/models/model__special_model_name_.ml new file mode 100644 index 00000000000..61bc6d001f4 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/model__special_model_name_.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + special_property_name: int64 option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +let create () : t = { + special_property_name = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/name.ml b/samples/openapi3/client/petstore/ocaml/src/models/name.ml new file mode 100644 index 00000000000..dc4d8da8fd8 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/name.ml @@ -0,0 +1,23 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema Name.t : Model for testing model name same as property name + *) + +type t = { + name: int32; + snake_case: int32 option [@default None]; + property: string option [@default None]; + var_123_number: int32 option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +(** Model for testing model name same as property name *) +let create (name : int32) : t = { + name = name; + snake_case = None; + property = None; + var_123_number = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/nullable_class.ml b/samples/openapi3/client/petstore/ocaml/src/models/nullable_class.ml new file mode 100644 index 00000000000..e48c6f0d324 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/nullable_class.ml @@ -0,0 +1,37 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + integer_prop: int32 option [@default None]; + number_prop: float option [@default None]; + boolean_prop: bool option [@default None]; + string_prop: string option [@default None]; + date_prop: string option [@default None]; + datetime_prop: string option [@default None]; + array_nullable_prop: Yojson.Safe.t list; + array_and_items_nullable_prop: Yojson.Safe.t list; + array_items_nullable: Yojson.Safe.t list; + object_nullable_prop: (string * Yojson.Safe.t) list; + object_and_items_nullable_prop: (string * Yojson.Safe.t) list; + object_items_nullable: (string * Yojson.Safe.t) list; +} [@@deriving yojson { strict = false }, show ];; + +let create () : t = { + integer_prop = None; + number_prop = None; + boolean_prop = None; + string_prop = None; + date_prop = None; + datetime_prop = None; + array_nullable_prop = []; + array_and_items_nullable_prop = []; + array_items_nullable = []; + object_nullable_prop = []; + object_and_items_nullable_prop = []; + object_items_nullable = []; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/number_only.ml b/samples/openapi3/client/petstore/ocaml/src/models/number_only.ml new file mode 100644 index 00000000000..907a9acac9b --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/number_only.ml @@ -0,0 +1,15 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + just_number: float option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +let create () : t = { + just_number = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/order.ml b/samples/openapi3/client/petstore/ocaml/src/models/order.ml new file mode 100644 index 00000000000..19ddf1e02e6 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/order.ml @@ -0,0 +1,26 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + id: int64 option [@default None]; + pet_id: int64 option [@default None]; + quantity: int32 option [@default None]; + ship_date: string option [@default None]; + (* Order Status *) + status: Enums.status option [@default None]; + complete: bool option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +let create () : t = { + id = None; + pet_id = None; + quantity = None; + ship_date = None; + status = None; + complete = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/outer_composite.ml b/samples/openapi3/client/petstore/ocaml/src/models/outer_composite.ml new file mode 100644 index 00000000000..ab5d8902e08 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/outer_composite.ml @@ -0,0 +1,19 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + my_number: float option [@default None]; + my_string: string option [@default None]; + my_boolean: bool option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +let create () : t = { + my_number = None; + my_string = None; + my_boolean = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/pet.ml b/samples/openapi3/client/petstore/ocaml/src/models/pet.ml new file mode 100644 index 00000000000..10d93f2552d --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/pet.ml @@ -0,0 +1,26 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + id: int64 option [@default None]; + category: Category.t option [@default None]; + name: string; + photo_urls: string list; + tags: Tag.t list; + (* pet status in the store *) + status: Enums.pet_status option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +let create (name : string) (photo_urls : string list) : t = { + id = None; + category = None; + name = name; + photo_urls = photo_urls; + tags = []; + status = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/read_only_first.ml b/samples/openapi3/client/petstore/ocaml/src/models/read_only_first.ml new file mode 100644 index 00000000000..7ebca9b2119 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/read_only_first.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + bar: string option [@default None]; + baz: string option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +let create () : t = { + bar = None; + baz = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/return.ml b/samples/openapi3/client/petstore/ocaml/src/models/return.ml new file mode 100644 index 00000000000..cb27db04936 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/return.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + * Schema Return.t : Model for testing reserved words + *) + +type t = { + return: int32 option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +(** Model for testing reserved words *) +let create () : t = { + return = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/tag.ml b/samples/openapi3/client/petstore/ocaml/src/models/tag.ml new file mode 100644 index 00000000000..4dc25fdca67 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/tag.ml @@ -0,0 +1,17 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + id: int64 option [@default None]; + name: string option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +let create () : t = { + id = None; + name = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/models/user.ml b/samples/openapi3/client/petstore/ocaml/src/models/user.ml new file mode 100644 index 00000000000..81e7d4e4e02 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/models/user.ml @@ -0,0 +1,30 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type t = { + id: int64 option [@default None]; + username: string option [@default None]; + first_name: string option [@default None]; + last_name: string option [@default None]; + email: string option [@default None]; + password: string option [@default None]; + phone: string option [@default None]; + (* User Status *) + user_status: int32 option [@default None]; +} [@@deriving yojson { strict = false }, show ];; + +let create () : t = { + id = None; + username = None; + first_name = None; + last_name = None; + email = None; + password = None; + phone = None; + user_status = None; +} + diff --git a/samples/openapi3/client/petstore/ocaml/src/support/enums.ml b/samples/openapi3/client/petstore/ocaml/src/support/enums.ml new file mode 100644 index 00000000000..63ec5f49f85 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/support/enums.ml @@ -0,0 +1,142 @@ +(* + * This file has been generated by the OCamlClientCodegen generator for openapi-generator. + * + * Generated by: https://openapi-generator.tech + * + *) + +type outerenuminteger = [ +| `_0 [@printer fun fmt _ -> Format.pp_print_string fmt "0"] [@name "0"] +| `_1 [@printer fun fmt _ -> Format.pp_print_string fmt "1"] [@name "1"] +| `_2 [@printer fun fmt _ -> Format.pp_print_string fmt "2"] [@name "2"] +] [@@deriving yojson, show { with_path = false }];; + +let outerenuminteger_of_yojson json = outerenuminteger_of_yojson (`List [json]) +let outerenuminteger_to_yojson e = + match outerenuminteger_to_yojson e with + | `List [json] -> json + | json -> json + +type status = [ +| `Placed [@printer fun fmt _ -> Format.pp_print_string fmt "placed"] [@name "placed"] +| `Approved [@printer fun fmt _ -> Format.pp_print_string fmt "approved"] [@name "approved"] +| `Delivered [@printer fun fmt _ -> Format.pp_print_string fmt "delivered"] [@name "delivered"] +] [@@deriving yojson, show { with_path = false }];; + +let status_of_yojson json = status_of_yojson (`List [json]) +let status_to_yojson e = + match status_to_yojson e with + | `List [json] -> json + | json -> json + +type enum_query_integer = [ +| `_1 [@printer fun fmt _ -> Format.pp_print_string fmt "1"] [@name "1"] +| `Minus2 [@printer fun fmt _ -> Format.pp_print_string fmt "-2"] [@name "-2"] +] [@@deriving yojson, show { with_path = false }];; + +let enum_query_integer_of_yojson json = enum_query_integer_of_yojson (`List [json]) +let enum_query_integer_to_yojson e = + match enum_query_integer_to_yojson e with + | `List [json] -> json + | json -> json + +type enum_form_string_array = [ +| `Greater_Than [@printer fun fmt _ -> Format.pp_print_string fmt ">"] [@name ">"] +| `Dollar [@printer fun fmt _ -> Format.pp_print_string fmt "$"] [@name "$"] +] [@@deriving yojson, show { with_path = false }];; + +let enum_form_string_array_of_yojson json = enum_form_string_array_of_yojson (`List [json]) +let enum_form_string_array_to_yojson e = + match enum_form_string_array_to_yojson e with + | `List [json] -> json + | json -> json + +type enum_number = [ +| `_1Period1 [@printer fun fmt _ -> Format.pp_print_string fmt "1.1"] [@name "1.1"] +| `Minus1Period2 [@printer fun fmt _ -> Format.pp_print_string fmt "-1.2"] [@name "-1.2"] +] [@@deriving yojson, show { with_path = false }];; + +let enum_number_of_yojson json = enum_number_of_yojson (`List [json]) +let enum_number_to_yojson e = + match enum_number_to_yojson e with + | `List [json] -> json + | json -> json + +type map_of_enum_string = [ +| `UPPER [@printer fun fmt _ -> Format.pp_print_string fmt "UPPER"] [@name "UPPER"] +| `Lower [@printer fun fmt _ -> Format.pp_print_string fmt "lower"] [@name "lower"] +] [@@deriving yojson, show { with_path = false }];; + +let map_of_enum_string_of_yojson json = map_of_enum_string_of_yojson (`List [json]) +let map_of_enum_string_to_yojson e = + match map_of_enum_string_to_yojson e with + | `List [json] -> json + | json -> json + +type enum_integer = [ +| `_1 [@printer fun fmt _ -> Format.pp_print_string fmt "1"] [@name "1"] +| `Minus1 [@printer fun fmt _ -> Format.pp_print_string fmt "-1"] [@name "-1"] +] [@@deriving yojson, show { with_path = false }];; + +let enum_integer_of_yojson json = enum_integer_of_yojson (`List [json]) +let enum_integer_to_yojson e = + match enum_integer_to_yojson e with + | `List [json] -> json + | json -> json + +type just_symbol = [ +| `Greater_ThanEqual [@printer fun fmt _ -> Format.pp_print_string fmt ">="] [@name ">="] +| `Dollar [@printer fun fmt _ -> Format.pp_print_string fmt "$"] [@name "$"] +] [@@deriving yojson, show { with_path = false }];; + +let just_symbol_of_yojson json = just_symbol_of_yojson (`List [json]) +let just_symbol_to_yojson e = + match just_symbol_to_yojson e with + | `List [json] -> json + | json -> json + +type array_enum = [ +| `Fish [@printer fun fmt _ -> Format.pp_print_string fmt "fish"] [@name "fish"] +| `Crab [@printer fun fmt _ -> Format.pp_print_string fmt "crab"] [@name "crab"] +] [@@deriving yojson, show { with_path = false }];; + +let array_enum_of_yojson json = array_enum_of_yojson (`List [json]) +let array_enum_to_yojson e = + match array_enum_to_yojson e with + | `List [json] -> json + | json -> json + +type pet_status = [ +| `Available [@printer fun fmt _ -> Format.pp_print_string fmt "available"] [@name "available"] +| `Pending [@printer fun fmt _ -> Format.pp_print_string fmt "pending"] [@name "pending"] +| `Sold [@printer fun fmt _ -> Format.pp_print_string fmt "sold"] [@name "sold"] +] [@@deriving yojson, show { with_path = false }];; + +let pet_status_of_yojson json = pet_status_of_yojson (`List [json]) +let pet_status_to_yojson e = + match pet_status_to_yojson e with + | `List [json] -> json + | json -> json + +type enumclass = [ +| `_abc [@printer fun fmt _ -> Format.pp_print_string fmt "_abc"] [@name "_abc"] +| `Minusefg [@printer fun fmt _ -> Format.pp_print_string fmt "-efg"] [@name "-efg"] +| `Left_ParenthesisxyzRight_Parenthesis [@printer fun fmt _ -> Format.pp_print_string fmt "(xyz)"] [@name "(xyz)"] +] [@@deriving yojson, show { with_path = false }];; + +let enumclass_of_yojson json = enumclass_of_yojson (`List [json]) +let enumclass_to_yojson e = + match enumclass_to_yojson e with + | `List [json] -> json + | json -> json + +type enum_string = [ +| `UPPER [@printer fun fmt _ -> Format.pp_print_string fmt "UPPER"] [@name "UPPER"] +| `Lower [@printer fun fmt _ -> Format.pp_print_string fmt "lower"] [@name "lower"] +] [@@deriving yojson, show { with_path = false }];; + +let enum_string_of_yojson json = enum_string_of_yojson (`List [json]) +let enum_string_to_yojson e = + match enum_string_to_yojson e with + | `List [json] -> json + | json -> json diff --git a/samples/openapi3/client/petstore/ocaml/src/support/jsonSupport.ml b/samples/openapi3/client/petstore/ocaml/src/support/jsonSupport.ml new file mode 100644 index 00000000000..4b0fac77545 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/support/jsonSupport.ml @@ -0,0 +1,55 @@ +open Ppx_deriving_yojson_runtime + +let unwrap to_json json = + match to_json json with + | Result.Ok json -> json + | Result.Error s -> failwith s + +let to_int json = + match json with + | `Int x -> x + | `Intlit s -> int_of_string s + | _ -> failwith "JsonSupport.to_int" + +let to_bool json = + match json with + | `Bool x -> x + | _ -> failwith "JsonSupport.to_bool" + +let to_float json = + match json with + | `Float x -> x + | _ -> failwith "JsonSupport.to_float" + +let to_string json = + match json with + | `String s -> s + | _ -> failwith "JsonSupport.to_string" + +let to_int32 json : int32 = + match json with + | `Int x -> Int32.of_int x + | `Intlit s -> Int32.of_string s + | _ -> failwith "JsonSupport.to_int32" + +let to_int64 json : int64 = + match json with + | `Int x -> Int64.of_int x + | `Intlit s -> Int64.of_string s + | _ -> failwith "JsonSupport.to_int64" + +let of_int x = `Int x + +let of_bool b = `Bool b + +let of_float x = `Float x + +let of_string s = `String s + +let of_int32 x = `Intlit (Int32.to_string x) + +let of_int64 x = `Intlit (Int64.to_string x) + +let of_list_of of_f l = `List (List.map of_f l) + +let of_map_of of_f l = `Assoc (List.map (fun (k, v) -> (k, of_f v)) l) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ocaml/src/support/request.ml b/samples/openapi3/client/petstore/ocaml/src/support/request.ml new file mode 100644 index 00000000000..98f4dfd43a4 --- /dev/null +++ b/samples/openapi3/client/petstore/ocaml/src/support/request.ml @@ -0,0 +1,97 @@ +let api_key = "" +let base_url = "http://petstore.swagger.io:80/v2" +let default_headers = Cohttp.Header.init_with "Content-Type" "application/json" + +let option_fold f default o = + match o with + | Some v -> f v + | None -> default + +let build_uri operation_path = Uri.of_string (base_url ^ operation_path) + +let add_string_header headers key value = + Cohttp.Header.add headers key value + +let add_string_header_multi headers key values = + Cohttp.Header.add_multi headers key values + +let add_header headers key to_string value = + Cohttp.Header.add headers key (to_string value) + +let add_header_multi headers key to_string value = + Cohttp.Header.add_multi headers key (to_string value) + +let maybe_add_header headers key to_string value = + option_fold (add_header headers key to_string) headers value + +let maybe_add_header_multi headers key to_string value = + option_fold (add_header_multi headers key to_string) headers value + +let write_string_body s = Cohttp_lwt.Body.of_string s + +let write_json_body payload = + Cohttp_lwt.Body.of_string (Yojson.Safe.to_string payload ~std:true) + +let write_as_json_body to_json payload = write_json_body (to_json payload) + +let handle_response resp on_success_handler = + match Cohttp_lwt.Response.status resp with + | #Cohttp.Code.success_status -> on_success_handler () + | s -> failwith ("Server responded with status " ^ Cohttp.Code.(reason_phrase_of_code (code_of_status s))) + +let handle_unit_response resp = handle_response resp (fun () -> Lwt.return ()) + +let read_json_body resp body = + handle_response resp (fun () -> + (Lwt.(Cohttp_lwt.Body.to_string body >|= Yojson.Safe.from_string))) + +let read_json_body_as of_json resp body = + Lwt.(read_json_body resp body >|= of_json) + +let read_json_body_as_list resp body = + Lwt.(read_json_body resp body >|= Yojson.Safe.Util.to_list) + +let read_json_body_as_list_of of_json resp body = + Lwt.(read_json_body_as_list resp body >|= List.map of_json) + +let read_json_body_as_map resp body = + Lwt.(read_json_body resp body >|= Yojson.Safe.Util.to_assoc) + +let read_json_body_as_map_of of_json resp body = + Lwt.(read_json_body_as_map resp body >|= List.map (fun (s, v) -> (s, of_json v))) + +let replace_string_path_param uri param_name param_value = + let regexp = Str.regexp (Str.quote ("{" ^ param_name ^ "}")) in + let path = Str.global_replace regexp param_value (Uri.pct_decode (Uri.path uri)) in + Uri.with_path uri path + +let replace_path_param uri param_name to_string param_value = + replace_string_path_param uri param_name (to_string param_value) + +let maybe_replace_path_param uri param_name to_string param_value = + option_fold (replace_path_param uri param_name to_string) uri param_value + +let add_query_param uri param_name to_string param_value = + Uri.add_query_param' uri (param_name, to_string param_value) + +let add_query_param_list uri param_name to_string param_value = + Uri.add_query_param uri (param_name, to_string param_value) + +let maybe_add_query_param uri param_name to_string param_value = + option_fold (add_query_param uri param_name to_string) uri param_value + +let init_form_encoded_body () = "" + +let add_form_encoded_body_param params param_name to_string param_value = + let new_param_enc = Printf.sprintf {|%s=%s|} (Uri.pct_encode param_name) (Uri.pct_encode (to_string param_value)) in + if params = "" + then new_param_enc + else Printf.sprintf {|%s&%s|} params new_param_enc + +let add_form_encoded_body_param_list params param_name to_string new_params = + add_form_encoded_body_param params param_name (String.concat ",") (to_string new_params) + +let maybe_add_form_encoded_body_param params param_name to_string param_value = + option_fold (add_form_encoded_body_param params param_name to_string) params param_value + +let finalize_form_encoded_body body = Cohttp_lwt.Body.of_string body From 7f36f2642209c6d7070e1d76209ba1928d816922 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 8 Aug 2019 09:49:01 +0800 Subject: [PATCH 60/75] using partials in ruby api_client (#3564) --- .../codegen/languages/RubyClientCodegen.java | 5 +- .../resources/ruby-client/api_client.mustache | 127 +----- .../api_client_faraday_partial.mustache | 129 ++++++ .../api_client_typhoeus_partial.mustache | 115 +++++ .../ruby-client/faraday_api_client.mustache | 394 ------------------ .../ruby-faraday/lib/petstore/api_client.rb | 66 +-- .../petstore/ruby/lib/petstore/api_client.rb | 56 +-- 7 files changed, 319 insertions(+), 573 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/ruby-client/api_client_faraday_partial.mustache create mode 100644 modules/openapi-generator/src/main/resources/ruby-client/api_client_typhoeus_partial.mustache delete mode 100644 modules/openapi-generator/src/main/resources/ruby-client/faraday_api_client.mustache diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java index 0a771696067..fc23117e458 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RubyClientCodegen.java @@ -234,11 +234,12 @@ public class RubyClientCodegen extends AbstractRubyCodegen { supportingFiles.add(new SupportingFile("travis.mustache", "", ".travis.yml")); supportingFiles.add(new SupportingFile("gemspec.mustache", "", gemName + ".gemspec")); supportingFiles.add(new SupportingFile("configuration.mustache", gemFolder, "configuration.rb")); + supportingFiles.add(new SupportingFile("api_client.mustache", gemFolder, "api_client.rb")); if (TYPHOEUS.equals(getLibrary())) { - supportingFiles.add(new SupportingFile("api_client.mustache", gemFolder, "api_client.rb")); + // for Typhoeus } else if (FARADAY.equals(getLibrary())) { - supportingFiles.add(new SupportingFile("faraday_api_client.mustache", gemFolder, "api_client.rb")); + // for Faraday additionalProperties.put("isFaraday", Boolean.TRUE); } else { throw new RuntimeException("Invalid HTTP library " + getLibrary() + ". Only faraday, typhoeus are supported."); diff --git a/modules/openapi-generator/src/main/resources/ruby-client/api_client.mustache b/modules/openapi-generator/src/main/resources/ruby-client/api_client.mustache index 28c76241620..5d263ece7e3 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/api_client.mustache @@ -6,7 +6,12 @@ require 'date' require 'json' require 'logger' require 'tempfile' +{{^isFaraday}} require 'typhoeus' +{{/isFaraday}} +{{#isFaraday}} +require 'faraday' +{{/isFaraday}} module {{moduleName}} class ApiClient @@ -33,94 +38,12 @@ module {{moduleName}} @@default ||= ApiClient.new end - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - response = request.run - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.timed_out? - fail ApiError.new('Connection timed out') - elsif response.code == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.code, - :response_headers => response.headers, - :response_body => response.body), - response.status_message - end - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.code, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - {{#hasAuthMethods}} - update_params_for_auth! header_params, query_params, opts[:auth_names] - {{/hasAuthMethods}} - - # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) - _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :ssl_verifypeer => @config.verify_ssl, - :ssl_verifyhost => _verify_ssl_host, - :sslcert => @config.cert_file, - :sslkey => @config.key_file, - :verbose => @config.debugging - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - - request = Typhoeus::Request.new(url, req_opts) - download_file(request) if opts[:return_type] == 'File' - request - end - +{{^isFaraday}} +{{> api_client_typhoeus_partial}} +{{/isFaraday}} +{{#isFaraday}} +{{> api_client_faraday_partial}} +{{/isFaraday}} # Check if the given MIME is a JSON MIME. # JSON MIME examples: # application/json @@ -258,34 +181,6 @@ module {{moduleName}} @config.base_url + path end - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - # Update hearder and query params based on authentication settings. # # @param [Hash] header_params Header parameters diff --git a/modules/openapi-generator/src/main/resources/ruby-client/api_client_faraday_partial.mustache b/modules/openapi-generator/src/main/resources/ruby-client/api_client_faraday_partial.mustache new file mode 100644 index 00000000000..7fc08ee0fce --- /dev/null +++ b/modules/openapi-generator/src/main/resources/ruby-client/api_client_faraday_partial.mustache @@ -0,0 +1,129 @@ + # Call an API with given options. + # + # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: + # the data deserialized from response body (could be nil), response status code and response headers. + def call_api(http_method, path, opts = {}) + ssl_options = { + :ca_file => @config.ssl_ca_file, + :verify => @config.ssl_verify, + :verify => @config.ssl_verify_mode, + :client_cert => @config.ssl_client_cert, + :client_key => @config.ssl_client_key + } + + connection = Faraday.new(:url => config.base_url, :ssl => ssl_options) do |conn| + conn.basic_auth(config.username, config.password) + if opts[:header_params]["Content-Type"] == "multipart/form-data" + conn.request :multipart + conn.request :url_encoded + end + conn.adapter(Faraday.default_adapter) + end + + begin + response = connection.public_send(http_method.to_sym.downcase) do |req| + build_request(http_method, path, req, opts) + end + + if @config.debugging + @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" + end + + unless response.success? + if response.status == 0 + # Errors from libcurl will be made visible here + fail ApiError.new(:code => 0, + :message => response.return_message) + else + fail ApiError.new(:code => response.status, + :response_headers => response.headers, + :response_body => response.body), + response.reason_phrase + end + end + rescue Faraday::TimeoutError + fail ApiError.new('Connection timed out') + end + + if opts[:return_type] + data = deserialize(response, opts[:return_type]) + else + data = nil + end + return data, response.status, response.headers + end + + # Builds the HTTP request + # + # @param [String] http_method HTTP method/verb (e.g. POST) + # @param [String] path URL path (e.g. /account/new) + # @option opts [Hash] :header_params Header parameters + # @option opts [Hash] :query_params Query parameters + # @option opts [Hash] :form_params Query parameters + # @option opts [Object] :body HTTP body (JSON/XML) + # @return [Typhoeus::Request] A Typhoeus Request + def build_request(http_method, path, request, opts = {}) + url = build_request_url(path) + http_method = http_method.to_sym.downcase + + header_params = @default_headers.merge(opts[:header_params] || {}) + query_params = opts[:query_params] || {} + form_params = opts[:form_params] || {} + + update_params_for_auth! header_params, query_params, opts[:auth_names] + + req_opts = { + :method => http_method, + :headers => header_params, + :params => query_params, + :params_encoding => @config.params_encoding, + :timeout => @config.timeout, + :verbose => @config.debugging + } + + if [:post, :patch, :put, :delete].include?(http_method) + req_body = build_request_body(header_params, form_params, opts[:body]) + req_opts.update :body => req_body + if @config.debugging + @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" + end + end + request.headers = header_params + request.body = req_body + request.url url + request.params = query_params + download_file(request) if opts[:return_type] == 'File' + request + end + + # Builds the HTTP request body + # + # @param [Hash] header_params Header parameters + # @param [Hash] form_params Query parameters + # @param [Object] body HTTP body (JSON/XML) + # @return [String] HTTP body data in the form of string + def build_request_body(header_params, form_params, body) + # http form + if header_params['Content-Type'] == 'application/x-www-form-urlencoded' + data = URI.encode_www_form(form_params) + elsif header_params['Content-Type'] == 'multipart/form-data' + data = {} + form_params.each do |key, value| + case value + when ::File, ::Tempfile + # TODO hardcode to application/octet-stream, need better way to detect content type + data[key] = Faraday::UploadIO.new(value.path, 'application/octet-stream', value.path) + when ::Array, nil + # let Faraday handle Array and nil parameters + data[key] = value + else + data[key] = value.to_s + end + end + elsif body + data = body.is_a?(String) ? body : body.to_json + else + data = nil + end + data + end diff --git a/modules/openapi-generator/src/main/resources/ruby-client/api_client_typhoeus_partial.mustache b/modules/openapi-generator/src/main/resources/ruby-client/api_client_typhoeus_partial.mustache new file mode 100644 index 00000000000..bd554afc006 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/ruby-client/api_client_typhoeus_partial.mustache @@ -0,0 +1,115 @@ + # Call an API with given options. + # + # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: + # the data deserialized from response body (could be nil), response status code and response headers. + def call_api(http_method, path, opts = {}) + request = build_request(http_method, path, opts) + response = request.run + + if @config.debugging + @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" + end + + unless response.success? + if response.timed_out? + fail ApiError.new('Connection timed out') + elsif response.code == 0 + # Errors from libcurl will be made visible here + fail ApiError.new(:code => 0, + :message => response.return_message) + else + fail ApiError.new(:code => response.code, + :response_headers => response.headers, + :response_body => response.body), + response.status_message + end + end + + if opts[:return_type] + data = deserialize(response, opts[:return_type]) + else + data = nil + end + return data, response.code, response.headers + end + + # Builds the HTTP request + # + # @param [String] http_method HTTP method/verb (e.g. POST) + # @param [String] path URL path (e.g. /account/new) + # @option opts [Hash] :header_params Header parameters + # @option opts [Hash] :query_params Query parameters + # @option opts [Hash] :form_params Query parameters + # @option opts [Object] :body HTTP body (JSON/XML) + # @return [Typhoeus::Request] A Typhoeus Request + def build_request(http_method, path, opts = {}) + url = build_request_url(path) + http_method = http_method.to_sym.downcase + + header_params = @default_headers.merge(opts[:header_params] || {}) + query_params = opts[:query_params] || {} + form_params = opts[:form_params] || {} + + {{#hasAuthMethods}} + update_params_for_auth! header_params, query_params, opts[:auth_names] + {{/hasAuthMethods}} + + # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false) + _verify_ssl_host = @config.verify_ssl_host ? 2 : 0 + + req_opts = { + :method => http_method, + :headers => header_params, + :params => query_params, + :params_encoding => @config.params_encoding, + :timeout => @config.timeout, + :ssl_verifypeer => @config.verify_ssl, + :ssl_verifyhost => _verify_ssl_host, + :sslcert => @config.cert_file, + :sslkey => @config.key_file, + :verbose => @config.debugging + } + + # set custom cert, if provided + req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert + + if [:post, :patch, :put, :delete].include?(http_method) + req_body = build_request_body(header_params, form_params, opts[:body]) + req_opts.update :body => req_body + if @config.debugging + @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" + end + end + + request = Typhoeus::Request.new(url, req_opts) + download_file(request) if opts[:return_type] == 'File' + request + end + + # Builds the HTTP request body + # + # @param [Hash] header_params Header parameters + # @param [Hash] form_params Query parameters + # @param [Object] body HTTP body (JSON/XML) + # @return [String] HTTP body data in the form of string + def build_request_body(header_params, form_params, body) + # http form + if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || + header_params['Content-Type'] == 'multipart/form-data' + data = {} + form_params.each do |key, value| + case value + when ::File, ::Array, nil + # let typhoeus handle File, Array and nil parameters + data[key] = value + else + data[key] = value.to_s + end + end + elsif body + data = body.is_a?(String) ? body : body.to_json + else + data = nil + end + data + end diff --git a/modules/openapi-generator/src/main/resources/ruby-client/faraday_api_client.mustache b/modules/openapi-generator/src/main/resources/ruby-client/faraday_api_client.mustache deleted file mode 100644 index 14509b18a00..00000000000 --- a/modules/openapi-generator/src/main/resources/ruby-client/faraday_api_client.mustache +++ /dev/null @@ -1,394 +0,0 @@ -=begin -{{> api_info}} -=end - -require 'date' -require 'faraday' -require 'json' -require 'logger' -require 'tempfile' - -module {{moduleName}} - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/#{VERSION}/ruby{{/httpUserAgent}}" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - ssl_options = { - :ca_file => @config.ssl_ca_file, - :verify => @config.ssl_verify, - :verify => @config.ssl_verify_mode, - :client_cert => @config.ssl_client_cert, - :client_key => @config.ssl_client_key - } - - connection = Faraday.new(:url => config.base_url, :ssl => ssl_options) do |conn| - conn.basic_auth(config.username, config.password) - if opts[:header_params]["Content-Type"] == "multipart/form-data" - conn.request :multipart - conn.request :url_encoded - end - conn.adapter(Faraday.default_adapter) - end - - begin - response = connection.public_send(http_method.to_sym.downcase) do |req| - build_request(http_method, path, req, opts) - end - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.status == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.status, - :response_headers => response.headers, - :response_body => response.body), - response.reason_phrase - end - end - rescue Faraday::TimeoutError - fail ApiError.new('Connection timed out') - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.status, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, request, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - update_params_for_auth! header_params, query_params, opts[:auth_names] - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :verbose => @config.debugging - } - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - request.headers = header_params - request.body = req_body - request.url url - request.params = query_params - download_file(request) if opts[:return_type] == 'File' - request - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - {{moduleName}}.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - tempfile.close if tempfile - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' - data = URI.encode_www_form(form_params) - elsif header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Tempfile - # TODO hardcode to application/octet-stream, need better way to detect content type - data[key] = Faraday::UploadIO.new(value.path, 'application/octet-stream', value.path) - when ::Array, nil - # let Faraday handle Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_client.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_client.rb index dba9af066bb..1b41a5a2c45 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_client.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_client.rb @@ -11,10 +11,10 @@ OpenAPI Generator version: 4.1.0-SNAPSHOT =end require 'date' -require 'faraday' require 'json' require 'logger' require 'tempfile' +require 'faraday' module Petstore class ApiClient @@ -139,6 +139,38 @@ module Petstore request end + # Builds the HTTP request body + # + # @param [Hash] header_params Header parameters + # @param [Hash] form_params Query parameters + # @param [Object] body HTTP body (JSON/XML) + # @return [String] HTTP body data in the form of string + def build_request_body(header_params, form_params, body) + # http form + if header_params['Content-Type'] == 'application/x-www-form-urlencoded' + data = URI.encode_www_form(form_params) + elsif header_params['Content-Type'] == 'multipart/form-data' + data = {} + form_params.each do |key, value| + case value + when ::File, ::Tempfile + # TODO hardcode to application/octet-stream, need better way to detect content type + data[key] = Faraday::UploadIO.new(value.path, 'application/octet-stream', value.path) + when ::Array, nil + # let Faraday handle Array and nil parameters + data[key] = value + else + data[key] = value.to_s + end + end + elsif body + data = body.is_a?(String) ? body : body.to_json + else + data = nil + end + data + end + # Check if the given MIME is a JSON MIME. # JSON MIME examples: # application/json @@ -276,38 +308,6 @@ module Petstore @config.base_url + path end - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' - data = URI.encode_www_form(form_params) - elsif header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Tempfile - # TODO hardcode to application/octet-stream, need better way to detect content type - data[key] = Faraday::UploadIO.new(value.path, 'application/octet-stream', value.path) - when ::Array, nil - # let Faraday handle Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - # Update hearder and query params based on authentication settings. # # @param [Hash] header_params Header parameters diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api_client.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api_client.rb index 4fabf29ba2c..829c7e3c5bf 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api_client.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api_client.rb @@ -127,6 +127,34 @@ module Petstore request end + # Builds the HTTP request body + # + # @param [Hash] header_params Header parameters + # @param [Hash] form_params Query parameters + # @param [Object] body HTTP body (JSON/XML) + # @return [String] HTTP body data in the form of string + def build_request_body(header_params, form_params, body) + # http form + if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || + header_params['Content-Type'] == 'multipart/form-data' + data = {} + form_params.each do |key, value| + case value + when ::File, ::Array, nil + # let typhoeus handle File, Array and nil parameters + data[key] = value + else + data[key] = value.to_s + end + end + elsif body + data = body.is_a?(String) ? body : body.to_json + else + data = nil + end + data + end + # Check if the given MIME is a JSON MIME. # JSON MIME examples: # application/json @@ -264,34 +292,6 @@ module Petstore @config.base_url + path end - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - # Update hearder and query params based on authentication settings. # # @param [Hash] header_params Header parameters From b28ef781458c5914d162d51fec658e3f167fc242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20C=C3=B4t=C3=A9?= Date: Thu, 8 Aug 2019 08:48:45 -0400 Subject: [PATCH 61/75] typescript-fetch: allow configuration of headers and credentials (#3586) * Fix #3402 by giving the possibility to set additional headers and the credentials parameters to the fetch query. * Fix #3402 : Changes from code review --- .../resources/typescript-fetch/runtime.mustache | 15 ++++++++++++++- .../builds/default/src/runtime.ts | 15 ++++++++++++++- .../builds/es6-target/src/runtime.ts | 15 ++++++++++++++- .../builds/multiple-parameters/src/runtime.ts | 15 ++++++++++++++- .../builds/with-interfaces/src/runtime.ts | 15 ++++++++++++++- .../builds/with-npm-version/src/runtime.ts | 15 ++++++++++++++- 6 files changed, 84 insertions(+), 6 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache index 0f80666ff9a..942f65369c8 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache @@ -52,10 +52,13 @@ export class BaseAPI { const body = (context.body instanceof FormData || isBlob(context.body)) ? context.body : JSON.stringify(context.body); + + const headers = Object.assign({}, this.configuration.headers, context.headers); const init = { method: context.method, - headers: context.headers, + headers: headers, body, + credentials: this.configuration.credentials }; return { url, init }; } @@ -121,6 +124,8 @@ export interface ConfigurationParameters { password?: string; // parameter for basic security apiKey?: string | ((name: string) => string); // parameter for apiKey security accessToken?: string | ((name?: string, scopes?: string[]) => string); // parameter for oauth2 security + headers?: HTTPHeaders; //header params we want to use on every request + credentials?: RequestCredentials; //value for the credentials param we want to use on each request } export class Configuration { @@ -165,6 +170,14 @@ export class Configuration { } return undefined; } + + get headers(): HTTPHeaders { + return this.configuration.headers; + } + + get credentials(): RequestCredentials { + return this.configuration.credentials; + } } export type Json = any; diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/default/src/runtime.ts index 6feeddff5d4..48e54ca6eb2 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/src/runtime.ts @@ -63,10 +63,13 @@ export class BaseAPI { const body = (context.body instanceof FormData || isBlob(context.body)) ? context.body : JSON.stringify(context.body); + + const headers = Object.assign({}, this.configuration.headers, context.headers); const init = { method: context.method, - headers: context.headers, + headers: headers, body, + credentials: this.configuration.credentials }; return { url, init }; } @@ -132,6 +135,8 @@ export interface ConfigurationParameters { password?: string; // parameter for basic security apiKey?: string | ((name: string) => string); // parameter for apiKey security accessToken?: string | ((name?: string, scopes?: string[]) => string); // parameter for oauth2 security + headers?: HTTPHeaders; //header params we want to use on every request + credentials?: RequestCredentials; //value for the credentials param we want to use on each request } export class Configuration { @@ -176,6 +181,14 @@ export class Configuration { } return undefined; } + + get headers(): HTTPHeaders { + return this.configuration.headers; + } + + get credentials(): RequestCredentials { + return this.configuration.credentials; + } } export type Json = any; diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts index 6feeddff5d4..48e54ca6eb2 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts @@ -63,10 +63,13 @@ export class BaseAPI { const body = (context.body instanceof FormData || isBlob(context.body)) ? context.body : JSON.stringify(context.body); + + const headers = Object.assign({}, this.configuration.headers, context.headers); const init = { method: context.method, - headers: context.headers, + headers: headers, body, + credentials: this.configuration.credentials }; return { url, init }; } @@ -132,6 +135,8 @@ export interface ConfigurationParameters { password?: string; // parameter for basic security apiKey?: string | ((name: string) => string); // parameter for apiKey security accessToken?: string | ((name?: string, scopes?: string[]) => string); // parameter for oauth2 security + headers?: HTTPHeaders; //header params we want to use on every request + credentials?: RequestCredentials; //value for the credentials param we want to use on each request } export class Configuration { @@ -176,6 +181,14 @@ export class Configuration { } return undefined; } + + get headers(): HTTPHeaders { + return this.configuration.headers; + } + + get credentials(): RequestCredentials { + return this.configuration.credentials; + } } export type Json = any; diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/runtime.ts index 6feeddff5d4..48e54ca6eb2 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/runtime.ts @@ -63,10 +63,13 @@ export class BaseAPI { const body = (context.body instanceof FormData || isBlob(context.body)) ? context.body : JSON.stringify(context.body); + + const headers = Object.assign({}, this.configuration.headers, context.headers); const init = { method: context.method, - headers: context.headers, + headers: headers, body, + credentials: this.configuration.credentials }; return { url, init }; } @@ -132,6 +135,8 @@ export interface ConfigurationParameters { password?: string; // parameter for basic security apiKey?: string | ((name: string) => string); // parameter for apiKey security accessToken?: string | ((name?: string, scopes?: string[]) => string); // parameter for oauth2 security + headers?: HTTPHeaders; //header params we want to use on every request + credentials?: RequestCredentials; //value for the credentials param we want to use on each request } export class Configuration { @@ -176,6 +181,14 @@ export class Configuration { } return undefined; } + + get headers(): HTTPHeaders { + return this.configuration.headers; + } + + get credentials(): RequestCredentials { + return this.configuration.credentials; + } } export type Json = any; diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/runtime.ts index 6feeddff5d4..48e54ca6eb2 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/runtime.ts @@ -63,10 +63,13 @@ export class BaseAPI { const body = (context.body instanceof FormData || isBlob(context.body)) ? context.body : JSON.stringify(context.body); + + const headers = Object.assign({}, this.configuration.headers, context.headers); const init = { method: context.method, - headers: context.headers, + headers: headers, body, + credentials: this.configuration.credentials }; return { url, init }; } @@ -132,6 +135,8 @@ export interface ConfigurationParameters { password?: string; // parameter for basic security apiKey?: string | ((name: string) => string); // parameter for apiKey security accessToken?: string | ((name?: string, scopes?: string[]) => string); // parameter for oauth2 security + headers?: HTTPHeaders; //header params we want to use on every request + credentials?: RequestCredentials; //value for the credentials param we want to use on each request } export class Configuration { @@ -176,6 +181,14 @@ export class Configuration { } return undefined; } + + get headers(): HTTPHeaders { + return this.configuration.headers; + } + + get credentials(): RequestCredentials { + return this.configuration.credentials; + } } export type Json = any; diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts index 6feeddff5d4..48e54ca6eb2 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts @@ -63,10 +63,13 @@ export class BaseAPI { const body = (context.body instanceof FormData || isBlob(context.body)) ? context.body : JSON.stringify(context.body); + + const headers = Object.assign({}, this.configuration.headers, context.headers); const init = { method: context.method, - headers: context.headers, + headers: headers, body, + credentials: this.configuration.credentials }; return { url, init }; } @@ -132,6 +135,8 @@ export interface ConfigurationParameters { password?: string; // parameter for basic security apiKey?: string | ((name: string) => string); // parameter for apiKey security accessToken?: string | ((name?: string, scopes?: string[]) => string); // parameter for oauth2 security + headers?: HTTPHeaders; //header params we want to use on every request + credentials?: RequestCredentials; //value for the credentials param we want to use on each request } export class Configuration { @@ -176,6 +181,14 @@ export class Configuration { } return undefined; } + + get headers(): HTTPHeaders { + return this.configuration.headers; + } + + get credentials(): RequestCredentials { + return this.configuration.credentials; + } } export type Json = any; From 1152af4d02dfa196801de0f3ba83bb16536d8f73 Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Thu, 8 Aug 2019 17:59:50 +0200 Subject: [PATCH 62/75] Run Qt5 client sample test (#3415) --- .travis.yml | 6 +++ pom.xml | 1 + samples/client/petstore/cpp-qt5/.gitignore | 1 + .../petstore/cpp-qt5/build-and-test.bash | 12 ++++++ samples/client/petstore/cpp-qt5/pom.xml | 43 +++++++++++++++++++ 5 files changed, 63 insertions(+) create mode 100644 samples/client/petstore/cpp-qt5/.gitignore create mode 100755 samples/client/petstore/cpp-qt5/build-and-test.bash create mode 100644 samples/client/petstore/cpp-qt5/pom.xml diff --git a/.travis.yml b/.travis.yml index f47f448b874..b4bd3d852f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -94,6 +94,12 @@ before_install: # - Rely on `kerl` for [pre-compiled versions available](https://docs.travis-ci.com/user/languages/erlang#Choosing-OTP-releases-to-test-against). Rely on installation path chosen by [`travis-erlang-builder`](https://github.com/travis-ci/travis-erlang-builder/blob/e6d016b1a91ca7ecac5a5a46395bde917ea13d36/bin/compile#L18). # - . ~/otp/18.2.1/activate && erl -version #- curl -f -L -o ./rebar3 https://s3.amazonaws.com/rebar3/rebar3 && chmod +x ./rebar3 && ./rebar3 version && export PATH="${TRAVIS_BUILD_DIR}:$PATH" + # install Qt 5.10 + - sudo add-apt-repository --yes ppa:beineri/opt-qt-5.10.1-trusty + - sudo apt-get update -qq + - sudo apt-get install qt510-meta-minimal + - source /opt/qt510/bin/qt510-env.sh + - qmake -v # show host table to confirm petstore.swagger.io is mapped to localhost - cat /etc/hosts diff --git a/pom.xml b/pom.xml index 1a3522d83f6..cf950e43c45 100644 --- a/pom.xml +++ b/pom.xml @@ -1024,6 +1024,7 @@ samples/client/petstore/c + samples/client/petstore/cpp-qt5 diff --git a/samples/client/petstore/cpp-qt5/.gitignore b/samples/client/petstore/cpp-qt5/.gitignore new file mode 100644 index 00000000000..378eac25d31 --- /dev/null +++ b/samples/client/petstore/cpp-qt5/.gitignore @@ -0,0 +1 @@ +build diff --git a/samples/client/petstore/cpp-qt5/build-and-test.bash b/samples/client/petstore/cpp-qt5/build-and-test.bash new file mode 100755 index 00000000000..58f703433dd --- /dev/null +++ b/samples/client/petstore/cpp-qt5/build-and-test.bash @@ -0,0 +1,12 @@ +#!/bin/bash + +set -e + +mkdir build +cd build +# project +qmake ../PetStore/PetStore.pro + +make + +./PetStore diff --git a/samples/client/petstore/cpp-qt5/pom.xml b/samples/client/petstore/cpp-qt5/pom.xml new file mode 100644 index 00000000000..70cf260fde7 --- /dev/null +++ b/samples/client/petstore/cpp-qt5/pom.xml @@ -0,0 +1,43 @@ + + 4.0.0 + org.openapitools + CppQt5PetstoreClientTests + pom + 1.0-SNAPSHOT + Qt5 OpenAPI Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + pet-test + integration-test + + exec + + + ./build-and-test.bash + + + + + + + From 4b0fc3013f60623c9f8980bc8db594105010588f Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Thu, 8 Aug 2019 18:15:45 +0200 Subject: [PATCH 63/75] [dart2] Fix up test code generation, double deserialization, 'new' keyword deprecation (#3576) * dart2: Use the correct classname in test generation At present test generation has a stray hard-coded reference to the pet store Pet() class, which should reflect the actual classname under test. * dart2: Call toDouble() in generated code for double types At present the generated code does not correctly handle transitioning to double when dealing with non-integer types in JSON deserialization. This ends up with dart raising an unhandled type mismatch exception: Unhandled exception: type 'int' is not a subtype of type 'double' where ... Using the .toDouble() conversion when a double type is expected fixes this up by making the typing explicit. * dart2: Drop use of deprecated 'new' keyword in generated code The use of the 'new' keyword in dart2 is deprecated and should be avoided, as per the official guidance of the dart2 authors: https://dart.dev/guides/language/effective-dart/usage#dont-use-new * dart2: Regenerate samples for mustache template changes --- .../src/main/resources/dart2/README.mustache | 4 +- .../src/main/resources/dart2/api.mustache | 8 +- .../src/main/resources/dart2/api_doc.mustache | 4 +- .../main/resources/dart2/api_test.mustache | 2 +- .../src/main/resources/dart2/class.mustache | 13 +- .../main/resources/dart2/model_test.mustache | 2 +- .../openapi/.openapi-generator/VERSION | 2 +- .../dart/flutter_petstore/openapi/.travis.yml | 2 +- .../dart/flutter_petstore/openapi/README.md | 16 ++- .../openapi/docs/InlineObject.md | 16 +++ .../openapi/docs/InlineObject1.md | 16 +++ .../flutter_petstore/openapi/docs/PetApi.md | 56 +++++---- .../flutter_petstore/openapi/docs/StoreApi.md | 22 ++-- .../flutter_petstore/openapi/docs/UserApi.md | 92 +++++++++----- .../flutter_petstore/openapi/lib/api.dart | 4 +- .../openapi/lib/api/pet_api.dart | 93 +++++++------- .../openapi/lib/api/store_api.dart | 46 +++---- .../openapi/lib/api/user_api.dart | 118 +++++++++--------- .../openapi/lib/api_client.dart | 59 ++++----- .../openapi/lib/api_exception.dart | 8 +- .../openapi/lib/api_helper.dart | 6 +- .../openapi/lib/auth/api_key_auth.dart | 10 +- .../openapi/lib/auth/http_basic_auth.dart | 12 +- .../openapi/lib/auth/oauth.dart | 13 +- .../openapi/lib/model/api_response.dart | 29 +++-- .../openapi/lib/model/category.dart | 24 ++-- .../openapi/lib/model/inline_object.dart | 50 ++++++++ .../openapi/lib/model/inline_object1.dart | 50 ++++++++ .../openapi/lib/model/order.dart | 42 ++++--- .../openapi/lib/model/pet.dart | 42 ++++--- .../openapi/lib/model/tag.dart | 24 ++-- .../openapi/lib/model/user.dart | 54 ++++---- .../flutter_petstore/openapi/pubspec.yaml | 2 + .../openapi/test/api_response_test.dart | 2 +- .../openapi/test/category_test.dart | 2 +- .../openapi/test/inline_object1_test.dart | 24 ++++ .../openapi/test/inline_object_test.dart | 24 ++++ .../openapi/test/order_test.dart | 2 +- .../openapi/test/pet_api_test.dart | 8 +- .../openapi/test/pet_test.dart | 2 +- .../openapi/test/store_api_test.dart | 4 +- .../openapi/test/tag_test.dart | 2 +- .../openapi/test/user_api_test.dart | 10 +- .../openapi/test/user_test.dart | 2 +- .../openapi/.openapi-generator/VERSION | 2 +- .../dart2/flutter_petstore/openapi/README.md | 4 +- .../flutter_petstore/openapi/docs/PetApi.md | 20 +-- .../flutter_petstore/openapi/docs/StoreApi.md | 10 +- .../flutter_petstore/openapi/docs/UserApi.md | 28 ++--- .../openapi/lib/api/pet_api.dart | 48 +++---- .../openapi/lib/api/store_api.dart | 24 ++-- .../openapi/lib/api/user_api.dart | 50 ++++---- .../openapi/lib/model/api_response.dart | 6 +- .../openapi/lib/model/category.dart | 6 +- .../openapi/lib/model/order.dart | 6 +- .../openapi/lib/model/pet.dart | 8 +- .../openapi/lib/model/tag.dart | 6 +- .../openapi/lib/model/user.dart | 6 +- .../openapi/test/api_response_test.dart | 2 +- .../openapi/test/category_test.dart | 2 +- .../openapi/test/order_test.dart | 2 +- .../openapi/test/pet_api_test.dart | 2 +- .../openapi/test/pet_test.dart | 2 +- .../openapi/test/store_api_test.dart | 2 +- .../openapi/test/tag_test.dart | 2 +- .../openapi/test/user_api_test.dart | 2 +- .../openapi/test/user_test.dart | 2 +- .../.openapi-generator/VERSION | 2 +- .../dart2/openapi-browser-client/README.md | 4 +- .../openapi-browser-client/docs/PetApi.md | 20 +-- .../openapi-browser-client/docs/StoreApi.md | 10 +- .../openapi-browser-client/docs/UserApi.md | 28 ++--- .../lib/api/pet_api.dart | 48 +++---- .../lib/api/store_api.dart | 24 ++-- .../lib/api/user_api.dart | 50 ++++---- .../lib/model/api_response.dart | 6 +- .../lib/model/category.dart | 6 +- .../lib/model/order.dart | 6 +- .../openapi-browser-client/lib/model/pet.dart | 8 +- .../openapi-browser-client/lib/model/tag.dart | 6 +- .../lib/model/user.dart | 6 +- .../test/api_response_test.dart | 2 +- .../test/category_test.dart | 2 +- .../test/order_test.dart | 2 +- .../test/pet_api_test.dart | 2 +- .../openapi-browser-client/test/pet_test.dart | 2 +- .../test/store_api_test.dart | 2 +- .../openapi-browser-client/test/tag_test.dart | 2 +- .../test/user_api_test.dart | 2 +- .../test/user_test.dart | 2 +- .../dart2/openapi/.openapi-generator/VERSION | 2 +- .../client/petstore/dart2/openapi/README.md | 4 +- .../petstore/dart2/openapi/docs/PetApi.md | 20 +-- .../petstore/dart2/openapi/docs/StoreApi.md | 10 +- .../petstore/dart2/openapi/docs/UserApi.md | 28 ++--- .../dart2/openapi/lib/api/pet_api.dart | 48 +++---- .../dart2/openapi/lib/api/store_api.dart | 24 ++-- .../dart2/openapi/lib/api/user_api.dart | 50 ++++---- .../dart2/openapi/lib/model/api_response.dart | 6 +- .../dart2/openapi/lib/model/category.dart | 6 +- .../dart2/openapi/lib/model/order.dart | 6 +- .../petstore/dart2/openapi/lib/model/pet.dart | 8 +- .../petstore/dart2/openapi/lib/model/tag.dart | 6 +- .../dart2/openapi/lib/model/user.dart | 6 +- .../dart2/openapi/test/api_response_test.dart | 2 +- .../dart2/openapi/test/category_test.dart | 2 +- .../dart2/openapi/test/order_test.dart | 2 +- .../dart2/openapi/test/pet_api_test.dart | 2 +- .../petstore/dart2/openapi/test/pet_test.dart | 2 +- .../dart2/openapi/test/store_api_test.dart | 2 +- .../petstore/dart2/openapi/test/tag_test.dart | 2 +- .../dart2/openapi/test/user_api_test.dart | 2 +- .../dart2/openapi/test/user_test.dart | 2 +- 113 files changed, 1003 insertions(+), 746 deletions(-) create mode 100644 samples/client/petstore/dart/flutter_petstore/openapi/docs/InlineObject.md create mode 100644 samples/client/petstore/dart/flutter_petstore/openapi/docs/InlineObject1.md create mode 100644 samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object.dart create mode 100644 samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object1.dart create mode 100644 samples/client/petstore/dart/flutter_petstore/openapi/test/inline_object1_test.dart create mode 100644 samples/client/petstore/dart/flutter_petstore/openapi/test/inline_object_test.dart diff --git a/modules/openapi-generator/src/main/resources/dart2/README.mustache b/modules/openapi-generator/src/main/resources/dart2/README.mustache index 83c7a21222c..eab8ee0ea7a 100644 --- a/modules/openapi-generator/src/main/resources/dart2/README.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/README.mustache @@ -74,9 +74,9 @@ import 'package:{{pubName}}/api.dart'; {{/authMethods}} {{/hasAuthMethods}} -var api_instance = new {{classname}}(); +var api_instance = {{classname}}(); {{#allParams}} -var {{paramName}} = {{#isListContainer}}[{{/isListContainer}}{{#isBodyParam}}new {{dataType}}(){{/isBodyParam}}{{^isBodyParam}}{{{example}}}{{/isBodyParam}}{{#isListContainer}}]{{/isListContainer}}; // {{{dataType}}} | {{{description}}} +var {{paramName}} = {{#isListContainer}}[{{/isListContainer}}{{#isBodyParam}}{{dataType}}(){{/isBodyParam}}{{^isBodyParam}}{{{example}}}{{/isBodyParam}}{{#isListContainer}}]{{/isListContainer}}; // {{{dataType}}} | {{{description}}} {{/allParams}} try { diff --git a/modules/openapi-generator/src/main/resources/dart2/api.mustache b/modules/openapi-generator/src/main/resources/dart2/api.mustache index 394ae1073a0..9ecac421b67 100644 --- a/modules/openapi-generator/src/main/resources/dart2/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/api.mustache @@ -19,7 +19,7 @@ class {{classname}} { {{#allParams}} {{#required}} if({{paramName}} == null) { - throw new ApiException(400, "Missing required param: {{paramName}}"); + throw ApiException(400, "Missing required param: {{paramName}}"); } {{/required}} {{/allParams}} @@ -51,7 +51,7 @@ class {{classname}} { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); {{#formParams}} {{^isFile}} if ({{paramName}} != null) { @@ -89,7 +89,7 @@ class {{classname}} { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { {{#isListContainer}} {{#returnType}} @@ -99,7 +99,7 @@ class {{classname}} { {{^isListContainer}} {{#isMapContainer}} {{#returnType}} - return new {{{returnType}}}.from(apiClient.deserialize(_decodeBodyBytes(response), '{{{returnType}}}')); + return {{{returnType}}}.from(apiClient.deserialize(_decodeBodyBytes(response), '{{{returnType}}}')); {{/returnType}}; {{/isMapContainer}} {{^isMapContainer}} diff --git a/modules/openapi-generator/src/main/resources/dart2/api_doc.mustache b/modules/openapi-generator/src/main/resources/dart2/api_doc.mustache index 773ee0d562e..7ef24590d16 100644 --- a/modules/openapi-generator/src/main/resources/dart2/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/api_doc.mustache @@ -45,9 +45,9 @@ import 'package:{{pubName}}/api.dart'; {{/authMethods}} {{/hasAuthMethods}} -var api_instance = new {{classname}}(); +var api_instance = {{classname}}(); {{#allParams}} -var {{paramName}} = {{#isListContainer}}[{{/isListContainer}}{{#isBodyParam}}new {{dataType}}(){{/isBodyParam}}{{^isBodyParam}}{{{example}}}{{/isBodyParam}}{{#isListContainer}}]{{/isListContainer}}; // {{{dataType}}} | {{{description}}} +var {{paramName}} = {{#isListContainer}}[{{/isListContainer}}{{#isBodyParam}}{{dataType}}(){{/isBodyParam}}{{^isBodyParam}}{{{example}}}{{/isBodyParam}}{{#isListContainer}}]{{/isListContainer}}; // {{{dataType}}} | {{{description}}} {{/allParams}} try { diff --git a/modules/openapi-generator/src/main/resources/dart2/api_test.mustache b/modules/openapi-generator/src/main/resources/dart2/api_test.mustache index 951aaf86d85..07459b09938 100644 --- a/modules/openapi-generator/src/main/resources/dart2/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/api_test.mustache @@ -5,7 +5,7 @@ import 'package:test/test.dart'; /// tests for {{classname}} void main() { - var instance = new {{classname}}(); + var instance = {{classname}}(); group('tests for {{classname}}', () { {{#operation}} diff --git a/modules/openapi-generator/src/main/resources/dart2/class.mustache b/modules/openapi-generator/src/main/resources/dart2/class.mustache index 5c2c2e8d8cf..9f9af4e51a7 100644 --- a/modules/openapi-generator/src/main/resources/dart2/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/class.mustache @@ -36,7 +36,7 @@ class {{classname}} { {{name}} = {{complexType}}.mapFromJson(json['{{baseName}}']); {{/isMapContainer}} {{^isMapContainer}} - {{name}} = new {{complexType}}.fromJson(json['{{baseName}}']); + {{name}} = {{complexType}}.fromJson(json['{{baseName}}']); {{/isMapContainer}} {{/isListContainer}} {{/complexType}} @@ -49,7 +49,12 @@ class {{classname}} { {{name}} = (json['{{baseName}}'] as Map).cast(); {{/isMapContainer}} {{^isMapContainer}} + {{#isDouble}} + {{name}} = json['{{baseName}}'].toDouble(); + {{/isDouble}} + {{^isDouble}} {{name}} = json['{{baseName}}']; + {{/isDouble}} {{/isMapContainer}} {{/isListContainer}} {{/complexType}} @@ -81,13 +86,13 @@ class {{classname}} { } static List<{{classname}}> listFromJson(List json) { - return json == null ? new List<{{classname}}>() : json.map((value) => new {{classname}}.fromJson(value)).toList(); + return json == null ? List<{{classname}}>() : json.map((value) => {{classname}}.fromJson(value)).toList(); } static Map mapFromJson(Map json) { - var map = new Map(); + var map = Map(); if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new {{classname}}.fromJson(value)); + json.forEach((String key, dynamic value) => map[key] = {{classname}}.fromJson(value)); } return map; } diff --git a/modules/openapi-generator/src/main/resources/dart2/model_test.mustache b/modules/openapi-generator/src/main/resources/dart2/model_test.mustache index 89300fed75d..49f403ef695 100644 --- a/modules/openapi-generator/src/main/resources/dart2/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/model_test.mustache @@ -5,7 +5,7 @@ import 'package:test/test.dart'; // tests for {{classname}} void main() { - var instance = new Pet(); + var instance = {{classname}}(); group('test {{classname}}', () { {{#vars}} diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/VERSION index 06b5019af3f..83a328a9227 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml b/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml index 82b19541fa4..d0758bc9f0d 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml +++ b/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml @@ -3,7 +3,7 @@ language: dart dart: # Install a specific stable release -- "1.24.3" +- "2.2.0" install: - pub get diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/README.md b/samples/client/petstore/dart/flutter_petstore/openapi/README.md index 8520a219f88..ae7f6ea5e87 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/README.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/README.md @@ -44,13 +44,13 @@ Please follow the [installation procedure](#installation--usage) and then run th import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = PetApi(); +var pet = Pet(); // Pet | Pet object that needs to be added to the store try { - api_instance.addPet(body); + api_instance.addPet(pet); } catch (e) { print("Exception when calling PetApi->addPet: $e\n"); } @@ -89,6 +89,8 @@ Class | Method | HTTP request | Description - [ApiResponse](docs//ApiResponse.md) - [Category](docs//Category.md) + - [InlineObject](docs//InlineObject.md) + - [InlineObject1](docs//InlineObject1.md) - [Order](docs//Order.md) - [Pet](docs//Pet.md) - [Tag](docs//Tag.md) @@ -104,6 +106,12 @@ Class | Method | HTTP request | Description - **API key parameter name**: api_key - **Location**: HTTP header +## auth_cookie + +- **Type**: API key +- **API key parameter name**: AUTH_KEY +- **Location**: + ## petstore_auth - **Type**: OAuth diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/docs/InlineObject.md b/samples/client/petstore/dart/flutter_petstore/openapi/docs/InlineObject.md new file mode 100644 index 00000000000..1789b30bb81 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/docs/InlineObject.md @@ -0,0 +1,16 @@ +# openapi.model.InlineObject + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Updated name of the pet | [optional] [default to null] +**status** | **String** | Updated status of the pet | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/docs/InlineObject1.md b/samples/client/petstore/dart/flutter_petstore/openapi/docs/InlineObject1.md new file mode 100644 index 00000000000..a5c2c120129 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/docs/InlineObject1.md @@ -0,0 +1,16 @@ +# openapi.model.InlineObject1 + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **String** | Additional data to pass to server | [optional] [default to null] +**file** | [**MultipartFile**](File.md) | file to upload | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/docs/PetApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/docs/PetApi.md index 5780e7f3802..2d01917ec27 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/docs/PetApi.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/docs/PetApi.md @@ -20,7 +20,7 @@ Method | HTTP request | Description # **addPet** -> addPet(body) +> addPet(pet) Add a new pet to the store @@ -28,13 +28,13 @@ Add a new pet to the store ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = PetApi(); +var pet = Pet(); // Pet | Pet object that needs to be added to the store try { - api_instance.addPet(body); + api_instance.addPet(pet); } catch (e) { print("Exception when calling PetApi->addPet: $e\n"); } @@ -44,7 +44,7 @@ try { 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 @@ -70,9 +70,9 @@ Deletes a pet ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var petId = 789; // int | Pet id to delete var apiKey = apiKey_example; // String | @@ -116,9 +116,9 @@ Multiple status values can be provided with comma separated strings ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var status = []; // List | Status values that need to be considered for filter try { @@ -151,7 +151,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **findPetsByTags** -> List findPetsByTags(tags) +> List findPetsByTags(tags, maxCount) Finds Pets by tags @@ -161,13 +161,14 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var tags = []; // List | Tags to filter by +var maxCount = 56; // int | Maximum number of items to return try { - var result = api_instance.findPetsByTags(tags); + var result = api_instance.findPetsByTags(tags, maxCount); print(result); } catch (e) { print("Exception when calling PetApi->findPetsByTags: $e\n"); @@ -179,6 +180,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<String>**](String.md)| Tags to filter by | [default to []] + **maxCount** | **int**| Maximum number of items to return | [optional] [default to null] ### Return type @@ -206,11 +208,11 @@ Returns a single pet ```dart import 'package:openapi/api.dart'; // TODO Configure API key authorization: api_key -//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; +//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var petId = 789; // int | ID of pet to return try { @@ -243,7 +245,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **updatePet** -> updatePet(body) +> updatePet(pet) Update an existing pet @@ -251,13 +253,13 @@ Update an existing pet ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = PetApi(); +var pet = Pet(); // Pet | Pet object that needs to be added to the store try { - api_instance.updatePet(body); + api_instance.updatePet(pet); } catch (e) { print("Exception when calling PetApi->updatePet: $e\n"); } @@ -267,7 +269,7 @@ try { 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 @@ -293,9 +295,9 @@ Updates a pet in the store with form data ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var petId = 789; // int | ID of pet that needs to be updated var name = name_example; // String | Updated name of the pet var status = status_example; // String | Updated status of the pet @@ -339,9 +341,9 @@ uploads an image ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var petId = 789; // int | ID of pet to update var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server var file = BINARY_DATA_HERE; // MultipartFile | file to upload diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/docs/StoreApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/docs/StoreApi.md index df76647f11a..4a501766d3c 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/docs/StoreApi.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/docs/StoreApi.md @@ -26,7 +26,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ```dart import 'package:openapi/api.dart'; -var api_instance = new StoreApi(); +var api_instance = StoreApi(); var orderId = orderId_example; // String | ID of the order that needs to be deleted try { @@ -68,11 +68,11 @@ Returns a map of status codes to quantities ```dart import 'package:openapi/api.dart'; // TODO Configure API key authorization: api_key -//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; +//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; -var api_instance = new StoreApi(); +var api_instance = StoreApi(); try { var result = api_instance.getInventory(); @@ -111,7 +111,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ```dart import 'package:openapi/api.dart'; -var api_instance = new StoreApi(); +var api_instance = StoreApi(); var orderId = 789; // int | ID of pet that needs to be fetched try { @@ -144,7 +144,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet @@ -152,11 +152,11 @@ Place an order for a pet ```dart import 'package:openapi/api.dart'; -var api_instance = new StoreApi(); -var body = new Order(); // Order | order placed for purchasing the pet +var api_instance = StoreApi(); +var order = Order(); // Order | order placed for purchasing the pet try { - var result = api_instance.placeOrder(body); + var result = api_instance.placeOrder(order); print(result); } catch (e) { print("Exception when calling StoreApi->placeOrder: $e\n"); @@ -167,7 +167,7 @@ try { 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 @@ -179,7 +179,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/docs/UserApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/docs/UserApi.md index 5e0605c6ea0..4a9e433e25f 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/docs/UserApi.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/docs/UserApi.md @@ -20,7 +20,7 @@ Method | HTTP request | Description # **createUser** -> createUser(body) +> createUser(user) Create user @@ -29,12 +29,16 @@ This can only be done by the logged in user. ### Example ```dart import 'package:openapi/api.dart'; +// TODO Configure API key authorization: auth_cookie +//defaultApiClient.getAuthentication('auth_cookie').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('auth_cookie').apiKeyPrefix = 'Bearer'; -var api_instance = new UserApi(); -var body = new User(); // User | Created user object +var api_instance = UserApi(); +var user = User(); // User | Created user object try { - api_instance.createUser(body); + api_instance.createUser(user); } catch (e) { print("Exception when calling UserApi->createUser: $e\n"); } @@ -44,7 +48,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -52,29 +56,33 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **createUsersWithArrayInput** -> createUsersWithArrayInput(body) +> createUsersWithArrayInput(user) Creates list of users with given input array ### Example ```dart import 'package:openapi/api.dart'; +// TODO Configure API key authorization: auth_cookie +//defaultApiClient.getAuthentication('auth_cookie').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('auth_cookie').apiKeyPrefix = 'Bearer'; -var api_instance = new UserApi(); -var body = [new List<User>()]; // List | List of user object +var api_instance = UserApi(); +var user = [List<User>()]; // List | List of user object try { - api_instance.createUsersWithArrayInput(body); + api_instance.createUsersWithArrayInput(user); } catch (e) { print("Exception when calling UserApi->createUsersWithArrayInput: $e\n"); } @@ -84,7 +92,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **user** | [**List<User>**](User.md)| List of user object | ### Return type @@ -92,29 +100,33 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **createUsersWithListInput** -> createUsersWithListInput(body) +> createUsersWithListInput(user) Creates list of users with given input array ### Example ```dart import 'package:openapi/api.dart'; +// TODO Configure API key authorization: auth_cookie +//defaultApiClient.getAuthentication('auth_cookie').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('auth_cookie').apiKeyPrefix = 'Bearer'; -var api_instance = new UserApi(); -var body = [new List<User>()]; // List | List of user object +var api_instance = UserApi(); +var user = [List<User>()]; // List | List of user object try { - api_instance.createUsersWithListInput(body); + api_instance.createUsersWithListInput(user); } catch (e) { print("Exception when calling UserApi->createUsersWithListInput: $e\n"); } @@ -124,7 +136,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **user** | [**List<User>**](User.md)| List of user object | ### Return type @@ -132,11 +144,11 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -151,8 +163,12 @@ This can only be done by the logged in user. ### Example ```dart import 'package:openapi/api.dart'; +// TODO Configure API key authorization: auth_cookie +//defaultApiClient.getAuthentication('auth_cookie').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('auth_cookie').apiKeyPrefix = 'Bearer'; -var api_instance = new UserApi(); +var api_instance = UserApi(); var username = username_example; // String | The name that needs to be deleted try { @@ -174,7 +190,7 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers @@ -192,7 +208,7 @@ Get user by user name ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); +var api_instance = UserApi(); var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. try { @@ -233,7 +249,7 @@ Logs user into the system ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); +var api_instance = UserApi(); var username = username_example; // String | The user name for login var password = password_example; // String | The password for login in clear text @@ -275,8 +291,12 @@ Logs out current logged in user session ### Example ```dart import 'package:openapi/api.dart'; +// TODO Configure API key authorization: auth_cookie +//defaultApiClient.getAuthentication('auth_cookie').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('auth_cookie').apiKeyPrefix = 'Bearer'; -var api_instance = new UserApi(); +var api_instance = UserApi(); try { api_instance.logoutUser(); @@ -294,7 +314,7 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers @@ -304,7 +324,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **updateUser** -> updateUser(username, body) +> updateUser(username, user) Updated user @@ -313,13 +333,17 @@ This can only be done by the logged in user. ### Example ```dart import 'package:openapi/api.dart'; +// TODO Configure API key authorization: auth_cookie +//defaultApiClient.getAuthentication('auth_cookie').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('auth_cookie').apiKeyPrefix = 'Bearer'; -var api_instance = new UserApi(); +var api_instance = UserApi(); var username = username_example; // String | name that need to be deleted -var body = new User(); // User | Updated user object +var user = User(); // User | Updated user object try { - api_instance.updateUser(username, body); + api_instance.updateUser(username, user); } catch (e) { print("Exception when calling UserApi->updateUser: $e\n"); } @@ -330,7 +354,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | [default to null] - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -338,11 +362,11 @@ void (empty response body) ### Authorization -No authorization required +[auth_cookie](../README.md#auth_cookie) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart index 9a64a5342b4..675ff37a46b 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart @@ -18,10 +18,12 @@ part 'api/user_api.dart'; part 'model/api_response.dart'; part 'model/category.dart'; +part 'model/inline_object.dart'; +part 'model/inline_object1.dart'; part 'model/order.dart'; part 'model/pet.dart'; part 'model/tag.dart'; part 'model/user.dart'; -ApiClient defaultApiClient = new ApiClient(); +ApiClient defaultApiClient = ApiClient(); diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart index 6ffc146490b..1210fa617a1 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart @@ -10,12 +10,12 @@ class PetApi { /// Add a new pet to the store /// /// - Future addPet(Pet body) async { - Object postBody = body; + Future addPet(Pet pet) async { + Object postBody = pet; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(pet == null) { + throw ApiException(400, "Missing required param: pet"); } // create path and map variables @@ -28,12 +28,12 @@ class PetApi { List contentTypes = ["application/json","application/xml"]; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -50,7 +50,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -60,11 +60,11 @@ class PetApi { /// /// Future deletePet(int petId, { String apiKey }) async { - Object postBody = null; + Object postBody; // verify required params are set if(petId == null) { - throw new ApiException(400, "Missing required param: petId"); + throw ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -78,12 +78,12 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -100,7 +100,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -110,11 +110,11 @@ class PetApi { /// /// Multiple status values can be provided with comma separated strings Future> findPetsByStatus(List status) async { - Object postBody = null; + Object postBody; // verify required params are set if(status == null) { - throw new ApiException(400, "Missing required param: status"); + throw ApiException(400, "Missing required param: status"); } // create path and map variables @@ -128,12 +128,12 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -150,7 +150,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List).map((item) => item as Pet).toList(); } else { @@ -160,12 +160,12 @@ class PetApi { /// Finds Pets by tags /// /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - Future> findPetsByTags(List tags) async { - Object postBody = null; + Future> findPetsByTags(List tags, { int maxCount }) async { + Object postBody; // verify required params are set if(tags == null) { - throw new ApiException(400, "Missing required param: tags"); + throw ApiException(400, "Missing required param: tags"); } // create path and map variables @@ -176,15 +176,18 @@ class PetApi { Map headerParams = {}; Map formParams = {}; queryParams.addAll(_convertParametersForCollectionFormat("csv", "tags", tags)); + if(maxCount != null) { + queryParams.addAll(_convertParametersForCollectionFormat("", "maxCount", maxCount)); + } List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -201,7 +204,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List).map((item) => item as Pet).toList(); } else { @@ -212,11 +215,11 @@ class PetApi { /// /// Returns a single pet Future getPetById(int petId) async { - Object postBody = null; + Object postBody; // verify required params are set if(petId == null) { - throw new ApiException(400, "Missing required param: petId"); + throw ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -229,12 +232,12 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["api_key"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -251,7 +254,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'Pet') as Pet; } else { @@ -261,12 +264,12 @@ class PetApi { /// Update an existing pet /// /// - Future updatePet(Pet body) async { - Object postBody = body; + Future updatePet(Pet pet) async { + Object postBody = pet; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(pet == null) { + throw ApiException(400, "Missing required param: pet"); } // create path and map variables @@ -279,12 +282,12 @@ class PetApi { List contentTypes = ["application/json","application/xml"]; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -301,7 +304,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -311,11 +314,11 @@ class PetApi { /// /// Future updatePetWithForm(int petId, { String name, String status }) async { - Object postBody = null; + Object postBody; // verify required params are set if(petId == null) { - throw new ApiException(400, "Missing required param: petId"); + throw ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -328,12 +331,12 @@ class PetApi { List contentTypes = ["application/x-www-form-urlencoded"]; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if (name != null) { hasFields = true; mp.fields['name'] = parameterToString(name); @@ -362,7 +365,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -372,11 +375,11 @@ class PetApi { /// /// Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async { - Object postBody = null; + Object postBody; // verify required params are set if(petId == null) { - throw new ApiException(400, "Missing required param: petId"); + throw ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -389,12 +392,12 @@ class PetApi { List contentTypes = ["multipart/form-data"]; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if (additionalMetadata != null) { hasFields = true; mp.fields['additionalMetadata'] = parameterToString(additionalMetadata); @@ -422,7 +425,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'ApiResponse') as ApiResponse; } else { diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart index 7475aa4d990..f21b5ce98a6 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart @@ -11,11 +11,11 @@ class StoreApi { /// /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors Future deleteOrder(String orderId) async { - Object postBody = null; + Object postBody; // verify required params are set if(orderId == null) { - throw new ApiException(400, "Missing required param: orderId"); + throw ApiException(400, "Missing required param: orderId"); } // create path and map variables @@ -28,12 +28,12 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -50,7 +50,7 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -60,7 +60,7 @@ class StoreApi { /// /// Returns a map of status codes to quantities Future> getInventory() async { - Object postBody = null; + Object postBody; // verify required params are set @@ -74,12 +74,12 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = ["api_key"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -96,9 +96,9 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { - return new Map.from(apiClient.deserialize(_decodeBodyBytes(response), 'Map')); + return Map.from(apiClient.deserialize(_decodeBodyBytes(response), 'Map')); ; } else { return null; @@ -108,11 +108,11 @@ class StoreApi { /// /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions Future getOrderById(int orderId) async { - Object postBody = null; + Object postBody; // verify required params are set if(orderId == null) { - throw new ApiException(400, "Missing required param: orderId"); + throw ApiException(400, "Missing required param: orderId"); } // create path and map variables @@ -125,12 +125,12 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -147,7 +147,7 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'Order') as Order; } else { @@ -157,12 +157,12 @@ class StoreApi { /// Place an order for a pet /// /// - Future placeOrder(Order body) async { - Object postBody = body; + Future placeOrder(Order order) async { + Object postBody = order; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(order == null) { + throw ApiException(400, "Missing required param: order"); } // create path and map variables @@ -173,14 +173,14 @@ class StoreApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = []; + List contentTypes = ["application/json"]; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -197,7 +197,7 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'Order') as Order; } else { diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart index 8f00081a8c4..f7d7e41f8df 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart @@ -10,12 +10,12 @@ class UserApi { /// Create user /// /// This can only be done by the logged in user. - Future createUser(User body) async { - Object postBody = body; + Future createUser(User user) async { + Object postBody = user; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(user == null) { + throw ApiException(400, "Missing required param: user"); } // create path and map variables @@ -26,14 +26,14 @@ class UserApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = []; + List contentTypes = ["application/json"]; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - List authNames = []; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + List authNames = ["auth_cookie"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -50,7 +50,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -59,12 +59,12 @@ class UserApi { /// Creates list of users with given input array /// /// - Future createUsersWithArrayInput(List body) async { - Object postBody = body; + Future createUsersWithArrayInput(List user) async { + Object postBody = user; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(user == null) { + throw ApiException(400, "Missing required param: user"); } // create path and map variables @@ -75,14 +75,14 @@ class UserApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = []; + List contentTypes = ["application/json"]; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - List authNames = []; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + List authNames = ["auth_cookie"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -99,7 +99,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -108,12 +108,12 @@ class UserApi { /// Creates list of users with given input array /// /// - Future createUsersWithListInput(List body) async { - Object postBody = body; + Future createUsersWithListInput(List user) async { + Object postBody = user; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(user == null) { + throw ApiException(400, "Missing required param: user"); } // create path and map variables @@ -124,14 +124,14 @@ class UserApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = []; + List contentTypes = ["application/json"]; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - List authNames = []; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + List authNames = ["auth_cookie"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -148,7 +148,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -158,11 +158,11 @@ class UserApi { /// /// This can only be done by the logged in user. Future deleteUser(String username) async { - Object postBody = null; + Object postBody; // verify required params are set if(username == null) { - throw new ApiException(400, "Missing required param: username"); + throw ApiException(400, "Missing required param: username"); } // create path and map variables @@ -175,12 +175,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - List authNames = []; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + List authNames = ["auth_cookie"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -197,7 +197,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -207,11 +207,11 @@ class UserApi { /// /// Future getUserByName(String username) async { - Object postBody = null; + Object postBody; // verify required params are set if(username == null) { - throw new ApiException(400, "Missing required param: username"); + throw ApiException(400, "Missing required param: username"); } // create path and map variables @@ -224,12 +224,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -246,7 +246,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'User') as User; } else { @@ -257,14 +257,14 @@ class UserApi { /// /// Future loginUser(String username, String password) async { - Object postBody = null; + Object postBody; // verify required params are set if(username == null) { - throw new ApiException(400, "Missing required param: username"); + throw ApiException(400, "Missing required param: username"); } if(password == null) { - throw new ApiException(400, "Missing required param: password"); + throw ApiException(400, "Missing required param: password"); } // create path and map variables @@ -279,12 +279,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -301,7 +301,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; } else { @@ -312,7 +312,7 @@ class UserApi { /// /// Future logoutUser() async { - Object postBody = null; + Object postBody; // verify required params are set @@ -326,12 +326,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - List authNames = []; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + List authNames = ["auth_cookie"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -348,7 +348,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -357,15 +357,15 @@ class UserApi { /// Updated user /// /// This can only be done by the logged in user. - Future updateUser(String username, User body) async { - Object postBody = body; + Future updateUser(String username, User user) async { + Object postBody = user; // verify required params are set if(username == null) { - throw new ApiException(400, "Missing required param: username"); + throw ApiException(400, "Missing required param: username"); } - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(user == null) { + throw ApiException(400, "Missing required param: user"); } // create path and map variables @@ -376,14 +376,14 @@ class UserApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = []; + List contentTypes = ["application/json"]; - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - List authNames = []; + String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + List authNames = ["auth_cookie"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -400,7 +400,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart index b99ddeeccb1..e35c37c020c 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart @@ -10,18 +10,19 @@ class QueryParam { class ApiClient { String basePath; - var client = new Client(); + var client = Client(); Map _defaultHeaderMap = {}; Map _authentications = {}; - final _RegList = new RegExp(r'^List<(.*)>$'); - final _RegMap = new RegExp(r'^Map$'); + final _regList = RegExp(r'^List<(.*)>$'); + final _regMap = RegExp(r'^Map$'); - ApiClient({this.basePath: "http://petstore.swagger.io/v2"}) { + ApiClient({this.basePath = "http://petstore.swagger.io/v2"}) { // Setup authentications (key: authentication name, value: authentication). - _authentications['api_key'] = new ApiKeyAuth("header", "api_key"); - _authentications['petstore_auth'] = new OAuth(); + _authentications['api_key'] = ApiKeyAuth("header", "api_key"); + _authentications['auth_cookie'] = ApiKeyAuth("query", "AUTH_KEY"); + _authentications['petstore_auth'] = OAuth(); } void addDefaultHeader(String key, String value) { @@ -40,36 +41,40 @@ class ApiClient { case 'double': return value is double ? value : double.parse('$value'); case 'ApiResponse': - return new ApiResponse.fromJson(value); + return ApiResponse.fromJson(value); case 'Category': - return new Category.fromJson(value); + return Category.fromJson(value); + case 'InlineObject': + return InlineObject.fromJson(value); + case 'InlineObject1': + return InlineObject1.fromJson(value); case 'Order': - return new Order.fromJson(value); + return Order.fromJson(value); case 'Pet': - return new Pet.fromJson(value); + return Pet.fromJson(value); case 'Tag': - return new Tag.fromJson(value); + return Tag.fromJson(value); case 'User': - return new User.fromJson(value); + return User.fromJson(value); default: { Match match; if (value is List && - (match = _RegList.firstMatch(targetType)) != null) { + (match = _regList.firstMatch(targetType)) != null) { var newTargetType = match[1]; return value.map((v) => _deserialize(v, newTargetType)).toList(); } else if (value is Map && - (match = _RegMap.firstMatch(targetType)) != null) { + (match = _regMap.firstMatch(targetType)) != null) { var newTargetType = match[1]; - return new Map.fromIterables(value.keys, + return Map.fromIterables(value.keys, value.values.map((v) => _deserialize(v, newTargetType))); } } } - } catch (e, stack) { - throw new ApiException.withInner(500, 'Exception during deserialization.', e, stack); + } on Exception catch (e, stack) { + throw ApiException.withInner(500, 'Exception during deserialization.', e, stack); } - throw new ApiException(500, 'Could not find a suitable class for deserialization'); + throw ApiException(500, 'Could not find a suitable class for deserialization'); } dynamic deserialize(String json, String targetType) { @@ -78,7 +83,7 @@ class ApiClient { if (targetType == 'String') return json; - var decodedJson = JSON.decode(json); + var decodedJson = jsonDecode(json); return _deserialize(decodedJson, targetType); } @@ -87,7 +92,7 @@ class ApiClient { if (obj == null) { serialized = ''; } else { - serialized = JSON.encode(obj); + serialized = json.encode(obj); } return serialized; } @@ -119,7 +124,7 @@ class ApiClient { headerParams['Content-Type'] = contentType; if(body is MultipartRequest) { - var request = new MultipartRequest(method, Uri.parse(url)); + var request = MultipartRequest(method, Uri.parse(url)); request.fields.addAll(body.fields); request.files.addAll(body.files); request.headers.addAll(body.headers); @@ -148,16 +153,14 @@ class ApiClient { void _updateParamsForAuth(List authNames, List queryParams, Map headerParams) { authNames.forEach((authName) { Authentication auth = _authentications[authName]; - if (auth == null) throw new ArgumentError("Authentication undefined: " + authName); + if (auth == null) throw ArgumentError("Authentication undefined: " + authName); auth.applyToParams(queryParams, headerParams); }); } - void setAccessToken(String accessToken) { - _authentications.forEach((key, auth) { - if (auth is OAuth) { - auth.setAccessToken(accessToken); - } - }); + T getAuthentication(String name) { + var authentication = _authentications[name]; + + return authentication is T ? authentication : null; } } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_exception.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_exception.dart index f188fd125a4..668abe2c96b 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_exception.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_exception.dart @@ -2,9 +2,9 @@ part of openapi.api; class ApiException implements Exception { int code = 0; - String message = null; - Exception innerException = null; - StackTrace stackTrace = null; + String message; + Exception innerException; + StackTrace stackTrace; ApiException(this.code, this.message); @@ -17,7 +17,7 @@ class ApiException implements Exception { return "ApiException $code: $message"; } - return "ApiException $code: $message (Inner exception: ${innerException})\n\n" + + return "ApiException $code: $message (Inner exception: $innerException)\n\n" + stackTrace.toString(); } } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_helper.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_helper.dart index 9c1497017e8..c57b111ca87 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_helper.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_helper.dart @@ -11,7 +11,7 @@ Iterable _convertParametersForCollectionFormat( if (name == null || name.isEmpty || value == null) return params; if (value is! List) { - params.add(new QueryParam(name, parameterToString(value))); + params.add(QueryParam(name, parameterToString(value))); return params; } @@ -23,12 +23,12 @@ Iterable _convertParametersForCollectionFormat( : collectionFormat; // default: csv if (collectionFormat == "multi") { - return values.map((v) => new QueryParam(name, parameterToString(v))); + return values.map((v) => QueryParam(name, parameterToString(v))); } String delimiter = _delimiters[collectionFormat] ?? ","; - params.add(new QueryParam(name, values.map((v) => parameterToString(v)).join(delimiter))); + params.add(QueryParam(name, values.map((v) => parameterToString(v)).join(delimiter))); return params; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/api_key_auth.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/api_key_auth.dart index f9617f7ae4d..8384f0516ce 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/api_key_auth.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/api_key_auth.dart @@ -4,22 +4,24 @@ class ApiKeyAuth implements Authentication { final String location; final String paramName; - String apiKey; + String _apiKey; String apiKeyPrefix; + set apiKey(String key) => _apiKey = key; + ApiKeyAuth(this.location, this.paramName); @override void applyToParams(List queryParams, Map headerParams) { String value; if (apiKeyPrefix != null) { - value = '$apiKeyPrefix $apiKey'; + value = '$apiKeyPrefix $_apiKey'; } else { - value = apiKey; + value = _apiKey; } if (location == 'query' && value != null) { - queryParams.add(new QueryParam(paramName, value)); + queryParams.add(QueryParam(paramName, value)); } else if (location == 'header' && value != null) { headerParams[paramName] = value; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/http_basic_auth.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/http_basic_auth.dart index 4e77ddcf6e6..da931fa2634 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/http_basic_auth.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/http_basic_auth.dart @@ -2,13 +2,15 @@ part of openapi.api; class HttpBasicAuth implements Authentication { - String username; - String password; + String _username; + String _password; @override void applyToParams(List queryParams, Map headerParams) { - String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); - headerParams["Authorization"] = "Basic " + BASE64.encode(UTF8.encode(str)); + String str = (_username == null ? "" : _username) + ":" + (_password == null ? "" : _password); + headerParams["Authorization"] = "Basic " + base64.encode(utf8.encode(str)); } -} \ No newline at end of file + set username(String username) => _username = username; + set password(String password) => _password = password; +} diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/oauth.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/oauth.dart index 13bfd799743..230471e44fc 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/oauth.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/oauth.dart @@ -1,19 +1,16 @@ part of openapi.api; class OAuth implements Authentication { - String accessToken; + String _accessToken; - OAuth({this.accessToken}) { - } + OAuth({String accessToken}) : _accessToken = accessToken; @override void applyToParams(List queryParams, Map headerParams) { - if (accessToken != null) { - headerParams["Authorization"] = "Bearer " + accessToken; + if (_accessToken != null) { + headerParams["Authorization"] = "Bearer $_accessToken"; } } - void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } + set accessToken(String accessToken) => _accessToken = accessToken; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart index f2fddde347a..be01c2de819 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart @@ -19,36 +19,39 @@ class ApiResponse { if (json['code'] == null) { code = null; } else { - code = json['code']; + code = json['code']; } if (json['type'] == null) { type = null; } else { - type = json['type']; + type = json['type']; } if (json['message'] == null) { message = null; } else { - message = json['message']; + message = json['message']; } } Map toJson() { - return { - 'code': code, - 'type': type, - 'message': message - }; + Map json = {}; + if (code != null) + json['code'] = code; + if (type != null) + json['type'] = type; + if (message != null) + json['message'] = message; + return json; } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new ApiResponse.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => ApiResponse.fromJson(value)).toList(); } - static Map mapFromJson(Map> json) { - var map = new Map(); - if (json != null && json.length > 0) { - json.forEach((String key, Map value) => map[key] = new ApiResponse.fromJson(value)); + static Map mapFromJson(Map json) { + var map = Map(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) => map[key] = ApiResponse.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart index 1750c6a0acb..696468a1619 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart @@ -17,30 +17,32 @@ class Category { if (json['id'] == null) { id = null; } else { - id = json['id']; + id = json['id']; } if (json['name'] == null) { name = null; } else { - name = json['name']; + name = json['name']; } } Map toJson() { - return { - 'id': id, - 'name': name - }; + Map json = {}; + if (id != null) + json['id'] = id; + if (name != null) + json['name'] = name; + return json; } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Category.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => Category.fromJson(value)).toList(); } - static Map mapFromJson(Map> json) { - var map = new Map(); - if (json != null && json.length > 0) { - json.forEach((String key, Map value) => map[key] = new Category.fromJson(value)); + static Map mapFromJson(Map json) { + var map = Map(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) => map[key] = Category.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object.dart new file mode 100644 index 00000000000..e2a59c2ca40 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object.dart @@ -0,0 +1,50 @@ +part of openapi.api; + +class InlineObject { + /* Updated name of the pet */ + String name = null; + /* Updated status of the pet */ + String status = null; + InlineObject(); + + @override + String toString() { + return 'InlineObject[name=$name, status=$status, ]'; + } + + InlineObject.fromJson(Map json) { + if (json == null) return; + if (json['name'] == null) { + name = null; + } else { + name = json['name']; + } + if (json['status'] == null) { + status = null; + } else { + status = json['status']; + } + } + + Map toJson() { + Map json = {}; + if (name != null) + json['name'] = name; + if (status != null) + json['status'] = status; + return json; + } + + static List listFromJson(List json) { + return json == null ? List() : json.map((value) => InlineObject.fromJson(value)).toList(); + } + + static Map mapFromJson(Map json) { + var map = Map(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) => map[key] = InlineObject.fromJson(value)); + } + return map; + } +} + diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object1.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object1.dart new file mode 100644 index 00000000000..eba9610c556 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/inline_object1.dart @@ -0,0 +1,50 @@ +part of openapi.api; + +class InlineObject1 { + /* Additional data to pass to server */ + String additionalMetadata = null; + /* file to upload */ + MultipartFile file = null; + InlineObject1(); + + @override + String toString() { + return 'InlineObject1[additionalMetadata=$additionalMetadata, file=$file, ]'; + } + + InlineObject1.fromJson(Map json) { + if (json == null) return; + if (json['additionalMetadata'] == null) { + additionalMetadata = null; + } else { + additionalMetadata = json['additionalMetadata']; + } + if (json['file'] == null) { + file = null; + } else { + file = File.fromJson(json['file']); + } + } + + Map toJson() { + Map json = {}; + if (additionalMetadata != null) + json['additionalMetadata'] = additionalMetadata; + if (file != null) + json['file'] = file; + return json; + } + + static List listFromJson(List json) { + return json == null ? List() : json.map((value) => InlineObject1.fromJson(value)).toList(); + } + + static Map mapFromJson(Map json) { + var map = Map(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) => map[key] = InlineObject1.fromJson(value)); + } + return map; + } +} + diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart index 51d15f73041..be5a12e1ed1 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart @@ -26,17 +26,17 @@ class Order { if (json['id'] == null) { id = null; } else { - id = json['id']; + id = json['id']; } if (json['petId'] == null) { petId = null; } else { - petId = json['petId']; + petId = json['petId']; } if (json['quantity'] == null) { quantity = null; } else { - quantity = json['quantity']; + quantity = json['quantity']; } if (json['shipDate'] == null) { shipDate = null; @@ -46,34 +46,40 @@ class Order { if (json['status'] == null) { status = null; } else { - status = json['status']; + status = json['status']; } if (json['complete'] == null) { complete = null; } else { - complete = json['complete']; + complete = json['complete']; } } Map toJson() { - return { - 'id': id, - 'petId': petId, - 'quantity': quantity, - 'shipDate': shipDate == null ? '' : shipDate.toUtc().toIso8601String(), - 'status': status, - 'complete': complete - }; + Map json = {}; + if (id != null) + json['id'] = id; + if (petId != null) + json['petId'] = petId; + if (quantity != null) + json['quantity'] = quantity; + if (shipDate != null) + json['shipDate'] = shipDate == null ? null : shipDate.toUtc().toIso8601String(); + if (status != null) + json['status'] = status; + if (complete != null) + json['complete'] = complete; + return json; } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Order.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => Order.fromJson(value)).toList(); } - static Map mapFromJson(Map> json) { - var map = new Map(); - if (json != null && json.length > 0) { - json.forEach((String key, Map value) => map[key] = new Order.fromJson(value)); + static Map mapFromJson(Map json) { + var map = Map(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) => map[key] = Order.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart index c64406368d8..4f19829878a 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart @@ -26,22 +26,22 @@ class Pet { if (json['id'] == null) { id = null; } else { - id = json['id']; + id = json['id']; } if (json['category'] == null) { category = null; } else { - category = new Category.fromJson(json['category']); + category = Category.fromJson(json['category']); } if (json['name'] == null) { name = null; } else { - name = json['name']; + name = json['name']; } if (json['photoUrls'] == null) { photoUrls = null; } else { - photoUrls = (json['photoUrls'] as List).map((item) => item as String).toList(); + photoUrls = (json['photoUrls'] as List).cast(); } if (json['tags'] == null) { tags = null; @@ -51,29 +51,35 @@ class Pet { if (json['status'] == null) { status = null; } else { - status = json['status']; + status = json['status']; } } Map toJson() { - return { - 'id': id, - 'category': category, - 'name': name, - 'photoUrls': photoUrls, - 'tags': tags, - 'status': status - }; + Map json = {}; + if (id != null) + json['id'] = id; + if (category != null) + json['category'] = category; + if (name != null) + json['name'] = name; + if (photoUrls != null) + json['photoUrls'] = photoUrls; + if (tags != null) + json['tags'] = tags; + if (status != null) + json['status'] = status; + return json; } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Pet.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => Pet.fromJson(value)).toList(); } - static Map mapFromJson(Map> json) { - var map = new Map(); - if (json != null && json.length > 0) { - json.forEach((String key, Map value) => map[key] = new Pet.fromJson(value)); + static Map mapFromJson(Map json) { + var map = Map(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) => map[key] = Pet.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart index 980c6e01630..a3485e5d3c6 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart @@ -17,30 +17,32 @@ class Tag { if (json['id'] == null) { id = null; } else { - id = json['id']; + id = json['id']; } if (json['name'] == null) { name = null; } else { - name = json['name']; + name = json['name']; } } Map toJson() { - return { - 'id': id, - 'name': name - }; + Map json = {}; + if (id != null) + json['id'] = id; + if (name != null) + json['name'] = name; + return json; } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Tag.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => Tag.fromJson(value)).toList(); } - static Map mapFromJson(Map> json) { - var map = new Map(); - if (json != null && json.length > 0) { - json.forEach((String key, Map value) => map[key] = new Tag.fromJson(value)); + static Map mapFromJson(Map json) { + var map = Map(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) => map[key] = Tag.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart index 1555eb0a3ef..48f061d969b 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart @@ -29,66 +29,74 @@ class User { if (json['id'] == null) { id = null; } else { - id = json['id']; + id = json['id']; } if (json['username'] == null) { username = null; } else { - username = json['username']; + username = json['username']; } if (json['firstName'] == null) { firstName = null; } else { - firstName = json['firstName']; + firstName = json['firstName']; } if (json['lastName'] == null) { lastName = null; } else { - lastName = json['lastName']; + lastName = json['lastName']; } if (json['email'] == null) { email = null; } else { - email = json['email']; + email = json['email']; } if (json['password'] == null) { password = null; } else { - password = json['password']; + password = json['password']; } if (json['phone'] == null) { phone = null; } else { - phone = json['phone']; + phone = json['phone']; } if (json['userStatus'] == null) { userStatus = null; } else { - userStatus = json['userStatus']; + userStatus = json['userStatus']; } } Map toJson() { - return { - 'id': id, - 'username': username, - 'firstName': firstName, - 'lastName': lastName, - 'email': email, - 'password': password, - 'phone': phone, - 'userStatus': userStatus - }; + Map json = {}; + if (id != null) + json['id'] = id; + if (username != null) + json['username'] = username; + if (firstName != null) + json['firstName'] = firstName; + if (lastName != null) + json['lastName'] = lastName; + if (email != null) + json['email'] = email; + if (password != null) + json['password'] = password; + if (phone != null) + json['phone'] = phone; + if (userStatus != null) + json['userStatus'] = userStatus; + return json; } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new User.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => User.fromJson(value)).toList(); } - static Map mapFromJson(Map> json) { - var map = new Map(); - if (json != null && json.length > 0) { - json.forEach((String key, Map value) => map[key] = new User.fromJson(value)); + static Map mapFromJson(Map json) { + var map = Map(); + if (json != null && json.isNotEmpty) { + json.forEach((String key, dynamic value) => map[key] = User.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml b/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml index b63f835e89b..391fa5edec0 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml +++ b/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml @@ -1,6 +1,8 @@ name: openapi version: 1.0.0 description: OpenAPI API client +environment: + sdk: '>=2.0.0 <3.0.0' dependencies: http: '>=0.11.1 <0.13.0' dev_dependencies: diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/api_response_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/api_response_test.dart index ba2202d24c4..afd92edde06 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/test/api_response_test.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/api_response_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for ApiResponse void main() { - var instance = new ApiResponse(); + var instance = ApiResponse(); group('test ApiResponse', () { // int code (default value: null) diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/category_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/category_test.dart index 0dcaa8b7977..ed39fa7ed8a 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/test/category_test.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/category_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for Category void main() { - var instance = new Category(); + var instance = Category(); group('test Category', () { // int id (default value: null) diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/inline_object1_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/inline_object1_test.dart new file mode 100644 index 00000000000..c13702bedf3 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/inline_object1_test.dart @@ -0,0 +1,24 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for InlineObject1 +void main() { + var instance = InlineObject1(); + + group('test InlineObject1', () { + // Additional data to pass to server + // String additionalMetadata (default value: null) + test('to test the property `additionalMetadata`', () async { + // TODO + }); + + // file to upload + // MultipartFile file (default value: null) + test('to test the property `file`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/inline_object_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/inline_object_test.dart new file mode 100644 index 00000000000..14f10960f9d --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/inline_object_test.dart @@ -0,0 +1,24 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for InlineObject +void main() { + var instance = InlineObject(); + + group('test InlineObject', () { + // Updated name of the pet + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + // Updated status of the pet + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/order_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/order_test.dart index aa9dcc69c4f..6102e1e5d08 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/test/order_test.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/order_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for Order void main() { - var instance = new Order(); + var instance = Order(); group('test Order', () { // int id (default value: null) diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/pet_api_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/pet_api_test.dart index fa95dccad3c..959cf932c73 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/test/pet_api_test.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/pet_api_test.dart @@ -4,12 +4,12 @@ import 'package:test/test.dart'; /// tests for PetApi void main() { - var instance = new PetApi(); + var instance = PetApi(); group('tests for PetApi', () { // Add a new pet to the store // - //Future addPet(Pet body) async + //Future addPet(Pet pet) async test('test addPet', () async { // TODO }); @@ -34,7 +34,7 @@ void main() { // // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. // - //Future> findPetsByTags(List tags) async + //Future> findPetsByTags(List tags, { int maxCount }) async test('test findPetsByTags', () async { // TODO }); @@ -50,7 +50,7 @@ void main() { // Update an existing pet // - //Future updatePet(Pet body) async + //Future updatePet(Pet pet) async test('test updatePet', () async { // TODO }); diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/pet_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/pet_test.dart index cfd94b9e36c..83480bd785e 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/test/pet_test.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/pet_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for Pet void main() { - var instance = new Pet(); + var instance = Pet(); group('test Pet', () { // int id (default value: null) diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/store_api_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/store_api_test.dart index 496d051e833..d23843bf903 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/test/store_api_test.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/store_api_test.dart @@ -4,7 +4,7 @@ import 'package:test/test.dart'; /// tests for StoreApi void main() { - var instance = new StoreApi(); + var instance = StoreApi(); group('tests for StoreApi', () { // Delete purchase order by ID @@ -36,7 +36,7 @@ void main() { // Place an order for a pet // - //Future placeOrder(Order body) async + //Future placeOrder(Order order) async test('test placeOrder', () async { // TODO }); diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/tag_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/tag_test.dart index 58477c9e758..3333ea6d310 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/test/tag_test.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/tag_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for Tag void main() { - var instance = new Tag(); + var instance = Tag(); group('test Tag', () { // int id (default value: null) diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/user_api_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/user_api_test.dart index f040b01bf43..1cf5f4ced73 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/test/user_api_test.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/user_api_test.dart @@ -4,28 +4,28 @@ import 'package:test/test.dart'; /// tests for UserApi void main() { - var instance = new UserApi(); + var instance = UserApi(); group('tests for UserApi', () { // Create user // // This can only be done by the logged in user. // - //Future createUser(User body) async + //Future createUser(User user) async test('test createUser', () async { // TODO }); // Creates list of users with given input array // - //Future createUsersWithArrayInput(List body) async + //Future createUsersWithArrayInput(List user) async test('test createUsersWithArrayInput', () async { // TODO }); // Creates list of users with given input array // - //Future createUsersWithListInput(List body) async + //Future createUsersWithListInput(List user) async test('test createUsersWithListInput', () async { // TODO }); @@ -64,7 +64,7 @@ void main() { // // This can only be done by the logged in user. // - //Future updateUser(String username, User body) async + //Future updateUser(String username, User user) async test('test updateUser', () async { // TODO }); diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/user_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/user_test.dart index ae6096d0f51..35e8eed3756 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/test/user_test.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/user_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for User void main() { - var instance = new User(); + var instance = User(); group('test User', () { // int id (default value: null) diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart2/flutter_petstore/openapi/.openapi-generator/VERSION index 06b5019af3f..83a328a9227 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/README.md b/samples/client/petstore/dart2/flutter_petstore/openapi/README.md index 45fe0858b2d..e78e0e3e697 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/README.md +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/README.md @@ -46,8 +46,8 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = PetApi(); +var body = Pet(); // Pet | Pet object that needs to be added to the store try { api_instance.addPet(body); diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/docs/PetApi.md b/samples/client/petstore/dart2/flutter_petstore/openapi/docs/PetApi.md index 3ec1113828c..7b5de3894a9 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/docs/PetApi.md +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/docs/PetApi.md @@ -30,8 +30,8 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = PetApi(); +var body = Pet(); // Pet | Pet object that needs to be added to the store try { api_instance.addPet(body); @@ -72,7 +72,7 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var petId = 789; // int | Pet id to delete var apiKey = apiKey_example; // String | @@ -118,7 +118,7 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var status = []; // List | Status values that need to be considered for filter try { @@ -163,7 +163,7 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var tags = []; // List | Tags to filter by try { @@ -210,7 +210,7 @@ import 'package:openapi/api.dart'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed //defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var petId = 789; // int | ID of pet to return try { @@ -253,8 +253,8 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = PetApi(); +var body = Pet(); // Pet | Pet object that needs to be added to the store try { api_instance.updatePet(body); @@ -295,7 +295,7 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var petId = 789; // int | ID of pet that needs to be updated var name = name_example; // String | Updated name of the pet var status = status_example; // String | Updated status of the pet @@ -341,7 +341,7 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var petId = 789; // int | ID of pet to update var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server var file = BINARY_DATA_HERE; // MultipartFile | file to upload diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/docs/StoreApi.md b/samples/client/petstore/dart2/flutter_petstore/openapi/docs/StoreApi.md index f3a5e0aba87..1cc37e2a47a 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/docs/StoreApi.md +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/docs/StoreApi.md @@ -26,7 +26,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ```dart import 'package:openapi/api.dart'; -var api_instance = new StoreApi(); +var api_instance = StoreApi(); var orderId = orderId_example; // String | ID of the order that needs to be deleted try { @@ -72,7 +72,7 @@ import 'package:openapi/api.dart'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed //defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; -var api_instance = new StoreApi(); +var api_instance = StoreApi(); try { var result = api_instance.getInventory(); @@ -111,7 +111,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ```dart import 'package:openapi/api.dart'; -var api_instance = new StoreApi(); +var api_instance = StoreApi(); var orderId = 789; // int | ID of pet that needs to be fetched try { @@ -152,8 +152,8 @@ Place an order for a pet ```dart import 'package:openapi/api.dart'; -var api_instance = new StoreApi(); -var body = new Order(); // Order | order placed for purchasing the pet +var api_instance = StoreApi(); +var body = Order(); // Order | order placed for purchasing the pet try { var result = api_instance.placeOrder(body); diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/docs/UserApi.md b/samples/client/petstore/dart2/flutter_petstore/openapi/docs/UserApi.md index 5e0605c6ea0..1ee5f6fced6 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/docs/UserApi.md +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/docs/UserApi.md @@ -30,8 +30,8 @@ This can only be done by the logged in user. ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); -var body = new User(); // User | Created user object +var api_instance = UserApi(); +var body = User(); // User | Created user object try { api_instance.createUser(body); @@ -70,8 +70,8 @@ Creates list of users with given input array ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); -var body = [new List<User>()]; // List | List of user object +var api_instance = UserApi(); +var body = [List<User>()]; // List | List of user object try { api_instance.createUsersWithArrayInput(body); @@ -84,7 +84,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -110,8 +110,8 @@ Creates list of users with given input array ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); -var body = [new List<User>()]; // List | List of user object +var api_instance = UserApi(); +var body = [List<User>()]; // List | List of user object try { api_instance.createUsersWithListInput(body); @@ -124,7 +124,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -152,7 +152,7 @@ This can only be done by the logged in user. ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); +var api_instance = UserApi(); var username = username_example; // String | The name that needs to be deleted try { @@ -192,7 +192,7 @@ Get user by user name ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); +var api_instance = UserApi(); var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. try { @@ -233,7 +233,7 @@ Logs user into the system ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); +var api_instance = UserApi(); var username = username_example; // String | The user name for login var password = password_example; // String | The password for login in clear text @@ -276,7 +276,7 @@ Logs out current logged in user session ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); +var api_instance = UserApi(); try { api_instance.logoutUser(); @@ -314,9 +314,9 @@ This can only be done by the logged in user. ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); +var api_instance = UserApi(); var username = username_example; // String | name that need to be deleted -var body = new User(); // User | Updated user object +var body = User(); // User | Updated user object try { api_instance.updateUser(username, body); diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api/pet_api.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api/pet_api.dart index 9670db26fef..35416e655ed 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api/pet_api.dart +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api/pet_api.dart @@ -15,7 +15,7 @@ class PetApi { // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -33,7 +33,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -50,7 +50,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -64,7 +64,7 @@ class PetApi { // verify required params are set if(petId == null) { - throw new ApiException(400, "Missing required param: petId"); + throw ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -83,7 +83,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -100,7 +100,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -114,7 +114,7 @@ class PetApi { // verify required params are set if(status == null) { - throw new ApiException(400, "Missing required param: status"); + throw ApiException(400, "Missing required param: status"); } // create path and map variables @@ -133,7 +133,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -150,7 +150,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List).map((item) => item as Pet).toList(); } else { @@ -165,7 +165,7 @@ class PetApi { // verify required params are set if(tags == null) { - throw new ApiException(400, "Missing required param: tags"); + throw ApiException(400, "Missing required param: tags"); } // create path and map variables @@ -184,7 +184,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -201,7 +201,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List).map((item) => item as Pet).toList(); } else { @@ -216,7 +216,7 @@ class PetApi { // verify required params are set if(petId == null) { - throw new ApiException(400, "Missing required param: petId"); + throw ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -234,7 +234,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -251,7 +251,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'Pet') as Pet; } else { @@ -266,7 +266,7 @@ class PetApi { // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -284,7 +284,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -301,7 +301,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -315,7 +315,7 @@ class PetApi { // verify required params are set if(petId == null) { - throw new ApiException(400, "Missing required param: petId"); + throw ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -333,7 +333,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if (name != null) { hasFields = true; mp.fields['name'] = parameterToString(name); @@ -362,7 +362,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -376,7 +376,7 @@ class PetApi { // verify required params are set if(petId == null) { - throw new ApiException(400, "Missing required param: petId"); + throw ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -394,7 +394,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if (additionalMetadata != null) { hasFields = true; mp.fields['additionalMetadata'] = parameterToString(additionalMetadata); @@ -422,7 +422,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'ApiResponse') as ApiResponse; } else { diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api/store_api.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api/store_api.dart index 1296576d4a0..59e59725ec6 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api/store_api.dart +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api/store_api.dart @@ -15,7 +15,7 @@ class StoreApi { // verify required params are set if(orderId == null) { - throw new ApiException(400, "Missing required param: orderId"); + throw ApiException(400, "Missing required param: orderId"); } // create path and map variables @@ -33,7 +33,7 @@ class StoreApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -50,7 +50,7 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -79,7 +79,7 @@ class StoreApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -96,9 +96,9 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { - return new Map.from(apiClient.deserialize(_decodeBodyBytes(response), 'Map')); + return Map.from(apiClient.deserialize(_decodeBodyBytes(response), 'Map')); ; } else { return null; @@ -112,7 +112,7 @@ class StoreApi { // verify required params are set if(orderId == null) { - throw new ApiException(400, "Missing required param: orderId"); + throw ApiException(400, "Missing required param: orderId"); } // create path and map variables @@ -130,7 +130,7 @@ class StoreApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -147,7 +147,7 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'Order') as Order; } else { @@ -162,7 +162,7 @@ class StoreApi { // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -180,7 +180,7 @@ class StoreApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -197,7 +197,7 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'Order') as Order; } else { diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api/user_api.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api/user_api.dart index 4ad3021a1fa..475f0655b95 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api/user_api.dart +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/api/user_api.dart @@ -15,7 +15,7 @@ class UserApi { // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -33,7 +33,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -50,7 +50,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -64,7 +64,7 @@ class UserApi { // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -82,7 +82,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -99,7 +99,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -113,7 +113,7 @@ class UserApi { // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -131,7 +131,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -148,7 +148,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -162,7 +162,7 @@ class UserApi { // verify required params are set if(username == null) { - throw new ApiException(400, "Missing required param: username"); + throw ApiException(400, "Missing required param: username"); } // create path and map variables @@ -180,7 +180,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -197,7 +197,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -211,7 +211,7 @@ class UserApi { // verify required params are set if(username == null) { - throw new ApiException(400, "Missing required param: username"); + throw ApiException(400, "Missing required param: username"); } // create path and map variables @@ -229,7 +229,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -246,7 +246,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'User') as User; } else { @@ -261,10 +261,10 @@ class UserApi { // verify required params are set if(username == null) { - throw new ApiException(400, "Missing required param: username"); + throw ApiException(400, "Missing required param: username"); } if(password == null) { - throw new ApiException(400, "Missing required param: password"); + throw ApiException(400, "Missing required param: password"); } // create path and map variables @@ -284,7 +284,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -301,7 +301,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; } else { @@ -331,7 +331,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -348,7 +348,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -362,10 +362,10 @@ class UserApi { // verify required params are set if(username == null) { - throw new ApiException(400, "Missing required param: username"); + throw ApiException(400, "Missing required param: username"); } if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -383,7 +383,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -400,7 +400,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/api_response.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/api_response.dart index 3d37ea21577..be01c2de819 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/api_response.dart +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/api_response.dart @@ -45,13 +45,13 @@ class ApiResponse { } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new ApiResponse.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => ApiResponse.fromJson(value)).toList(); } static Map mapFromJson(Map json) { - var map = new Map(); + var map = Map(); if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new ApiResponse.fromJson(value)); + json.forEach((String key, dynamic value) => map[key] = ApiResponse.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/category.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/category.dart index 32a7c1e81aa..696468a1619 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/category.dart +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/category.dart @@ -36,13 +36,13 @@ class Category { } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Category.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => Category.fromJson(value)).toList(); } static Map mapFromJson(Map json) { - var map = new Map(); + var map = Map(); if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new Category.fromJson(value)); + json.forEach((String key, dynamic value) => map[key] = Category.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/order.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/order.dart index c3966e6f9f2..be5a12e1ed1 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/order.dart +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/order.dart @@ -73,13 +73,13 @@ class Order { } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Order.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => Order.fromJson(value)).toList(); } static Map mapFromJson(Map json) { - var map = new Map(); + var map = Map(); if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new Order.fromJson(value)); + json.forEach((String key, dynamic value) => map[key] = Order.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/pet.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/pet.dart index d8bdd2ef407..4f19829878a 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/pet.dart +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/pet.dart @@ -31,7 +31,7 @@ class Pet { if (json['category'] == null) { category = null; } else { - category = new Category.fromJson(json['category']); + category = Category.fromJson(json['category']); } if (json['name'] == null) { name = null; @@ -73,13 +73,13 @@ class Pet { } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Pet.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => Pet.fromJson(value)).toList(); } static Map mapFromJson(Map json) { - var map = new Map(); + var map = Map(); if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new Pet.fromJson(value)); + json.forEach((String key, dynamic value) => map[key] = Pet.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/tag.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/tag.dart index ca53c8ae890..a3485e5d3c6 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/tag.dart +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/tag.dart @@ -36,13 +36,13 @@ class Tag { } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Tag.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => Tag.fromJson(value)).toList(); } static Map mapFromJson(Map json) { - var map = new Map(); + var map = Map(); if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new Tag.fromJson(value)); + json.forEach((String key, dynamic value) => map[key] = Tag.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/user.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/user.dart index 1c5ef51fbaa..48f061d969b 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/user.dart +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/lib/model/user.dart @@ -90,13 +90,13 @@ class User { } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new User.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => User.fromJson(value)).toList(); } static Map mapFromJson(Map json) { - var map = new Map(); + var map = Map(); if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new User.fromJson(value)); + json.forEach((String key, dynamic value) => map[key] = User.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/api_response_test.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/test/api_response_test.dart index ebf142904e9..afd92edde06 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/test/api_response_test.dart +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/test/api_response_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for ApiResponse void main() { - var instance = new Pet(); + var instance = ApiResponse(); group('test ApiResponse', () { // int code (default value: null) diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/category_test.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/test/category_test.dart index c5cea4b5bc3..ed39fa7ed8a 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/test/category_test.dart +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/test/category_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for Category void main() { - var instance = new Pet(); + var instance = Category(); group('test Category', () { // int id (default value: null) diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/order_test.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/test/order_test.dart index 9982020d8cf..6102e1e5d08 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/test/order_test.dart +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/test/order_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for Order void main() { - var instance = new Pet(); + var instance = Order(); group('test Order', () { // int id (default value: null) diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/pet_api_test.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/test/pet_api_test.dart index fa95dccad3c..409b7962536 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/test/pet_api_test.dart +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/test/pet_api_test.dart @@ -4,7 +4,7 @@ import 'package:test/test.dart'; /// tests for PetApi void main() { - var instance = new PetApi(); + var instance = PetApi(); group('tests for PetApi', () { // Add a new pet to the store diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/pet_test.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/test/pet_test.dart index cfd94b9e36c..83480bd785e 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/test/pet_test.dart +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/test/pet_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for Pet void main() { - var instance = new Pet(); + var instance = Pet(); group('test Pet', () { // int id (default value: null) diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/store_api_test.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/test/store_api_test.dart index 496d051e833..e2c7ab94b17 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/test/store_api_test.dart +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/test/store_api_test.dart @@ -4,7 +4,7 @@ import 'package:test/test.dart'; /// tests for StoreApi void main() { - var instance = new StoreApi(); + var instance = StoreApi(); group('tests for StoreApi', () { // Delete purchase order by ID diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/tag_test.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/test/tag_test.dart index 6ee16c51bba..3333ea6d310 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/test/tag_test.dart +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/test/tag_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for Tag void main() { - var instance = new Pet(); + var instance = Tag(); group('test Tag', () { // int id (default value: null) diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/user_api_test.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/test/user_api_test.dart index f040b01bf43..5d124a61117 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/test/user_api_test.dart +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/test/user_api_test.dart @@ -4,7 +4,7 @@ import 'package:test/test.dart'; /// tests for UserApi void main() { - var instance = new UserApi(); + var instance = UserApi(); group('tests for UserApi', () { // Create user diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/user_test.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/test/user_test.dart index 5a6340c4f4b..35e8eed3756 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/test/user_test.dart +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/test/user_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for User void main() { - var instance = new Pet(); + var instance = User(); group('test User', () { // int id (default value: null) diff --git a/samples/client/petstore/dart2/openapi-browser-client/.openapi-generator/VERSION b/samples/client/petstore/dart2/openapi-browser-client/.openapi-generator/VERSION index 06b5019af3f..83a328a9227 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/.openapi-generator/VERSION +++ b/samples/client/petstore/dart2/openapi-browser-client/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart2/openapi-browser-client/README.md b/samples/client/petstore/dart2/openapi-browser-client/README.md index 45fe0858b2d..e78e0e3e697 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/README.md +++ b/samples/client/petstore/dart2/openapi-browser-client/README.md @@ -46,8 +46,8 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = PetApi(); +var body = Pet(); // Pet | Pet object that needs to be added to the store try { api_instance.addPet(body); diff --git a/samples/client/petstore/dart2/openapi-browser-client/docs/PetApi.md b/samples/client/petstore/dart2/openapi-browser-client/docs/PetApi.md index 3ec1113828c..7b5de3894a9 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/docs/PetApi.md +++ b/samples/client/petstore/dart2/openapi-browser-client/docs/PetApi.md @@ -30,8 +30,8 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = PetApi(); +var body = Pet(); // Pet | Pet object that needs to be added to the store try { api_instance.addPet(body); @@ -72,7 +72,7 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var petId = 789; // int | Pet id to delete var apiKey = apiKey_example; // String | @@ -118,7 +118,7 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var status = []; // List | Status values that need to be considered for filter try { @@ -163,7 +163,7 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var tags = []; // List | Tags to filter by try { @@ -210,7 +210,7 @@ import 'package:openapi/api.dart'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed //defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var petId = 789; // int | ID of pet to return try { @@ -253,8 +253,8 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = PetApi(); +var body = Pet(); // Pet | Pet object that needs to be added to the store try { api_instance.updatePet(body); @@ -295,7 +295,7 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var petId = 789; // int | ID of pet that needs to be updated var name = name_example; // String | Updated name of the pet var status = status_example; // String | Updated status of the pet @@ -341,7 +341,7 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var petId = 789; // int | ID of pet to update var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server var file = BINARY_DATA_HERE; // MultipartFile | file to upload diff --git a/samples/client/petstore/dart2/openapi-browser-client/docs/StoreApi.md b/samples/client/petstore/dart2/openapi-browser-client/docs/StoreApi.md index f3a5e0aba87..1cc37e2a47a 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/docs/StoreApi.md +++ b/samples/client/petstore/dart2/openapi-browser-client/docs/StoreApi.md @@ -26,7 +26,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ```dart import 'package:openapi/api.dart'; -var api_instance = new StoreApi(); +var api_instance = StoreApi(); var orderId = orderId_example; // String | ID of the order that needs to be deleted try { @@ -72,7 +72,7 @@ import 'package:openapi/api.dart'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed //defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; -var api_instance = new StoreApi(); +var api_instance = StoreApi(); try { var result = api_instance.getInventory(); @@ -111,7 +111,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ```dart import 'package:openapi/api.dart'; -var api_instance = new StoreApi(); +var api_instance = StoreApi(); var orderId = 789; // int | ID of pet that needs to be fetched try { @@ -152,8 +152,8 @@ Place an order for a pet ```dart import 'package:openapi/api.dart'; -var api_instance = new StoreApi(); -var body = new Order(); // Order | order placed for purchasing the pet +var api_instance = StoreApi(); +var body = Order(); // Order | order placed for purchasing the pet try { var result = api_instance.placeOrder(body); diff --git a/samples/client/petstore/dart2/openapi-browser-client/docs/UserApi.md b/samples/client/petstore/dart2/openapi-browser-client/docs/UserApi.md index 5e0605c6ea0..1ee5f6fced6 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/docs/UserApi.md +++ b/samples/client/petstore/dart2/openapi-browser-client/docs/UserApi.md @@ -30,8 +30,8 @@ This can only be done by the logged in user. ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); -var body = new User(); // User | Created user object +var api_instance = UserApi(); +var body = User(); // User | Created user object try { api_instance.createUser(body); @@ -70,8 +70,8 @@ Creates list of users with given input array ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); -var body = [new List<User>()]; // List | List of user object +var api_instance = UserApi(); +var body = [List<User>()]; // List | List of user object try { api_instance.createUsersWithArrayInput(body); @@ -84,7 +84,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -110,8 +110,8 @@ Creates list of users with given input array ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); -var body = [new List<User>()]; // List | List of user object +var api_instance = UserApi(); +var body = [List<User>()]; // List | List of user object try { api_instance.createUsersWithListInput(body); @@ -124,7 +124,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -152,7 +152,7 @@ This can only be done by the logged in user. ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); +var api_instance = UserApi(); var username = username_example; // String | The name that needs to be deleted try { @@ -192,7 +192,7 @@ Get user by user name ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); +var api_instance = UserApi(); var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. try { @@ -233,7 +233,7 @@ Logs user into the system ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); +var api_instance = UserApi(); var username = username_example; // String | The user name for login var password = password_example; // String | The password for login in clear text @@ -276,7 +276,7 @@ Logs out current logged in user session ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); +var api_instance = UserApi(); try { api_instance.logoutUser(); @@ -314,9 +314,9 @@ This can only be done by the logged in user. ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); +var api_instance = UserApi(); var username = username_example; // String | name that need to be deleted -var body = new User(); // User | Updated user object +var body = User(); // User | Updated user object try { api_instance.updateUser(username, body); diff --git a/samples/client/petstore/dart2/openapi-browser-client/lib/api/pet_api.dart b/samples/client/petstore/dart2/openapi-browser-client/lib/api/pet_api.dart index 9670db26fef..35416e655ed 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/lib/api/pet_api.dart +++ b/samples/client/petstore/dart2/openapi-browser-client/lib/api/pet_api.dart @@ -15,7 +15,7 @@ class PetApi { // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -33,7 +33,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -50,7 +50,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -64,7 +64,7 @@ class PetApi { // verify required params are set if(petId == null) { - throw new ApiException(400, "Missing required param: petId"); + throw ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -83,7 +83,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -100,7 +100,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -114,7 +114,7 @@ class PetApi { // verify required params are set if(status == null) { - throw new ApiException(400, "Missing required param: status"); + throw ApiException(400, "Missing required param: status"); } // create path and map variables @@ -133,7 +133,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -150,7 +150,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List).map((item) => item as Pet).toList(); } else { @@ -165,7 +165,7 @@ class PetApi { // verify required params are set if(tags == null) { - throw new ApiException(400, "Missing required param: tags"); + throw ApiException(400, "Missing required param: tags"); } // create path and map variables @@ -184,7 +184,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -201,7 +201,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List).map((item) => item as Pet).toList(); } else { @@ -216,7 +216,7 @@ class PetApi { // verify required params are set if(petId == null) { - throw new ApiException(400, "Missing required param: petId"); + throw ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -234,7 +234,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -251,7 +251,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'Pet') as Pet; } else { @@ -266,7 +266,7 @@ class PetApi { // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -284,7 +284,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -301,7 +301,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -315,7 +315,7 @@ class PetApi { // verify required params are set if(petId == null) { - throw new ApiException(400, "Missing required param: petId"); + throw ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -333,7 +333,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if (name != null) { hasFields = true; mp.fields['name'] = parameterToString(name); @@ -362,7 +362,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -376,7 +376,7 @@ class PetApi { // verify required params are set if(petId == null) { - throw new ApiException(400, "Missing required param: petId"); + throw ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -394,7 +394,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if (additionalMetadata != null) { hasFields = true; mp.fields['additionalMetadata'] = parameterToString(additionalMetadata); @@ -422,7 +422,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'ApiResponse') as ApiResponse; } else { diff --git a/samples/client/petstore/dart2/openapi-browser-client/lib/api/store_api.dart b/samples/client/petstore/dart2/openapi-browser-client/lib/api/store_api.dart index 1296576d4a0..59e59725ec6 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/lib/api/store_api.dart +++ b/samples/client/petstore/dart2/openapi-browser-client/lib/api/store_api.dart @@ -15,7 +15,7 @@ class StoreApi { // verify required params are set if(orderId == null) { - throw new ApiException(400, "Missing required param: orderId"); + throw ApiException(400, "Missing required param: orderId"); } // create path and map variables @@ -33,7 +33,7 @@ class StoreApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -50,7 +50,7 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -79,7 +79,7 @@ class StoreApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -96,9 +96,9 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { - return new Map.from(apiClient.deserialize(_decodeBodyBytes(response), 'Map')); + return Map.from(apiClient.deserialize(_decodeBodyBytes(response), 'Map')); ; } else { return null; @@ -112,7 +112,7 @@ class StoreApi { // verify required params are set if(orderId == null) { - throw new ApiException(400, "Missing required param: orderId"); + throw ApiException(400, "Missing required param: orderId"); } // create path and map variables @@ -130,7 +130,7 @@ class StoreApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -147,7 +147,7 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'Order') as Order; } else { @@ -162,7 +162,7 @@ class StoreApi { // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -180,7 +180,7 @@ class StoreApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -197,7 +197,7 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'Order') as Order; } else { diff --git a/samples/client/petstore/dart2/openapi-browser-client/lib/api/user_api.dart b/samples/client/petstore/dart2/openapi-browser-client/lib/api/user_api.dart index 4ad3021a1fa..475f0655b95 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/lib/api/user_api.dart +++ b/samples/client/petstore/dart2/openapi-browser-client/lib/api/user_api.dart @@ -15,7 +15,7 @@ class UserApi { // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -33,7 +33,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -50,7 +50,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -64,7 +64,7 @@ class UserApi { // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -82,7 +82,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -99,7 +99,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -113,7 +113,7 @@ class UserApi { // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -131,7 +131,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -148,7 +148,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -162,7 +162,7 @@ class UserApi { // verify required params are set if(username == null) { - throw new ApiException(400, "Missing required param: username"); + throw ApiException(400, "Missing required param: username"); } // create path and map variables @@ -180,7 +180,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -197,7 +197,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -211,7 +211,7 @@ class UserApi { // verify required params are set if(username == null) { - throw new ApiException(400, "Missing required param: username"); + throw ApiException(400, "Missing required param: username"); } // create path and map variables @@ -229,7 +229,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -246,7 +246,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'User') as User; } else { @@ -261,10 +261,10 @@ class UserApi { // verify required params are set if(username == null) { - throw new ApiException(400, "Missing required param: username"); + throw ApiException(400, "Missing required param: username"); } if(password == null) { - throw new ApiException(400, "Missing required param: password"); + throw ApiException(400, "Missing required param: password"); } // create path and map variables @@ -284,7 +284,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -301,7 +301,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; } else { @@ -331,7 +331,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -348,7 +348,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -362,10 +362,10 @@ class UserApi { // verify required params are set if(username == null) { - throw new ApiException(400, "Missing required param: username"); + throw ApiException(400, "Missing required param: username"); } if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -383,7 +383,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -400,7 +400,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; diff --git a/samples/client/petstore/dart2/openapi-browser-client/lib/model/api_response.dart b/samples/client/petstore/dart2/openapi-browser-client/lib/model/api_response.dart index 3d37ea21577..be01c2de819 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/lib/model/api_response.dart +++ b/samples/client/petstore/dart2/openapi-browser-client/lib/model/api_response.dart @@ -45,13 +45,13 @@ class ApiResponse { } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new ApiResponse.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => ApiResponse.fromJson(value)).toList(); } static Map mapFromJson(Map json) { - var map = new Map(); + var map = Map(); if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new ApiResponse.fromJson(value)); + json.forEach((String key, dynamic value) => map[key] = ApiResponse.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart2/openapi-browser-client/lib/model/category.dart b/samples/client/petstore/dart2/openapi-browser-client/lib/model/category.dart index 32a7c1e81aa..696468a1619 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/lib/model/category.dart +++ b/samples/client/petstore/dart2/openapi-browser-client/lib/model/category.dart @@ -36,13 +36,13 @@ class Category { } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Category.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => Category.fromJson(value)).toList(); } static Map mapFromJson(Map json) { - var map = new Map(); + var map = Map(); if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new Category.fromJson(value)); + json.forEach((String key, dynamic value) => map[key] = Category.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart2/openapi-browser-client/lib/model/order.dart b/samples/client/petstore/dart2/openapi-browser-client/lib/model/order.dart index c3966e6f9f2..be5a12e1ed1 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/lib/model/order.dart +++ b/samples/client/petstore/dart2/openapi-browser-client/lib/model/order.dart @@ -73,13 +73,13 @@ class Order { } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Order.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => Order.fromJson(value)).toList(); } static Map mapFromJson(Map json) { - var map = new Map(); + var map = Map(); if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new Order.fromJson(value)); + json.forEach((String key, dynamic value) => map[key] = Order.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart2/openapi-browser-client/lib/model/pet.dart b/samples/client/petstore/dart2/openapi-browser-client/lib/model/pet.dart index d8bdd2ef407..4f19829878a 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/lib/model/pet.dart +++ b/samples/client/petstore/dart2/openapi-browser-client/lib/model/pet.dart @@ -31,7 +31,7 @@ class Pet { if (json['category'] == null) { category = null; } else { - category = new Category.fromJson(json['category']); + category = Category.fromJson(json['category']); } if (json['name'] == null) { name = null; @@ -73,13 +73,13 @@ class Pet { } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Pet.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => Pet.fromJson(value)).toList(); } static Map mapFromJson(Map json) { - var map = new Map(); + var map = Map(); if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new Pet.fromJson(value)); + json.forEach((String key, dynamic value) => map[key] = Pet.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart2/openapi-browser-client/lib/model/tag.dart b/samples/client/petstore/dart2/openapi-browser-client/lib/model/tag.dart index ca53c8ae890..a3485e5d3c6 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/lib/model/tag.dart +++ b/samples/client/petstore/dart2/openapi-browser-client/lib/model/tag.dart @@ -36,13 +36,13 @@ class Tag { } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Tag.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => Tag.fromJson(value)).toList(); } static Map mapFromJson(Map json) { - var map = new Map(); + var map = Map(); if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new Tag.fromJson(value)); + json.forEach((String key, dynamic value) => map[key] = Tag.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart2/openapi-browser-client/lib/model/user.dart b/samples/client/petstore/dart2/openapi-browser-client/lib/model/user.dart index 1c5ef51fbaa..48f061d969b 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/lib/model/user.dart +++ b/samples/client/petstore/dart2/openapi-browser-client/lib/model/user.dart @@ -90,13 +90,13 @@ class User { } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new User.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => User.fromJson(value)).toList(); } static Map mapFromJson(Map json) { - var map = new Map(); + var map = Map(); if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new User.fromJson(value)); + json.forEach((String key, dynamic value) => map[key] = User.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/api_response_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/api_response_test.dart index ebf142904e9..afd92edde06 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/test/api_response_test.dart +++ b/samples/client/petstore/dart2/openapi-browser-client/test/api_response_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for ApiResponse void main() { - var instance = new Pet(); + var instance = ApiResponse(); group('test ApiResponse', () { // int code (default value: null) diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/category_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/category_test.dart index c5cea4b5bc3..ed39fa7ed8a 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/test/category_test.dart +++ b/samples/client/petstore/dart2/openapi-browser-client/test/category_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for Category void main() { - var instance = new Pet(); + var instance = Category(); group('test Category', () { // int id (default value: null) diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/order_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/order_test.dart index 9982020d8cf..6102e1e5d08 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/test/order_test.dart +++ b/samples/client/petstore/dart2/openapi-browser-client/test/order_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for Order void main() { - var instance = new Pet(); + var instance = Order(); group('test Order', () { // int id (default value: null) diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/pet_api_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/pet_api_test.dart index fa95dccad3c..409b7962536 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/test/pet_api_test.dart +++ b/samples/client/petstore/dart2/openapi-browser-client/test/pet_api_test.dart @@ -4,7 +4,7 @@ import 'package:test/test.dart'; /// tests for PetApi void main() { - var instance = new PetApi(); + var instance = PetApi(); group('tests for PetApi', () { // Add a new pet to the store diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/pet_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/pet_test.dart index cfd94b9e36c..83480bd785e 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/test/pet_test.dart +++ b/samples/client/petstore/dart2/openapi-browser-client/test/pet_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for Pet void main() { - var instance = new Pet(); + var instance = Pet(); group('test Pet', () { // int id (default value: null) diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/store_api_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/store_api_test.dart index 496d051e833..e2c7ab94b17 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/test/store_api_test.dart +++ b/samples/client/petstore/dart2/openapi-browser-client/test/store_api_test.dart @@ -4,7 +4,7 @@ import 'package:test/test.dart'; /// tests for StoreApi void main() { - var instance = new StoreApi(); + var instance = StoreApi(); group('tests for StoreApi', () { // Delete purchase order by ID diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/tag_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/tag_test.dart index 6ee16c51bba..3333ea6d310 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/test/tag_test.dart +++ b/samples/client/petstore/dart2/openapi-browser-client/test/tag_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for Tag void main() { - var instance = new Pet(); + var instance = Tag(); group('test Tag', () { // int id (default value: null) diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/user_api_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/user_api_test.dart index f040b01bf43..5d124a61117 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/test/user_api_test.dart +++ b/samples/client/petstore/dart2/openapi-browser-client/test/user_api_test.dart @@ -4,7 +4,7 @@ import 'package:test/test.dart'; /// tests for UserApi void main() { - var instance = new UserApi(); + var instance = UserApi(); group('tests for UserApi', () { // Create user diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/user_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/user_test.dart index 5a6340c4f4b..35e8eed3756 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/test/user_test.dart +++ b/samples/client/petstore/dart2/openapi-browser-client/test/user_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for User void main() { - var instance = new Pet(); + var instance = User(); group('test User', () { // int id (default value: null) diff --git a/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION index 06b5019af3f..83a328a9227 100644 --- a/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart2/openapi/README.md b/samples/client/petstore/dart2/openapi/README.md index 45fe0858b2d..e78e0e3e697 100644 --- a/samples/client/petstore/dart2/openapi/README.md +++ b/samples/client/petstore/dart2/openapi/README.md @@ -46,8 +46,8 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = PetApi(); +var body = Pet(); // Pet | Pet object that needs to be added to the store try { api_instance.addPet(body); diff --git a/samples/client/petstore/dart2/openapi/docs/PetApi.md b/samples/client/petstore/dart2/openapi/docs/PetApi.md index 3ec1113828c..7b5de3894a9 100644 --- a/samples/client/petstore/dart2/openapi/docs/PetApi.md +++ b/samples/client/petstore/dart2/openapi/docs/PetApi.md @@ -30,8 +30,8 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = PetApi(); +var body = Pet(); // Pet | Pet object that needs to be added to the store try { api_instance.addPet(body); @@ -72,7 +72,7 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var petId = 789; // int | Pet id to delete var apiKey = apiKey_example; // String | @@ -118,7 +118,7 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var status = []; // List | Status values that need to be considered for filter try { @@ -163,7 +163,7 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var tags = []; // List | Tags to filter by try { @@ -210,7 +210,7 @@ import 'package:openapi/api.dart'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed //defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var petId = 789; // int | ID of pet to return try { @@ -253,8 +253,8 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = PetApi(); +var body = Pet(); // Pet | Pet object that needs to be added to the store try { api_instance.updatePet(body); @@ -295,7 +295,7 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var petId = 789; // int | ID of pet that needs to be updated var name = name_example; // String | Updated name of the pet var status = status_example; // String | Updated status of the pet @@ -341,7 +341,7 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var petId = 789; // int | ID of pet to update var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server var file = BINARY_DATA_HERE; // MultipartFile | file to upload diff --git a/samples/client/petstore/dart2/openapi/docs/StoreApi.md b/samples/client/petstore/dart2/openapi/docs/StoreApi.md index f3a5e0aba87..1cc37e2a47a 100644 --- a/samples/client/petstore/dart2/openapi/docs/StoreApi.md +++ b/samples/client/petstore/dart2/openapi/docs/StoreApi.md @@ -26,7 +26,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ```dart import 'package:openapi/api.dart'; -var api_instance = new StoreApi(); +var api_instance = StoreApi(); var orderId = orderId_example; // String | ID of the order that needs to be deleted try { @@ -72,7 +72,7 @@ import 'package:openapi/api.dart'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed //defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; -var api_instance = new StoreApi(); +var api_instance = StoreApi(); try { var result = api_instance.getInventory(); @@ -111,7 +111,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ```dart import 'package:openapi/api.dart'; -var api_instance = new StoreApi(); +var api_instance = StoreApi(); var orderId = 789; // int | ID of pet that needs to be fetched try { @@ -152,8 +152,8 @@ Place an order for a pet ```dart import 'package:openapi/api.dart'; -var api_instance = new StoreApi(); -var body = new Order(); // Order | order placed for purchasing the pet +var api_instance = StoreApi(); +var body = Order(); // Order | order placed for purchasing the pet try { var result = api_instance.placeOrder(body); diff --git a/samples/client/petstore/dart2/openapi/docs/UserApi.md b/samples/client/petstore/dart2/openapi/docs/UserApi.md index 5e0605c6ea0..1ee5f6fced6 100644 --- a/samples/client/petstore/dart2/openapi/docs/UserApi.md +++ b/samples/client/petstore/dart2/openapi/docs/UserApi.md @@ -30,8 +30,8 @@ This can only be done by the logged in user. ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); -var body = new User(); // User | Created user object +var api_instance = UserApi(); +var body = User(); // User | Created user object try { api_instance.createUser(body); @@ -70,8 +70,8 @@ Creates list of users with given input array ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); -var body = [new List<User>()]; // List | List of user object +var api_instance = UserApi(); +var body = [List<User>()]; // List | List of user object try { api_instance.createUsersWithArrayInput(body); @@ -84,7 +84,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -110,8 +110,8 @@ Creates list of users with given input array ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); -var body = [new List<User>()]; // List | List of user object +var api_instance = UserApi(); +var body = [List<User>()]; // List | List of user object try { api_instance.createUsersWithListInput(body); @@ -124,7 +124,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -152,7 +152,7 @@ This can only be done by the logged in user. ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); +var api_instance = UserApi(); var username = username_example; // String | The name that needs to be deleted try { @@ -192,7 +192,7 @@ Get user by user name ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); +var api_instance = UserApi(); var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. try { @@ -233,7 +233,7 @@ Logs user into the system ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); +var api_instance = UserApi(); var username = username_example; // String | The user name for login var password = password_example; // String | The password for login in clear text @@ -276,7 +276,7 @@ Logs out current logged in user session ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); +var api_instance = UserApi(); try { api_instance.logoutUser(); @@ -314,9 +314,9 @@ This can only be done by the logged in user. ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); +var api_instance = UserApi(); var username = username_example; // String | name that need to be deleted -var body = new User(); // User | Updated user object +var body = User(); // User | Updated user object try { api_instance.updateUser(username, body); diff --git a/samples/client/petstore/dart2/openapi/lib/api/pet_api.dart b/samples/client/petstore/dart2/openapi/lib/api/pet_api.dart index 9670db26fef..35416e655ed 100644 --- a/samples/client/petstore/dart2/openapi/lib/api/pet_api.dart +++ b/samples/client/petstore/dart2/openapi/lib/api/pet_api.dart @@ -15,7 +15,7 @@ class PetApi { // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -33,7 +33,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -50,7 +50,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -64,7 +64,7 @@ class PetApi { // verify required params are set if(petId == null) { - throw new ApiException(400, "Missing required param: petId"); + throw ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -83,7 +83,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -100,7 +100,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -114,7 +114,7 @@ class PetApi { // verify required params are set if(status == null) { - throw new ApiException(400, "Missing required param: status"); + throw ApiException(400, "Missing required param: status"); } // create path and map variables @@ -133,7 +133,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -150,7 +150,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List).map((item) => item as Pet).toList(); } else { @@ -165,7 +165,7 @@ class PetApi { // verify required params are set if(tags == null) { - throw new ApiException(400, "Missing required param: tags"); + throw ApiException(400, "Missing required param: tags"); } // create path and map variables @@ -184,7 +184,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -201,7 +201,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List).map((item) => item as Pet).toList(); } else { @@ -216,7 +216,7 @@ class PetApi { // verify required params are set if(petId == null) { - throw new ApiException(400, "Missing required param: petId"); + throw ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -234,7 +234,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -251,7 +251,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'Pet') as Pet; } else { @@ -266,7 +266,7 @@ class PetApi { // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -284,7 +284,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -301,7 +301,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -315,7 +315,7 @@ class PetApi { // verify required params are set if(petId == null) { - throw new ApiException(400, "Missing required param: petId"); + throw ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -333,7 +333,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if (name != null) { hasFields = true; mp.fields['name'] = parameterToString(name); @@ -362,7 +362,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -376,7 +376,7 @@ class PetApi { // verify required params are set if(petId == null) { - throw new ApiException(400, "Missing required param: petId"); + throw ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -394,7 +394,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if (additionalMetadata != null) { hasFields = true; mp.fields['additionalMetadata'] = parameterToString(additionalMetadata); @@ -422,7 +422,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'ApiResponse') as ApiResponse; } else { diff --git a/samples/client/petstore/dart2/openapi/lib/api/store_api.dart b/samples/client/petstore/dart2/openapi/lib/api/store_api.dart index 1296576d4a0..59e59725ec6 100644 --- a/samples/client/petstore/dart2/openapi/lib/api/store_api.dart +++ b/samples/client/petstore/dart2/openapi/lib/api/store_api.dart @@ -15,7 +15,7 @@ class StoreApi { // verify required params are set if(orderId == null) { - throw new ApiException(400, "Missing required param: orderId"); + throw ApiException(400, "Missing required param: orderId"); } // create path and map variables @@ -33,7 +33,7 @@ class StoreApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -50,7 +50,7 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -79,7 +79,7 @@ class StoreApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -96,9 +96,9 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { - return new Map.from(apiClient.deserialize(_decodeBodyBytes(response), 'Map')); + return Map.from(apiClient.deserialize(_decodeBodyBytes(response), 'Map')); ; } else { return null; @@ -112,7 +112,7 @@ class StoreApi { // verify required params are set if(orderId == null) { - throw new ApiException(400, "Missing required param: orderId"); + throw ApiException(400, "Missing required param: orderId"); } // create path and map variables @@ -130,7 +130,7 @@ class StoreApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -147,7 +147,7 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'Order') as Order; } else { @@ -162,7 +162,7 @@ class StoreApi { // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -180,7 +180,7 @@ class StoreApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -197,7 +197,7 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'Order') as Order; } else { diff --git a/samples/client/petstore/dart2/openapi/lib/api/user_api.dart b/samples/client/petstore/dart2/openapi/lib/api/user_api.dart index 4ad3021a1fa..475f0655b95 100644 --- a/samples/client/petstore/dart2/openapi/lib/api/user_api.dart +++ b/samples/client/petstore/dart2/openapi/lib/api/user_api.dart @@ -15,7 +15,7 @@ class UserApi { // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -33,7 +33,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -50,7 +50,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -64,7 +64,7 @@ class UserApi { // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -82,7 +82,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -99,7 +99,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -113,7 +113,7 @@ class UserApi { // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -131,7 +131,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -148,7 +148,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -162,7 +162,7 @@ class UserApi { // verify required params are set if(username == null) { - throw new ApiException(400, "Missing required param: username"); + throw ApiException(400, "Missing required param: username"); } // create path and map variables @@ -180,7 +180,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -197,7 +197,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -211,7 +211,7 @@ class UserApi { // verify required params are set if(username == null) { - throw new ApiException(400, "Missing required param: username"); + throw ApiException(400, "Missing required param: username"); } // create path and map variables @@ -229,7 +229,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -246,7 +246,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'User') as User; } else { @@ -261,10 +261,10 @@ class UserApi { // verify required params are set if(username == null) { - throw new ApiException(400, "Missing required param: username"); + throw ApiException(400, "Missing required param: username"); } if(password == null) { - throw new ApiException(400, "Missing required param: password"); + throw ApiException(400, "Missing required param: password"); } // create path and map variables @@ -284,7 +284,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -301,7 +301,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; } else { @@ -331,7 +331,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -348,7 +348,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -362,10 +362,10 @@ class UserApi { // verify required params are set if(username == null) { - throw new ApiException(400, "Missing required param: username"); + throw ApiException(400, "Missing required param: username"); } if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -383,7 +383,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -400,7 +400,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; diff --git a/samples/client/petstore/dart2/openapi/lib/model/api_response.dart b/samples/client/petstore/dart2/openapi/lib/model/api_response.dart index 3d37ea21577..be01c2de819 100644 --- a/samples/client/petstore/dart2/openapi/lib/model/api_response.dart +++ b/samples/client/petstore/dart2/openapi/lib/model/api_response.dart @@ -45,13 +45,13 @@ class ApiResponse { } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new ApiResponse.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => ApiResponse.fromJson(value)).toList(); } static Map mapFromJson(Map json) { - var map = new Map(); + var map = Map(); if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new ApiResponse.fromJson(value)); + json.forEach((String key, dynamic value) => map[key] = ApiResponse.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart2/openapi/lib/model/category.dart b/samples/client/petstore/dart2/openapi/lib/model/category.dart index 32a7c1e81aa..696468a1619 100644 --- a/samples/client/petstore/dart2/openapi/lib/model/category.dart +++ b/samples/client/petstore/dart2/openapi/lib/model/category.dart @@ -36,13 +36,13 @@ class Category { } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Category.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => Category.fromJson(value)).toList(); } static Map mapFromJson(Map json) { - var map = new Map(); + var map = Map(); if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new Category.fromJson(value)); + json.forEach((String key, dynamic value) => map[key] = Category.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart2/openapi/lib/model/order.dart b/samples/client/petstore/dart2/openapi/lib/model/order.dart index c3966e6f9f2..be5a12e1ed1 100644 --- a/samples/client/petstore/dart2/openapi/lib/model/order.dart +++ b/samples/client/petstore/dart2/openapi/lib/model/order.dart @@ -73,13 +73,13 @@ class Order { } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Order.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => Order.fromJson(value)).toList(); } static Map mapFromJson(Map json) { - var map = new Map(); + var map = Map(); if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new Order.fromJson(value)); + json.forEach((String key, dynamic value) => map[key] = Order.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart2/openapi/lib/model/pet.dart b/samples/client/petstore/dart2/openapi/lib/model/pet.dart index d8bdd2ef407..4f19829878a 100644 --- a/samples/client/petstore/dart2/openapi/lib/model/pet.dart +++ b/samples/client/petstore/dart2/openapi/lib/model/pet.dart @@ -31,7 +31,7 @@ class Pet { if (json['category'] == null) { category = null; } else { - category = new Category.fromJson(json['category']); + category = Category.fromJson(json['category']); } if (json['name'] == null) { name = null; @@ -73,13 +73,13 @@ class Pet { } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Pet.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => Pet.fromJson(value)).toList(); } static Map mapFromJson(Map json) { - var map = new Map(); + var map = Map(); if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new Pet.fromJson(value)); + json.forEach((String key, dynamic value) => map[key] = Pet.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart2/openapi/lib/model/tag.dart b/samples/client/petstore/dart2/openapi/lib/model/tag.dart index ca53c8ae890..a3485e5d3c6 100644 --- a/samples/client/petstore/dart2/openapi/lib/model/tag.dart +++ b/samples/client/petstore/dart2/openapi/lib/model/tag.dart @@ -36,13 +36,13 @@ class Tag { } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Tag.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => Tag.fromJson(value)).toList(); } static Map mapFromJson(Map json) { - var map = new Map(); + var map = Map(); if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new Tag.fromJson(value)); + json.forEach((String key, dynamic value) => map[key] = Tag.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart2/openapi/lib/model/user.dart b/samples/client/petstore/dart2/openapi/lib/model/user.dart index 1c5ef51fbaa..48f061d969b 100644 --- a/samples/client/petstore/dart2/openapi/lib/model/user.dart +++ b/samples/client/petstore/dart2/openapi/lib/model/user.dart @@ -90,13 +90,13 @@ class User { } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new User.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => User.fromJson(value)).toList(); } static Map mapFromJson(Map json) { - var map = new Map(); + var map = Map(); if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new User.fromJson(value)); + json.forEach((String key, dynamic value) => map[key] = User.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart2/openapi/test/api_response_test.dart b/samples/client/petstore/dart2/openapi/test/api_response_test.dart index ebf142904e9..afd92edde06 100644 --- a/samples/client/petstore/dart2/openapi/test/api_response_test.dart +++ b/samples/client/petstore/dart2/openapi/test/api_response_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for ApiResponse void main() { - var instance = new Pet(); + var instance = ApiResponse(); group('test ApiResponse', () { // int code (default value: null) diff --git a/samples/client/petstore/dart2/openapi/test/category_test.dart b/samples/client/petstore/dart2/openapi/test/category_test.dart index c5cea4b5bc3..ed39fa7ed8a 100644 --- a/samples/client/petstore/dart2/openapi/test/category_test.dart +++ b/samples/client/petstore/dart2/openapi/test/category_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for Category void main() { - var instance = new Pet(); + var instance = Category(); group('test Category', () { // int id (default value: null) diff --git a/samples/client/petstore/dart2/openapi/test/order_test.dart b/samples/client/petstore/dart2/openapi/test/order_test.dart index 9982020d8cf..6102e1e5d08 100644 --- a/samples/client/petstore/dart2/openapi/test/order_test.dart +++ b/samples/client/petstore/dart2/openapi/test/order_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for Order void main() { - var instance = new Pet(); + var instance = Order(); group('test Order', () { // int id (default value: null) diff --git a/samples/client/petstore/dart2/openapi/test/pet_api_test.dart b/samples/client/petstore/dart2/openapi/test/pet_api_test.dart index fa95dccad3c..409b7962536 100644 --- a/samples/client/petstore/dart2/openapi/test/pet_api_test.dart +++ b/samples/client/petstore/dart2/openapi/test/pet_api_test.dart @@ -4,7 +4,7 @@ import 'package:test/test.dart'; /// tests for PetApi void main() { - var instance = new PetApi(); + var instance = PetApi(); group('tests for PetApi', () { // Add a new pet to the store diff --git a/samples/client/petstore/dart2/openapi/test/pet_test.dart b/samples/client/petstore/dart2/openapi/test/pet_test.dart index cfd94b9e36c..83480bd785e 100644 --- a/samples/client/petstore/dart2/openapi/test/pet_test.dart +++ b/samples/client/petstore/dart2/openapi/test/pet_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for Pet void main() { - var instance = new Pet(); + var instance = Pet(); group('test Pet', () { // int id (default value: null) diff --git a/samples/client/petstore/dart2/openapi/test/store_api_test.dart b/samples/client/petstore/dart2/openapi/test/store_api_test.dart index 496d051e833..e2c7ab94b17 100644 --- a/samples/client/petstore/dart2/openapi/test/store_api_test.dart +++ b/samples/client/petstore/dart2/openapi/test/store_api_test.dart @@ -4,7 +4,7 @@ import 'package:test/test.dart'; /// tests for StoreApi void main() { - var instance = new StoreApi(); + var instance = StoreApi(); group('tests for StoreApi', () { // Delete purchase order by ID diff --git a/samples/client/petstore/dart2/openapi/test/tag_test.dart b/samples/client/petstore/dart2/openapi/test/tag_test.dart index 6ee16c51bba..3333ea6d310 100644 --- a/samples/client/petstore/dart2/openapi/test/tag_test.dart +++ b/samples/client/petstore/dart2/openapi/test/tag_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for Tag void main() { - var instance = new Pet(); + var instance = Tag(); group('test Tag', () { // int id (default value: null) diff --git a/samples/client/petstore/dart2/openapi/test/user_api_test.dart b/samples/client/petstore/dart2/openapi/test/user_api_test.dart index f040b01bf43..5d124a61117 100644 --- a/samples/client/petstore/dart2/openapi/test/user_api_test.dart +++ b/samples/client/petstore/dart2/openapi/test/user_api_test.dart @@ -4,7 +4,7 @@ import 'package:test/test.dart'; /// tests for UserApi void main() { - var instance = new UserApi(); + var instance = UserApi(); group('tests for UserApi', () { // Create user diff --git a/samples/client/petstore/dart2/openapi/test/user_test.dart b/samples/client/petstore/dart2/openapi/test/user_test.dart index 5a6340c4f4b..35e8eed3756 100644 --- a/samples/client/petstore/dart2/openapi/test/user_test.dart +++ b/samples/client/petstore/dart2/openapi/test/user_test.dart @@ -3,7 +3,7 @@ import 'package:test/test.dart'; // tests for User void main() { - var instance = new Pet(); + var instance = User(); group('test User', () { // int id (default value: null) From 36dd8484400f36b7a6fe0d5afe4f0e99319045ea Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 9 Aug 2019 00:17:24 +0800 Subject: [PATCH 64/75] [OCaml] Add file post-processing (#3583) * post process file in ocaml, remove unused sample * auto-format ocaml petstore * revert formatting * remove openapi3 ocaml client --- .../AbstractTypeScriptClientCodegen.java | 3 +- .../codegen/languages/OCamlClientCodegen.java | 43 +++++- .../ocaml-client/.openapi-generator-ignore | 23 --- .../ocaml-client/.openapi-generator/VERSION | 1 - samples/client/petstore/ocaml-client/bin/dune | 6 - .../client/petstore/ocaml-client/bin/test.ml | 19 --- samples/client/petstore/ocaml-client/dune | 9 -- .../client/petstore/ocaml-client/dune-project | 2 - .../ocaml-client/petstore_client.opam | 15 -- .../petstore/ocaml-client/src/apis/pet_api.ml | 80 ---------- .../ocaml-client/src/apis/pet_api.mli | 15 -- .../ocaml-client/src/apis/store_api.ml | 38 ----- .../ocaml-client/src/apis/store_api.mli | 11 -- .../ocaml-client/src/apis/user_api.ml | 72 --------- .../ocaml-client/src/apis/user_api.mli | 15 -- .../ocaml-client/src/models/api_response.ml | 21 --- .../ocaml-client/src/models/category.ml | 19 --- .../petstore/ocaml-client/src/models/order.ml | 28 ---- .../petstore/ocaml-client/src/models/pet.ml | 28 ---- .../petstore/ocaml-client/src/models/tag.ml | 19 --- .../petstore/ocaml-client/src/models/user.ml | 32 ---- .../ocaml-client/src/support/enums.ml | 30 ---- .../ocaml-client/src/support/jsonSupport.ml | 55 ------- .../ocaml-client/src/support/request.ml | 48 ------ .../ocaml-client/.openapi-generator-ignore | 23 --- .../ocaml-client/.openapi-generator/VERSION | 1 - .../client/petstore/ocaml-client/dune | 9 -- .../client/petstore/ocaml-client/dune-project | 2 - .../ocaml-client/petstore_client.opam | 15 -- .../ocaml-client/src/apis/another_fake_api.ml | 15 -- .../src/apis/another_fake_api.mli | 8 - .../ocaml-client/src/apis/default_api.ml | 14 -- .../ocaml-client/src/apis/default_api.mli | 8 - .../ocaml-client/src/apis/fake_api.ml | 136 ----------------- .../ocaml-client/src/apis/fake_api.mli | 20 --- .../src/apis/fake_classname_tags123_api.ml | 15 -- .../src/apis/fake_classname_tags123_api.mli | 8 - .../petstore/ocaml-client/src/apis/pet_api.ml | 88 ----------- .../ocaml-client/src/apis/pet_api.mli | 16 -- .../ocaml-client/src/apis/store_api.ml | 37 ----- .../ocaml-client/src/apis/store_api.mli | 11 -- .../ocaml-client/src/apis/user_api.ml | 66 -------- .../ocaml-client/src/apis/user_api.mli | 15 -- .../src/models/additional_properties_class.ml | 17 --- .../ocaml-client/src/models/animal.ml | 17 --- .../ocaml-client/src/models/api_response.ml | 19 --- .../models/array_of_array_of_number_only.ml | 15 -- .../src/models/array_of_number_only.ml | 15 -- .../ocaml-client/src/models/array_test.ml | 19 --- .../ocaml-client/src/models/capitalization.ml | 26 ---- .../petstore/ocaml-client/src/models/cat.ml | 19 --- .../ocaml-client/src/models/cat_all_of.ml | 15 -- .../ocaml-client/src/models/category.ml | 17 --- .../ocaml-client/src/models/class_model.ml | 17 --- .../ocaml-client/src/models/client.ml | 15 -- .../petstore/ocaml-client/src/models/dog.ml | 19 --- .../ocaml-client/src/models/dog_all_of.ml | 15 -- .../ocaml-client/src/models/enum_arrays.ml | 17 --- .../ocaml-client/src/models/enum_test.ml | 29 ---- .../petstore/ocaml-client/src/models/file.ml | 18 --- .../src/models/file_schema_test_class.ml | 17 --- .../petstore/ocaml-client/src/models/foo.ml | 15 -- .../ocaml-client/src/models/format_test.ml | 45 ------ .../src/models/has_only_read_only.ml | 17 --- .../src/models/health_check_result.ml | 17 --- .../ocaml-client/src/models/inline_object.ml | 19 --- .../src/models/inline_object_1.ml | 19 --- .../src/models/inline_object_2.ml | 19 --- .../src/models/inline_object_3.ml | 55 ------- .../src/models/inline_object_4.ml | 19 --- .../src/models/inline_object_5.ml | 19 --- .../src/models/inline_response_default.ml | 15 -- .../ocaml-client/src/models/map_test.ml | 21 --- ...perties_and_additional_properties_class.ml | 19 --- .../src/models/model_200_response.ml | 19 --- .../src/models/model__special_model_name_.ml | 15 -- .../petstore/ocaml-client/src/models/name.ml | 23 --- .../ocaml-client/src/models/nullable_class.ml | 37 ----- .../ocaml-client/src/models/number_only.ml | 15 -- .../petstore/ocaml-client/src/models/order.ml | 26 ---- .../src/models/outer_composite.ml | 19 --- .../petstore/ocaml-client/src/models/pet.ml | 26 ---- .../src/models/read_only_first.ml | 17 --- .../ocaml-client/src/models/return.ml | 17 --- .../petstore/ocaml-client/src/models/tag.ml | 17 --- .../petstore/ocaml-client/src/models/user.ml | 30 ---- .../ocaml-client/src/support/enums.ml | 142 ------------------ .../ocaml-client/src/support/jsonSupport.ml | 55 ------- .../ocaml-client/src/support/request.ml | 39 ----- 89 files changed, 41 insertions(+), 2220 deletions(-) delete mode 100644 samples/client/petstore/ocaml-client/.openapi-generator-ignore delete mode 100644 samples/client/petstore/ocaml-client/.openapi-generator/VERSION delete mode 100644 samples/client/petstore/ocaml-client/bin/dune delete mode 100644 samples/client/petstore/ocaml-client/bin/test.ml delete mode 100644 samples/client/petstore/ocaml-client/dune delete mode 100644 samples/client/petstore/ocaml-client/dune-project delete mode 100644 samples/client/petstore/ocaml-client/petstore_client.opam delete mode 100644 samples/client/petstore/ocaml-client/src/apis/pet_api.ml delete mode 100644 samples/client/petstore/ocaml-client/src/apis/pet_api.mli delete mode 100644 samples/client/petstore/ocaml-client/src/apis/store_api.ml delete mode 100644 samples/client/petstore/ocaml-client/src/apis/store_api.mli delete mode 100644 samples/client/petstore/ocaml-client/src/apis/user_api.ml delete mode 100644 samples/client/petstore/ocaml-client/src/apis/user_api.mli delete mode 100644 samples/client/petstore/ocaml-client/src/models/api_response.ml delete mode 100644 samples/client/petstore/ocaml-client/src/models/category.ml delete mode 100644 samples/client/petstore/ocaml-client/src/models/order.ml delete mode 100644 samples/client/petstore/ocaml-client/src/models/pet.ml delete mode 100644 samples/client/petstore/ocaml-client/src/models/tag.ml delete mode 100644 samples/client/petstore/ocaml-client/src/models/user.ml delete mode 100644 samples/client/petstore/ocaml-client/src/support/enums.ml delete mode 100644 samples/client/petstore/ocaml-client/src/support/jsonSupport.ml delete mode 100644 samples/client/petstore/ocaml-client/src/support/request.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/.openapi-generator-ignore delete mode 100644 samples/openapi3/client/petstore/ocaml-client/.openapi-generator/VERSION delete mode 100644 samples/openapi3/client/petstore/ocaml-client/dune delete mode 100644 samples/openapi3/client/petstore/ocaml-client/dune-project delete mode 100644 samples/openapi3/client/petstore/ocaml-client/petstore_client.opam delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/another_fake_api.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/another_fake_api.mli delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/default_api.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/default_api.mli delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/fake_api.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/fake_api.mli delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/fake_classname_tags123_api.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/fake_classname_tags123_api.mli delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/pet_api.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/pet_api.mli delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/store_api.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/store_api.mli delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/user_api.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/apis/user_api.mli delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/additional_properties_class.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/animal.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/api_response.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/array_of_array_of_number_only.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/array_of_number_only.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/array_test.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/capitalization.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/cat.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/cat_all_of.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/category.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/class_model.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/client.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/dog.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/dog_all_of.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/enum_arrays.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/enum_test.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/file.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/file_schema_test_class.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/foo.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/format_test.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/has_only_read_only.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/health_check_result.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/inline_object.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_1.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_2.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_3.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_4.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_5.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/inline_response_default.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/map_test.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/mixed_properties_and_additional_properties_class.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/model_200_response.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/model__special_model_name_.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/name.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/nullable_class.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/number_only.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/order.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/outer_composite.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/pet.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/read_only_first.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/return.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/tag.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/models/user.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/support/enums.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/support/jsonSupport.ml delete mode 100644 samples/openapi3/client/petstore/ocaml-client/src/support/request.ml diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java index 95a12c1274c..1500a1405ce 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java @@ -148,8 +148,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp if (StringUtils.isEmpty(System.getenv("TS_POST_PROCESS_FILE"))) { LOGGER.info("Hint: Environment variable 'TS_POST_PROCESS_FILE' (optional) not defined. E.g. to format the source code, please try 'export TS_POST_PROCESS_FILE=\"/usr/local/bin/prettier --write\"' (Linux/Mac)"); LOGGER.info("Note: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); - } - else if (!this.isEnablePostProcessFile()) { + } else if (!this.isEnablePostProcessFile()) { LOGGER.info("Warning: Environment variable 'TS_POST_PROCESS_FILE' is set but file post-processing is not enabled. To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java index a1fc7753de3..feffa95ddd1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/OCamlClientCodegen.java @@ -22,9 +22,10 @@ import io.swagger.v3.oas.models.headers.Header; import io.swagger.v3.oas.models.media.*; import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.responses.ApiResponse; +import org.apache.commons.io.FilenameUtils; +import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.utils.ModelUtils; -import org.openapitools.codegen.utils.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -33,6 +34,7 @@ import java.util.*; import java.util.stream.Collectors; import static org.apache.commons.lang3.StringUtils.capitalize; +import static org.openapitools.codegen.utils.StringUtils.camelize; import static org.openapitools.codegen.utils.StringUtils.escape; import static org.openapitools.codegen.utils.StringUtils.underscore; @@ -409,6 +411,13 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig public void processOpts() { super.processOpts(); + if (StringUtils.isEmpty(System.getenv("OCAML_POST_PROCESS_FILE"))) { + LOGGER.info("Hint: Environment variable 'OCAML_POST_PROCESS_FILE' (optional) not defined. E.g. to format the source code, please try 'export OCAML_POST_PROCESS_FILE=\"ocamlformat -i --enable-outside-detected-project\"' (Linux/Mac)"); + LOGGER.info("Note: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); + } else if (!this.isEnablePostProcessFile()) { + LOGGER.info("Warning: Environment variable 'OCAML_POST_PROCESS_FILE' is set but file post-processing is not enabled. To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); + } + if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) { setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME)); } else { @@ -605,11 +614,11 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig // method name cannot use reserved keyword, e.g. return if (isReservedWord(sanitizedOperationId) || sanitizedOperationId.matches("^[0-9].*")) { - LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + StringUtils.underscore("call_" + operationId)); + LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + underscore("call_" + operationId)); sanitizedOperationId = "call_" + sanitizedOperationId; } - return StringUtils.underscore(sanitizedOperationId); + return underscore(sanitizedOperationId); } private Map allowableValues(String valueString) { @@ -754,4 +763,32 @@ public class OCamlClientCodegen extends DefaultCodegen implements CodegenConfig return null; } } + + @Override + public void postProcessFile(File file, String fileType) { + super.postProcessFile(file, fileType); + + if (file == null) { + return; + } + String ocamlPostProcessFile = System.getenv("OCAML_POST_PROCESS_FILE"); + if (StringUtils.isEmpty(ocamlPostProcessFile)) { + return; // skip if OCAML_POST_PROCESS_FILE env variable is not defined + } + // only process files with ml or mli extension + if ("ml".equals(FilenameUtils.getExtension(file.toString())) || "mli".equals(FilenameUtils.getExtension(file.toString()))) { + String command = ocamlPostProcessFile + " " + file.toString(); + try { + Process p = Runtime.getRuntime().exec(command); + int exitValue = p.waitFor(); + if (exitValue != 0) { + LOGGER.error("Error running the command ({}). Exit value: {}", command, exitValue); + } else { + LOGGER.info("Successfully executed: " + command); + } + } catch (Exception e) { + LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage()); + } + } + } } diff --git a/samples/client/petstore/ocaml-client/.openapi-generator-ignore b/samples/client/petstore/ocaml-client/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a3..00000000000 --- a/samples/client/petstore/ocaml-client/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/ocaml-client/.openapi-generator/VERSION b/samples/client/petstore/ocaml-client/.openapi-generator/VERSION deleted file mode 100644 index 717311e32e3..00000000000 --- a/samples/client/petstore/ocaml-client/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -unset \ No newline at end of file diff --git a/samples/client/petstore/ocaml-client/bin/dune b/samples/client/petstore/ocaml-client/bin/dune deleted file mode 100644 index 03e93b0036b..00000000000 --- a/samples/client/petstore/ocaml-client/bin/dune +++ /dev/null @@ -1,6 +0,0 @@ -(include_subdirs no) -(executable - (name test) - (libraries petstore_client) - (modules test) -) diff --git a/samples/client/petstore/ocaml-client/bin/test.ml b/samples/client/petstore/ocaml-client/bin/test.ml deleted file mode 100644 index 0fe314c1e72..00000000000 --- a/samples/client/petstore/ocaml-client/bin/test.ml +++ /dev/null @@ -1,19 +0,0 @@ -open Petstore_client -open Lwt - -let lift f r = Ppx_deriving_yojson_runtime.(>|=) r f - -let main () = - let p = Pet.create "Bob" [] in - Pet_api.add_pet p - -let find_pet () = - let pet_id = 9199424981609334637L in - Pet_api.get_pet_by_id pet_id >|= Pet.show >|= print_endline - -let find_pets_by_tags () = - let tags = ["dog"; "cat"] in - Pet_api.find_pets_by_tags tags >|= List.map Pet.show >|= List.map print_endline - -let _ = - Lwt_main.run (find_pets_by_tags ()) diff --git a/samples/client/petstore/ocaml-client/dune b/samples/client/petstore/ocaml-client/dune deleted file mode 100644 index ed1c4d90e3d..00000000000 --- a/samples/client/petstore/ocaml-client/dune +++ /dev/null @@ -1,9 +0,0 @@ -(include_subdirs unqualified) -(library - (name petstore_client) - (public_name petstore_client) - (flags (:standard -w -27)) - (libraries str cohttp-lwt-unix lwt yojson ppx_deriving_yojson.runtime) - (preprocess (pps ppx_deriving_yojson ppx_deriving.std)) - (wrapped true) -) \ No newline at end of file diff --git a/samples/client/petstore/ocaml-client/dune-project b/samples/client/petstore/ocaml-client/dune-project deleted file mode 100644 index 79d86e3c901..00000000000 --- a/samples/client/petstore/ocaml-client/dune-project +++ /dev/null @@ -1,2 +0,0 @@ -(lang dune 1.10) -(name petstore_client) \ No newline at end of file diff --git a/samples/client/petstore/ocaml-client/petstore_client.opam b/samples/client/petstore/ocaml-client/petstore_client.opam deleted file mode 100644 index 3c3603c2f14..00000000000 --- a/samples/client/petstore/ocaml-client/petstore_client.opam +++ /dev/null @@ -1,15 +0,0 @@ -opam-version: "2.0" -name: "petstore_client" -version: "1.0.0" -synopsis: "" -description: """ -Longer description -""" -maintainer: "Name " -authors: "Name " -license: "" -homepage: "" -bug-reports: "" -dev-repo: "" -depends: [ "ocaml" "ocamlfind" ] -build: ["dune" "build" "-p" name] \ No newline at end of file diff --git a/samples/client/petstore/ocaml-client/src/apis/pet_api.ml b/samples/client/petstore/ocaml-client/src/apis/pet_api.ml deleted file mode 100644 index 207503b9061..00000000000 --- a/samples/client/petstore/ocaml-client/src/apis/pet_api.ml +++ /dev/null @@ -1,80 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -let add_pet body = - let open Lwt in - let uri = Request.build_uri "/pet" in - let headers = Request.default_headers in - let body = Request.write_json_body Pet.to_yojson body in - Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> - Request.handle_unit_response resp - -let delete_pet pet_id api_key = - let open Lwt in - let uri = Request.build_uri "/pet/{petId}" in - let headers = Request.default_headers in - let headers = Cohttp.Header.add headers "api_key" (api_key) in - let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in - Cohttp_lwt_unix.Client.call `DELETE uri ~headers >>= fun (resp, body) -> - Request.handle_unit_response resp - -let find_pets_by_status status = - let open Lwt in - let uri = Request.build_uri "/pet/findByStatus" in - let headers = Request.default_headers in - let uri = Uri.add_query_param uri ("status", List.map Enums.show_pet_status status) in - Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> - Request.read_json_body_as_list_of (JsonSupport.unwrap Pet.of_yojson) resp body - -let find_pets_by_tags tags = - let open Lwt in - let uri = Request.build_uri "/pet/findByTags" in - let headers = Request.default_headers in - let uri = Uri.add_query_param uri ("tags", tags) in - Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> - Request.read_json_body_as_list_of (JsonSupport.unwrap Pet.of_yojson) resp body - -let get_pet_by_id pet_id = - let open Lwt in - let uri = Request.build_uri "/pet/{petId}" in - let headers = Request.default_headers in - let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in - Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap Pet.of_yojson) resp body - -let update_pet body = - let open Lwt in - let uri = Request.build_uri "/pet" in - let headers = Request.default_headers in - let body = Request.write_json_body Pet.to_yojson body in - Cohttp_lwt_unix.Client.call `PUT uri ~headers ~body >>= fun (resp, body) -> - Request.handle_unit_response resp - -let update_pet_with_form pet_id name status = - let open Lwt in - let uri = Request.build_uri "/pet/{petId}" in - let headers = Request.default_headers in - let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in - let body = Request.init_form_encoded_body () in - let body = Request.add_form_encoded_body_param body ("name", name) in - let body = Request.add_form_encoded_body_param body ("status", status) in - let body = Request.finalize_form_encoded_body body in - Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> - Request.handle_unit_response resp - -let upload_file pet_id additional_metadata file = - let open Lwt in - let uri = Request.build_uri "/pet/{petId}/uploadImage" in - let headers = Request.default_headers in - let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in - let body = Request.init_form_encoded_body () in - let body = Request.add_form_encoded_body_param body ("additional_metadata", additional_metadata) in - let body = Request.add_form_encoded_body_param body ("file", file) in - let body = Request.finalize_form_encoded_body body in - Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap Api_response.of_yojson) resp body - diff --git a/samples/client/petstore/ocaml-client/src/apis/pet_api.mli b/samples/client/petstore/ocaml-client/src/apis/pet_api.mli deleted file mode 100644 index 0cc31e085cf..00000000000 --- a/samples/client/petstore/ocaml-client/src/apis/pet_api.mli +++ /dev/null @@ -1,15 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -val add_pet : Pet.t -> unit Lwt.t -val delete_pet : int64 -> string -> unit Lwt.t -val find_pets_by_status : Enums.pet_status list -> Pet.t list Lwt.t -val find_pets_by_tags : string list -> Pet.t list Lwt.t -val get_pet_by_id : int64 -> Pet.t Lwt.t -val update_pet : Pet.t -> unit Lwt.t -val update_pet_with_form : int64 -> string -> string -> unit Lwt.t -val upload_file : int64 -> string -> string -> Api_response.t Lwt.t diff --git a/samples/client/petstore/ocaml-client/src/apis/store_api.ml b/samples/client/petstore/ocaml-client/src/apis/store_api.ml deleted file mode 100644 index cebccabdd85..00000000000 --- a/samples/client/petstore/ocaml-client/src/apis/store_api.ml +++ /dev/null @@ -1,38 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -let delete_order order_id = - let open Lwt in - let uri = Request.build_uri "/store/order/{orderId}" in - let headers = Request.default_headers in - let uri = Request.replace_path_param uri "orderId" (order_id) in - Cohttp_lwt_unix.Client.call `DELETE uri ~headers >>= fun (resp, body) -> - Request.handle_unit_response resp - -let get_inventory () = - let open Lwt in - let uri = Request.build_uri "/store/inventory" in - let headers = Request.default_headers in - Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> - Request.read_json_body_as_map_of (JsonSupport.to_int32) resp body - -let get_order_by_id order_id = - let open Lwt in - let uri = Request.build_uri "/store/order/{orderId}" in - let headers = Request.default_headers in - let uri = Request.replace_path_param uri "orderId" (Int64.to_string order_id) in - Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap Order.of_yojson) resp body - -let place_order body = - let open Lwt in - let uri = Request.build_uri "/store/order" in - let headers = Request.default_headers in - let body = Request.write_json_body Order.to_yojson body in - Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap Order.of_yojson) resp body - diff --git a/samples/client/petstore/ocaml-client/src/apis/store_api.mli b/samples/client/petstore/ocaml-client/src/apis/store_api.mli deleted file mode 100644 index bc3c93eb494..00000000000 --- a/samples/client/petstore/ocaml-client/src/apis/store_api.mli +++ /dev/null @@ -1,11 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -val delete_order : string -> unit Lwt.t -val get_inventory : unit -> (string * int32) list Lwt.t -val get_order_by_id : int64 -> Order.t Lwt.t -val place_order : Order.t -> Order.t Lwt.t diff --git a/samples/client/petstore/ocaml-client/src/apis/user_api.ml b/samples/client/petstore/ocaml-client/src/apis/user_api.ml deleted file mode 100644 index d05d71682a3..00000000000 --- a/samples/client/petstore/ocaml-client/src/apis/user_api.ml +++ /dev/null @@ -1,72 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -let create_user body = - let open Lwt in - let uri = Request.build_uri "/user" in - let headers = Request.default_headers in - let body = Request.write_json_body User.to_yojson body in - Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> - Request.handle_unit_response resp - -let create_users_with_array_input body = - let open Lwt in - let uri = Request.build_uri "/user/createWithArray" in - let headers = Request.default_headers in - let body = Request.write_json_body (JsonSupport.of_list_of User.to_yojson) body in - Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> - Request.handle_unit_response resp - -let create_users_with_list_input body = - let open Lwt in - let uri = Request.build_uri "/user/createWithList" in - let headers = Request.default_headers in - let body = Request.write_json_body (JsonSupport.of_list_of User.to_yojson) body in - Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> - Request.handle_unit_response resp - -let delete_user username = - let open Lwt in - let uri = Request.build_uri "/user/{username}" in - let headers = Request.default_headers in - let uri = Request.replace_path_param uri "username" (username) in - Cohttp_lwt_unix.Client.call `DELETE uri ~headers >>= fun (resp, body) -> - Request.handle_unit_response resp - -let get_user_by_name username = - let open Lwt in - let uri = Request.build_uri "/user/{username}" in - let headers = Request.default_headers in - let uri = Request.replace_path_param uri "username" (username) in - Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap User.of_yojson) resp body - -let login_user username password = - let open Lwt in - let uri = Request.build_uri "/user/login" in - let headers = Request.default_headers in - let uri = Uri.add_query_param' uri ("username", username) in - let uri = Uri.add_query_param' uri ("password", password) in - Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> - Request.read_json_body_as (JsonSupport.to_string) resp body - -let logout_user () = - let open Lwt in - let uri = Request.build_uri "/user/logout" in - let headers = Request.default_headers in - Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> - Request.handle_unit_response resp - -let update_user username body = - let open Lwt in - let uri = Request.build_uri "/user/{username}" in - let headers = Request.default_headers in - let uri = Request.replace_path_param uri "username" (username) in - let body = Request.write_json_body User.to_yojson body in - Cohttp_lwt_unix.Client.call `PUT uri ~headers ~body >>= fun (resp, body) -> - Request.handle_unit_response resp - diff --git a/samples/client/petstore/ocaml-client/src/apis/user_api.mli b/samples/client/petstore/ocaml-client/src/apis/user_api.mli deleted file mode 100644 index 5191a2ea41b..00000000000 --- a/samples/client/petstore/ocaml-client/src/apis/user_api.mli +++ /dev/null @@ -1,15 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -val create_user : User.t -> unit Lwt.t -val create_users_with_array_input : User.t list -> unit Lwt.t -val create_users_with_list_input : User.t list -> unit Lwt.t -val delete_user : string -> unit Lwt.t -val get_user_by_name : string -> User.t Lwt.t -val login_user : string -> string -> string Lwt.t -val logout_user : unit -> unit Lwt.t -val update_user : string -> User.t -> unit Lwt.t diff --git a/samples/client/petstore/ocaml-client/src/models/api_response.ml b/samples/client/petstore/ocaml-client/src/models/api_response.ml deleted file mode 100644 index f1b960d1449..00000000000 --- a/samples/client/petstore/ocaml-client/src/models/api_response.ml +++ /dev/null @@ -1,21 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - * Schema Api_response.t : Describes the result of uploading an image resource - *) - -type t = { - code: int32 option [@default None]; - _type: string option [@default None]; - message: string option [@default None]; -} [@@deriving yojson, show ];; - -(** Describes the result of uploading an image resource *) -let create () : t = { - code = None; - _type = None; - message = None; -} - diff --git a/samples/client/petstore/ocaml-client/src/models/category.ml b/samples/client/petstore/ocaml-client/src/models/category.ml deleted file mode 100644 index 31b9c3aab1d..00000000000 --- a/samples/client/petstore/ocaml-client/src/models/category.ml +++ /dev/null @@ -1,19 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - * Schema Category.t : A category for a pet - *) - -type t = { - id: int64 option [@default None]; - name: string option [@default None]; -} [@@deriving yojson, show ];; - -(** A category for a pet *) -let create () : t = { - id = None; - name = None; -} - diff --git a/samples/client/petstore/ocaml-client/src/models/order.ml b/samples/client/petstore/ocaml-client/src/models/order.ml deleted file mode 100644 index 6130f88fd95..00000000000 --- a/samples/client/petstore/ocaml-client/src/models/order.ml +++ /dev/null @@ -1,28 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - * Schema Order.t : An order for a pets from the pet store - *) - -type t = { - id: int64 option [@default None]; - pet_id: int64 option [@default None]; - quantity: int32 option [@default None]; - ship_date: string option [@default None]; - (* Order Status *) - status: Enums.status option [@default None]; - complete: bool option [@default None]; -} [@@deriving yojson, show ];; - -(** An order for a pets from the pet store *) -let create () : t = { - id = None; - pet_id = None; - quantity = None; - ship_date = None; - status = None; - complete = None; -} - diff --git a/samples/client/petstore/ocaml-client/src/models/pet.ml b/samples/client/petstore/ocaml-client/src/models/pet.ml deleted file mode 100644 index 5d267ef32db..00000000000 --- a/samples/client/petstore/ocaml-client/src/models/pet.ml +++ /dev/null @@ -1,28 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - * Schema Pet.t : A pet for sale in the pet store - *) - -type t = { - id: int64 option [@default None]; - category: Category.t option [@default None]; - name: string; - photo_urls: string list; - tags: Tag.t list; - (* pet status in the store *) - status: Enums.pet_status option [@default None]; -} [@@deriving yojson, show ];; - -(** A pet for sale in the pet store *) -let create (name : string) (photo_urls : string list) : t = { - id = None; - category = None; - name = name; - photo_urls = photo_urls; - tags = []; - status = None; -} - diff --git a/samples/client/petstore/ocaml-client/src/models/tag.ml b/samples/client/petstore/ocaml-client/src/models/tag.ml deleted file mode 100644 index 5570d9c8eaf..00000000000 --- a/samples/client/petstore/ocaml-client/src/models/tag.ml +++ /dev/null @@ -1,19 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - * Schema Tag.t : A tag for a pet - *) - -type t = { - id: int64 option [@default None]; - name: string option [@default None]; -} [@@deriving yojson, show ];; - -(** A tag for a pet *) -let create () : t = { - id = None; - name = None; -} - diff --git a/samples/client/petstore/ocaml-client/src/models/user.ml b/samples/client/petstore/ocaml-client/src/models/user.ml deleted file mode 100644 index a9483d72889..00000000000 --- a/samples/client/petstore/ocaml-client/src/models/user.ml +++ /dev/null @@ -1,32 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - * Schema User.t : A User who is purchasing from the pet store - *) - -type t = { - id: int64 option [@default None]; - username: string option [@default None]; - first_name: string option [@default None]; - last_name: string option [@default None]; - email: string option [@default None]; - password: string option [@default None]; - phone: string option [@default None]; - (* User Status *) - user_status: int32 option [@default None]; -} [@@deriving yojson, show ];; - -(** A User who is purchasing from the pet store *) -let create () : t = { - id = None; - username = None; - first_name = None; - last_name = None; - email = None; - password = None; - phone = None; - user_status = None; -} - diff --git a/samples/client/petstore/ocaml-client/src/support/enums.ml b/samples/client/petstore/ocaml-client/src/support/enums.ml deleted file mode 100644 index 0c64f8c042f..00000000000 --- a/samples/client/petstore/ocaml-client/src/support/enums.ml +++ /dev/null @@ -1,30 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type status = [ -| `Placed [@printer fun fmt _ -> Format.pp_print_string fmt "placed"] [@name "placed"] -| `Approved [@printer fun fmt _ -> Format.pp_print_string fmt "approved"] [@name "approved"] -| `Delivered [@printer fun fmt _ -> Format.pp_print_string fmt "delivered"] [@name "delivered"] -] [@@deriving yojson, show { with_path = false }];; - -let status_of_yojson json = status_of_yojson (`List [json]) -let status_to_yojson e = - match status_to_yojson e with - | `List [json] -> json - | json -> json - -type pet_status = [ -| `Available [@printer fun fmt _ -> Format.pp_print_string fmt "available"] [@name "available"] -| `Pending [@printer fun fmt _ -> Format.pp_print_string fmt "pending"] [@name "pending"] -| `Sold [@printer fun fmt _ -> Format.pp_print_string fmt "sold"] [@name "sold"] -] [@@deriving yojson, show { with_path = false }];; - -let pet_status_of_yojson json = pet_status_of_yojson (`List [json]) -let pet_status_to_yojson e = - match pet_status_to_yojson e with - | `List [json] -> json - | json -> json diff --git a/samples/client/petstore/ocaml-client/src/support/jsonSupport.ml b/samples/client/petstore/ocaml-client/src/support/jsonSupport.ml deleted file mode 100644 index 4b0fac77545..00000000000 --- a/samples/client/petstore/ocaml-client/src/support/jsonSupport.ml +++ /dev/null @@ -1,55 +0,0 @@ -open Ppx_deriving_yojson_runtime - -let unwrap to_json json = - match to_json json with - | Result.Ok json -> json - | Result.Error s -> failwith s - -let to_int json = - match json with - | `Int x -> x - | `Intlit s -> int_of_string s - | _ -> failwith "JsonSupport.to_int" - -let to_bool json = - match json with - | `Bool x -> x - | _ -> failwith "JsonSupport.to_bool" - -let to_float json = - match json with - | `Float x -> x - | _ -> failwith "JsonSupport.to_float" - -let to_string json = - match json with - | `String s -> s - | _ -> failwith "JsonSupport.to_string" - -let to_int32 json : int32 = - match json with - | `Int x -> Int32.of_int x - | `Intlit s -> Int32.of_string s - | _ -> failwith "JsonSupport.to_int32" - -let to_int64 json : int64 = - match json with - | `Int x -> Int64.of_int x - | `Intlit s -> Int64.of_string s - | _ -> failwith "JsonSupport.to_int64" - -let of_int x = `Int x - -let of_bool b = `Bool b - -let of_float x = `Float x - -let of_string s = `String s - -let of_int32 x = `Intlit (Int32.to_string x) - -let of_int64 x = `Intlit (Int64.to_string x) - -let of_list_of of_f l = `List (List.map of_f l) - -let of_map_of of_f l = `Assoc (List.map (fun (k, v) -> (k, of_f v)) l) \ No newline at end of file diff --git a/samples/client/petstore/ocaml-client/src/support/request.ml b/samples/client/petstore/ocaml-client/src/support/request.ml deleted file mode 100644 index 21b6f870ed9..00000000000 --- a/samples/client/petstore/ocaml-client/src/support/request.ml +++ /dev/null @@ -1,48 +0,0 @@ -let api_key = "" -let base_url = "http://petstore.swagger.io/v2" -let default_headers = Cohttp.Header.init_with "Content-Type" "application/json" - -let build_uri operation_path = Uri.of_string (base_url ^ operation_path) -let write_json_body to_json payload = - to_json payload |> Yojson.Safe.to_string ~std:true |> Cohttp_lwt.Body.of_string - -let handle_response resp on_success_handler = - match Cohttp_lwt.Response.status resp with - | #Cohttp.Code.success_status -> on_success_handler () - | s -> failwith ("Server responded with status " ^ Cohttp.Code.(reason_phrase_of_code (code_of_status s))) - -let handle_unit_response resp = handle_response resp (fun () -> Lwt.return ()) - -let read_json_body resp body = - handle_response resp (fun () -> - (Lwt.(Cohttp_lwt.Body.to_string body >|= Yojson.Safe.from_string))) - -let read_json_body_as of_json resp body = - Lwt.(read_json_body resp body >|= of_json) - -let read_json_body_as_list resp body = - Lwt.(read_json_body resp body >|= Yojson.Safe.Util.to_list) - -let read_json_body_as_list_of of_json resp body = - Lwt.(read_json_body_as_list resp body >|= List.map of_json) - -let read_json_body_as_map_of of_json resp body = - Lwt.(read_json_body resp body >|= Yojson.Safe.Util.to_assoc >|= List.map (fun (s, v) -> (s, of_json v))) - -let replace_path_param uri param_name param_value = - let regexp = Str.regexp (Str.quote ("{" ^ param_name ^ "}")) in - let path = Str.global_replace regexp param_value (Uri.path uri) in - Uri.with_path uri path - -let init_form_encoded_body () = "" - -let add_form_encoded_body_param params (paramName, paramValue) = - let new_param_enc = Printf.sprintf {|%s=%s|} (Uri.pct_encode paramName) (Uri.pct_encode paramValue) in - if params = "" - then new_param_enc - else Printf.sprintf {|%s&%s|} params new_param_enc - -let add_form_encoded_body_params params (paramName, new_params) = - add_form_encoded_body_param params (paramName, String.concat "," new_params) - -let finalize_form_encoded_body body = Cohttp_lwt.Body.of_string body diff --git a/samples/openapi3/client/petstore/ocaml-client/.openapi-generator-ignore b/samples/openapi3/client/petstore/ocaml-client/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a3..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/openapi3/client/petstore/ocaml-client/.openapi-generator/VERSION b/samples/openapi3/client/petstore/ocaml-client/.openapi-generator/VERSION deleted file mode 100644 index 717311e32e3..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -unset \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ocaml-client/dune b/samples/openapi3/client/petstore/ocaml-client/dune deleted file mode 100644 index ed1c4d90e3d..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/dune +++ /dev/null @@ -1,9 +0,0 @@ -(include_subdirs unqualified) -(library - (name petstore_client) - (public_name petstore_client) - (flags (:standard -w -27)) - (libraries str cohttp-lwt-unix lwt yojson ppx_deriving_yojson.runtime) - (preprocess (pps ppx_deriving_yojson ppx_deriving.std)) - (wrapped true) -) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ocaml-client/dune-project b/samples/openapi3/client/petstore/ocaml-client/dune-project deleted file mode 100644 index 79d86e3c901..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/dune-project +++ /dev/null @@ -1,2 +0,0 @@ -(lang dune 1.10) -(name petstore_client) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ocaml-client/petstore_client.opam b/samples/openapi3/client/petstore/ocaml-client/petstore_client.opam deleted file mode 100644 index 3c3603c2f14..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/petstore_client.opam +++ /dev/null @@ -1,15 +0,0 @@ -opam-version: "2.0" -name: "petstore_client" -version: "1.0.0" -synopsis: "" -description: """ -Longer description -""" -maintainer: "Name " -authors: "Name " -license: "" -homepage: "" -bug-reports: "" -dev-repo: "" -depends: [ "ocaml" "ocamlfind" ] -build: ["dune" "build" "-p" name] \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/another_fake_api.ml b/samples/openapi3/client/petstore/ocaml-client/src/apis/another_fake_api.ml deleted file mode 100644 index 042919109b4..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/apis/another_fake_api.ml +++ /dev/null @@ -1,15 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -let call_123_test_special_tags client_t = - let open Lwt in - let uri = Request.build_uri "/another-fake/dummy" in - let headers = Request.default_headers in - let body = Request.write_json_body Client.to_yojson client_t in - Cohttp_lwt_unix.Client.patch uri ~headers ~body >>= fun (_resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap Client.of_yojson) body - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/another_fake_api.mli b/samples/openapi3/client/petstore/ocaml-client/src/apis/another_fake_api.mli deleted file mode 100644 index 2b93c08e959..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/apis/another_fake_api.mli +++ /dev/null @@ -1,8 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -val call_123_test_special_tags : Client.t -> Client.t Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/default_api.ml b/samples/openapi3/client/petstore/ocaml-client/src/apis/default_api.ml deleted file mode 100644 index c432362bb02..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/apis/default_api.ml +++ /dev/null @@ -1,14 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -let foo_get () = - let open Lwt in - let uri = Request.build_uri "/foo" in - let headers = Request.default_headers in - Cohttp_lwt_unix.Client.get uri ~headers >>= fun (_resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap Inline_response_default.of_yojson) body - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/default_api.mli b/samples/openapi3/client/petstore/ocaml-client/src/apis/default_api.mli deleted file mode 100644 index f1392d7621c..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/apis/default_api.mli +++ /dev/null @@ -1,8 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -val foo_get : unit -> Inline_response_default.t Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/fake_api.ml b/samples/openapi3/client/petstore/ocaml-client/src/apis/fake_api.ml deleted file mode 100644 index 5f755065062..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/apis/fake_api.ml +++ /dev/null @@ -1,136 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -let fake_health_get () = - let open Lwt in - let uri = Request.build_uri "/fake/health" in - let headers = Request.default_headers in - Cohttp_lwt_unix.Client.get uri ~headers >>= fun (_resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap Health_check_result.of_yojson) body - -let fake_outer_boolean_serialize body = - let open Lwt in - let uri = Request.build_uri "/fake/outer/boolean" in - let headers = Request.default_headers in - let body = Request.write_json_body JsonSupport.of_bool body in - Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> - Request.read_json_body_as (JsonSupport.to_bool) body - -let fake_outer_composite_serialize outer_composite_t = - let open Lwt in - let uri = Request.build_uri "/fake/outer/composite" in - let headers = Request.default_headers in - let body = Request.write_json_body Outer_composite.to_yojson outer_composite_t in - Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap Outer_composite.of_yojson) body - -let fake_outer_number_serialize body = - let open Lwt in - let uri = Request.build_uri "/fake/outer/number" in - let headers = Request.default_headers in - let body = Request.write_json_body JsonSupport.of_float body in - Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> - Request.read_json_body_as (JsonSupport.to_float) body - -let fake_outer_string_serialize body = - let open Lwt in - let uri = Request.build_uri "/fake/outer/string" in - let headers = Request.default_headers in - let body = Request.write_json_body JsonSupport.of_string body in - Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> - Request.read_json_body_as (JsonSupport.to_string) body - -let test_body_with_file_schema file_schema_test_class_t = - let open Lwt in - let uri = Request.build_uri "/fake/body-with-file-schema" in - let headers = Request.default_headers in - let body = Request.write_json_body File_schema_test_class.to_yojson file_schema_test_class_t in - Cohttp_lwt_unix.Client.put uri ~headers ~body >>= fun (_resp, body) -> return () - -let test_body_with_query_params query user_t = - let open Lwt in - let uri = Request.build_uri "/fake/body-with-query-params" in - let headers = Request.default_headers in - let uri = Uri.add_query_param' uri ("query", query) in - let body = Request.write_json_body User.to_yojson user_t in - Cohttp_lwt_unix.Client.put uri ~headers ~body >>= fun (_resp, body) -> return () - -let test_client_model client_t = - let open Lwt in - let uri = Request.build_uri "/fake" in - let headers = Request.default_headers in - let body = Request.write_json_body Client.to_yojson client_t in - Cohttp_lwt_unix.Client.patch uri ~headers ~body >>= fun (_resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap Client.of_yojson) body - -let test_endpoint_parameters number double pattern_without_delimiter byte integer int32 int64 float string binary date date_time password callback = - let open Lwt in - let uri = Request.build_uri "/fake" in - let headers = Request.default_headers in - let body = Request.init_form_encoded_body () in - let body = Request.add_form_encoded_body_param body ("integer", Int32.to_string integer) in - let body = Request.add_form_encoded_body_param body ("int32", Int32.to_string int32) in - let body = Request.add_form_encoded_body_param body ("int64", Int64.to_string int64) in - let body = Request.add_form_encoded_body_param body ("number", string_of_float number) in - let body = Request.add_form_encoded_body_param body ("float", string_of_float float) in - let body = Request.add_form_encoded_body_param body ("double", string_of_float double) in - let body = Request.add_form_encoded_body_param body ("string", string) in - let body = Request.add_form_encoded_body_param body ("pattern_without_delimiter", pattern_without_delimiter) in - let body = Request.add_form_encoded_body_param body ("byte", Bytes.to_string byte) in - let body = Request.add_form_encoded_body_param body ("binary", binary) in - let body = Request.add_form_encoded_body_param body ("date", date) in - let body = Request.add_form_encoded_body_param body ("date_time", date_time) in - let body = Request.add_form_encoded_body_param body ("password", password) in - let body = Request.add_form_encoded_body_param body ("callback", callback) in - let body = Request.finalize_form_encoded_body body in - Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> return () - -let test_enum_parameters enum_header_string_array enum_header_string enum_query_string_array enum_query_string enum_query_integer enum_query_double enum_form_string_array enum_form_string = - let open Lwt in - let uri = Request.build_uri "/fake" in - let headers = Request.default_headers in - let headers = Cohttp.Header.add_multi headers "enum_header_string_array" (List.map Enums.show_inline_object_2_enum_form_string_array enum_header_string_array) in - let headers = Cohttp.Header.add headers "enum_header_string" (Enums.show_enumclass enum_header_string) in - let uri = Uri.add_query_param uri ("enum_query_string_array", List.map Enums.show_inline_object_2_enum_form_string_array enum_query_string_array) in - let uri = Uri.add_query_param' uri ("enum_query_string", Enums.show_enumclass enum_query_string) in - let uri = Uri.add_query_param' uri ("enum_query_integer", Enums.show_enum_query_integer enum_query_integer) in - let uri = Uri.add_query_param' uri ("enum_query_double", Enums.show_enum_number enum_query_double) in - let body = Request.init_form_encoded_body () in - let body = Request.add_form_encoded_body_params body ("enum_form_string_array", List.map Enums.show_inline_object_2_enum_form_string_array enum_form_string_array) in - let body = Request.add_form_encoded_body_param body ("enum_form_string", Enums.show_enumclass enum_form_string) in - let body = Request.finalize_form_encoded_body body in - Cohttp_lwt_unix.Client.get uri ~headers ~body >>= fun (_resp, body) -> return () - -let test_group_parameters required_string_group required_boolean_group required_int64_group string_group boolean_group int64_group = - let open Lwt in - let uri = Request.build_uri "/fake" in - let headers = Request.default_headers in - let headers = Cohttp.Header.add headers "required_boolean_group" (string_of_bool required_boolean_group) in - let headers = Cohttp.Header.add headers "boolean_group" (string_of_bool boolean_group) in - let uri = Uri.add_query_param' uri ("required_string_group", Int32.to_string required_string_group) in - let uri = Uri.add_query_param' uri ("required_int64_group", Int64.to_string required_int64_group) in - let uri = Uri.add_query_param' uri ("string_group", Int32.to_string string_group) in - let uri = Uri.add_query_param' uri ("int64_group", Int64.to_string int64_group) in - Cohttp_lwt_unix.Client.delete uri ~headers >>= fun (_resp, body) -> return () - -let test_inline_additional_properties request_body = - let open Lwt in - let uri = Request.build_uri "/fake/inline-additionalProperties" in - let headers = Request.default_headers in - let body = Request.write_json_body (JsonSupport.of_map_of JsonSupport.of_string) request_body in - Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> return () - -let test_json_form_data param param2 = - let open Lwt in - let uri = Request.build_uri "/fake/jsonFormData" in - let headers = Request.default_headers in - let body = Request.init_form_encoded_body () in - let body = Request.add_form_encoded_body_param body ("param", param) in - let body = Request.add_form_encoded_body_param body ("param2", param2) in - let body = Request.finalize_form_encoded_body body in - Cohttp_lwt_unix.Client.get uri ~headers ~body >>= fun (_resp, body) -> return () - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/fake_api.mli b/samples/openapi3/client/petstore/ocaml-client/src/apis/fake_api.mli deleted file mode 100644 index bc6c25e2c40..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/apis/fake_api.mli +++ /dev/null @@ -1,20 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -val fake_health_get : unit -> Health_check_result.t Lwt.t -val fake_outer_boolean_serialize : bool -> bool Lwt.t -val fake_outer_composite_serialize : Outer_composite.t -> Outer_composite.t Lwt.t -val fake_outer_number_serialize : float -> float Lwt.t -val fake_outer_string_serialize : string -> string Lwt.t -val test_body_with_file_schema : File_schema_test_class.t -> unit Lwt.t -val test_body_with_query_params : string -> User.t -> unit Lwt.t -val test_client_model : Client.t -> Client.t Lwt.t -val test_endpoint_parameters : float -> float -> string -> bytes -> int32 -> int32 -> int64 -> float -> string -> string -> string -> string -> string -> string -> unit Lwt.t -val test_enum_parameters : Enums.inline_object_2_enum_form_string_array list -> Enums.enumclass -> Enums.inline_object_2_enum_form_string_array list -> Enums.enumclass -> Enums.enum_query_integer -> Enums.enum_number -> Enums.inline_object_2_enum_form_string_array list -> Enums.enumclass -> unit Lwt.t -val test_group_parameters : int32 -> bool -> int64 -> int32 -> bool -> int64 -> unit Lwt.t -val test_inline_additional_properties : (string * string) list -> unit Lwt.t -val test_json_form_data : string -> string -> unit Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/fake_classname_tags123_api.ml b/samples/openapi3/client/petstore/ocaml-client/src/apis/fake_classname_tags123_api.ml deleted file mode 100644 index f108f7e0b20..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/apis/fake_classname_tags123_api.ml +++ /dev/null @@ -1,15 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -let test_classname client_t = - let open Lwt in - let uri = Request.build_uri "/fake_classname_test" in - let headers = Request.default_headers in - let body = Request.write_json_body Client.to_yojson client_t in - Cohttp_lwt_unix.Client.patch uri ~headers ~body >>= fun (_resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap Client.of_yojson) body - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/fake_classname_tags123_api.mli b/samples/openapi3/client/petstore/ocaml-client/src/apis/fake_classname_tags123_api.mli deleted file mode 100644 index 85059985bbe..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/apis/fake_classname_tags123_api.mli +++ /dev/null @@ -1,8 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -val test_classname : Client.t -> Client.t Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/pet_api.ml b/samples/openapi3/client/petstore/ocaml-client/src/apis/pet_api.ml deleted file mode 100644 index 9ba3f1ea0a8..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/apis/pet_api.ml +++ /dev/null @@ -1,88 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -let add_pet pet_t = - let open Lwt in - let uri = Request.build_uri "/pet" in - let headers = Request.default_headers in - let body = Request.write_json_body Pet.to_yojson pet_t in - Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> return () - -let delete_pet pet_id api_key = - let open Lwt in - let uri = Request.build_uri "/pet/{petId}" in - let headers = Request.default_headers in - let headers = Cohttp.Header.add headers "api_key" (api_key) in - let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in - Cohttp_lwt_unix.Client.delete uri ~headers >>= fun (_resp, body) -> return () - -let find_pets_by_status status = - let open Lwt in - let uri = Request.build_uri "/pet/findByStatus" in - let headers = Request.default_headers in - let uri = Uri.add_query_param uri ("status", List.map Enums.show_pet_status status) in - Cohttp_lwt_unix.Client.get uri ~headers >>= fun (_resp, body) -> - Request.read_json_body_as_list_of (JsonSupport.unwrap Pet.of_yojson) body - -let find_pets_by_tags tags = - let open Lwt in - let uri = Request.build_uri "/pet/findByTags" in - let headers = Request.default_headers in - let uri = Uri.add_query_param uri ("tags", tags) in - Cohttp_lwt_unix.Client.get uri ~headers >>= fun (_resp, body) -> - Request.read_json_body_as_list_of (JsonSupport.unwrap Pet.of_yojson) body - -let get_pet_by_id pet_id = - let open Lwt in - let uri = Request.build_uri "/pet/{petId}" in - let headers = Request.default_headers in - let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in - Cohttp_lwt_unix.Client.get uri ~headers >>= fun (_resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap Pet.of_yojson) body - -let update_pet pet_t = - let open Lwt in - let uri = Request.build_uri "/pet" in - let headers = Request.default_headers in - let body = Request.write_json_body Pet.to_yojson pet_t in - Cohttp_lwt_unix.Client.put uri ~headers ~body >>= fun (_resp, body) -> return () - -let update_pet_with_form pet_id name status = - let open Lwt in - let uri = Request.build_uri "/pet/{petId}" in - let headers = Request.default_headers in - let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in - let body = Request.init_form_encoded_body () in - let body = Request.add_form_encoded_body_param body ("name", name) in - let body = Request.add_form_encoded_body_param body ("status", status) in - let body = Request.finalize_form_encoded_body body in - Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> return () - -let upload_file pet_id additional_metadata file = - let open Lwt in - let uri = Request.build_uri "/pet/{petId}/uploadImage" in - let headers = Request.default_headers in - let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in - let body = Request.init_form_encoded_body () in - let body = Request.add_form_encoded_body_param body ("additional_metadata", additional_metadata) in - let body = Request.add_form_encoded_body_param body ("file", file) in - let body = Request.finalize_form_encoded_body body in - Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap Api_response.of_yojson) body - -let upload_file_with_required_file pet_id required_file additional_metadata = - let open Lwt in - let uri = Request.build_uri "/fake/{petId}/uploadImageWithRequiredFile" in - let headers = Request.default_headers in - let uri = Request.replace_path_param uri "petId" (Int64.to_string pet_id) in - let body = Request.init_form_encoded_body () in - let body = Request.add_form_encoded_body_param body ("additional_metadata", additional_metadata) in - let body = Request.add_form_encoded_body_param body ("required_file", required_file) in - let body = Request.finalize_form_encoded_body body in - Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap Api_response.of_yojson) body - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/pet_api.mli b/samples/openapi3/client/petstore/ocaml-client/src/apis/pet_api.mli deleted file mode 100644 index a1036b6c3c7..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/apis/pet_api.mli +++ /dev/null @@ -1,16 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -val add_pet : Pet.t -> unit Lwt.t -val delete_pet : int64 -> string -> unit Lwt.t -val find_pets_by_status : Enums.pet_status list -> Pet.t list Lwt.t -val find_pets_by_tags : string list -> Pet.t list Lwt.t -val get_pet_by_id : int64 -> Pet.t Lwt.t -val update_pet : Pet.t -> unit Lwt.t -val update_pet_with_form : int64 -> string -> string -> unit Lwt.t -val upload_file : int64 -> string -> string -> Api_response.t Lwt.t -val upload_file_with_required_file : int64 -> string -> string -> Api_response.t Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/store_api.ml b/samples/openapi3/client/petstore/ocaml-client/src/apis/store_api.ml deleted file mode 100644 index 79cc1ccc0ea..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/apis/store_api.ml +++ /dev/null @@ -1,37 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -let delete_order order_id = - let open Lwt in - let uri = Request.build_uri "/store/order/{order_id}" in - let headers = Request.default_headers in - let uri = Request.replace_path_param uri "order_id" (order_id) in - Cohttp_lwt_unix.Client.delete uri ~headers >>= fun (_resp, body) -> return () - -let get_inventory () = - let open Lwt in - let uri = Request.build_uri "/store/inventory" in - let headers = Request.default_headers in - Cohttp_lwt_unix.Client.get uri ~headers >>= fun (_resp, body) -> - Request.read_json_body_as_map_of (JsonSupport.to_int32) body - -let get_order_by_id order_id = - let open Lwt in - let uri = Request.build_uri "/store/order/{order_id}" in - let headers = Request.default_headers in - let uri = Request.replace_path_param uri "order_id" (Int64.to_string order_id) in - Cohttp_lwt_unix.Client.get uri ~headers >>= fun (_resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap Order.of_yojson) body - -let place_order order_t = - let open Lwt in - let uri = Request.build_uri "/store/order" in - let headers = Request.default_headers in - let body = Request.write_json_body Order.to_yojson order_t in - Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap Order.of_yojson) body - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/store_api.mli b/samples/openapi3/client/petstore/ocaml-client/src/apis/store_api.mli deleted file mode 100644 index bc3c93eb494..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/apis/store_api.mli +++ /dev/null @@ -1,11 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -val delete_order : string -> unit Lwt.t -val get_inventory : unit -> (string * int32) list Lwt.t -val get_order_by_id : int64 -> Order.t Lwt.t -val place_order : Order.t -> Order.t Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/user_api.ml b/samples/openapi3/client/petstore/ocaml-client/src/apis/user_api.ml deleted file mode 100644 index d9499ee070e..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/apis/user_api.ml +++ /dev/null @@ -1,66 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -let create_user user_t = - let open Lwt in - let uri = Request.build_uri "/user" in - let headers = Request.default_headers in - let body = Request.write_json_body User.to_yojson user_t in - Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> return () - -let create_users_with_array_input user = - let open Lwt in - let uri = Request.build_uri "/user/createWithArray" in - let headers = Request.default_headers in - let body = Request.write_json_body (JsonSupport.of_list_of User.to_yojson) user in - Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> return () - -let create_users_with_list_input user = - let open Lwt in - let uri = Request.build_uri "/user/createWithList" in - let headers = Request.default_headers in - let body = Request.write_json_body (JsonSupport.of_list_of User.to_yojson) user in - Cohttp_lwt_unix.Client.post uri ~headers ~body >>= fun (_resp, body) -> return () - -let delete_user username = - let open Lwt in - let uri = Request.build_uri "/user/{username}" in - let headers = Request.default_headers in - let uri = Request.replace_path_param uri "username" (username) in - Cohttp_lwt_unix.Client.delete uri ~headers >>= fun (_resp, body) -> return () - -let get_user_by_name username = - let open Lwt in - let uri = Request.build_uri "/user/{username}" in - let headers = Request.default_headers in - let uri = Request.replace_path_param uri "username" (username) in - Cohttp_lwt_unix.Client.get uri ~headers >>= fun (_resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap User.of_yojson) body - -let login_user username password = - let open Lwt in - let uri = Request.build_uri "/user/login" in - let headers = Request.default_headers in - let uri = Uri.add_query_param' uri ("username", username) in - let uri = Uri.add_query_param' uri ("password", password) in - Cohttp_lwt_unix.Client.get uri ~headers >>= fun (_resp, body) -> - Request.read_json_body_as (JsonSupport.to_string) body - -let logout_user () = - let open Lwt in - let uri = Request.build_uri "/user/logout" in - let headers = Request.default_headers in - Cohttp_lwt_unix.Client.get uri ~headers >>= fun (_resp, body) -> return () - -let update_user username user_t = - let open Lwt in - let uri = Request.build_uri "/user/{username}" in - let headers = Request.default_headers in - let uri = Request.replace_path_param uri "username" (username) in - let body = Request.write_json_body User.to_yojson user_t in - Cohttp_lwt_unix.Client.put uri ~headers ~body >>= fun (_resp, body) -> return () - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/apis/user_api.mli b/samples/openapi3/client/petstore/ocaml-client/src/apis/user_api.mli deleted file mode 100644 index 5191a2ea41b..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/apis/user_api.mli +++ /dev/null @@ -1,15 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -val create_user : User.t -> unit Lwt.t -val create_users_with_array_input : User.t list -> unit Lwt.t -val create_users_with_list_input : User.t list -> unit Lwt.t -val delete_user : string -> unit Lwt.t -val get_user_by_name : string -> User.t Lwt.t -val login_user : string -> string -> string Lwt.t -val logout_user : unit -> unit Lwt.t -val update_user : string -> User.t -> unit Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/additional_properties_class.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/additional_properties_class.ml deleted file mode 100644 index 8e5f7b075f9..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/additional_properties_class.ml +++ /dev/null @@ -1,17 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - map_property: (string * string) list; - map_of_map_property: (string * (string * string) list) list; -} [@@deriving yojson, show ];; - -let create () : t = { - map_property = []; - map_of_map_property = []; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/animal.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/animal.ml deleted file mode 100644 index 637ecdf60a9..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/animal.ml +++ /dev/null @@ -1,17 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - class_name: string; - color: string option; -} [@@deriving yojson, show ];; - -let create (class_name : string) : t = { - class_name = class_name; - color = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/api_response.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/api_response.ml deleted file mode 100644 index 3f23662e01a..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/api_response.ml +++ /dev/null @@ -1,19 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - code: int32 option; - _type: string option; - message: string option; -} [@@deriving yojson, show ];; - -let create () : t = { - code = None; - _type = None; - message = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/array_of_array_of_number_only.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/array_of_array_of_number_only.ml deleted file mode 100644 index 2204bac4b6c..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/array_of_array_of_number_only.ml +++ /dev/null @@ -1,15 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - array_array_number: float list list; -} [@@deriving yojson, show ];; - -let create () : t = { - array_array_number = []; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/array_of_number_only.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/array_of_number_only.ml deleted file mode 100644 index 3708294193e..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/array_of_number_only.ml +++ /dev/null @@ -1,15 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - array_number: float list; -} [@@deriving yojson, show ];; - -let create () : t = { - array_number = []; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/array_test.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/array_test.ml deleted file mode 100644 index 6198edd88a6..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/array_test.ml +++ /dev/null @@ -1,19 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - array_of_string: string list; - array_array_of_integer: int64 list list; - array_array_of_model: Read_only_first.t list list; -} [@@deriving yojson, show ];; - -let create () : t = { - array_of_string = []; - array_array_of_integer = []; - array_array_of_model = []; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/capitalization.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/capitalization.ml deleted file mode 100644 index c75a3e4574b..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/capitalization.ml +++ /dev/null @@ -1,26 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - small_camel: string option; - capital_camel: string option; - small_snake: string option; - capital_snake: string option; - sca_eth_flow_points: string option; - (* Name of the pet *) - att_name: string option; -} [@@deriving yojson, show ];; - -let create () : t = { - small_camel = None; - capital_camel = None; - small_snake = None; - capital_snake = None; - sca_eth_flow_points = None; - att_name = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/cat.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/cat.ml deleted file mode 100644 index 1d79ca8716f..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/cat.ml +++ /dev/null @@ -1,19 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - class_name: string; - color: string option; - declawed: bool option; -} [@@deriving yojson, show ];; - -let create (class_name : string) : t = { - class_name = class_name; - color = None; - declawed = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/cat_all_of.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/cat_all_of.ml deleted file mode 100644 index d0c18e1a505..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/cat_all_of.ml +++ /dev/null @@ -1,15 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - declawed: bool option; -} [@@deriving yojson, show ];; - -let create () : t = { - declawed = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/category.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/category.ml deleted file mode 100644 index fdace8a8372..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/category.ml +++ /dev/null @@ -1,17 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - id: int64 option; - name: string; -} [@@deriving yojson, show ];; - -let create (name : string) : t = { - id = None; - name = name; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/class_model.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/class_model.ml deleted file mode 100644 index 8023b7cdcbd..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/class_model.ml +++ /dev/null @@ -1,17 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - * Schema Class_model.t : Model for testing model with \\"_class\\" property - *) - -type t = { - _class: string option; -} [@@deriving yojson, show ];; - -(** Model for testing model with \\"_class\\" property *) -let create () : t = { - _class = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/client.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/client.ml deleted file mode 100644 index 259a2b3c139..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/client.ml +++ /dev/null @@ -1,15 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - client: string option; -} [@@deriving yojson, show ];; - -let create () : t = { - client = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/dog.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/dog.ml deleted file mode 100644 index ceaa4b66b7d..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/dog.ml +++ /dev/null @@ -1,19 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - class_name: string; - color: string option; - breed: string option; -} [@@deriving yojson, show ];; - -let create (class_name : string) : t = { - class_name = class_name; - color = None; - breed = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/dog_all_of.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/dog_all_of.ml deleted file mode 100644 index 7bbf7ec7275..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/dog_all_of.ml +++ /dev/null @@ -1,15 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - breed: string option; -} [@@deriving yojson, show ];; - -let create () : t = { - breed = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/enum_arrays.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/enum_arrays.ml deleted file mode 100644 index 5dc755407d1..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/enum_arrays.ml +++ /dev/null @@ -1,17 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - just_symbol: Enums.just_symbol option; - array_enum: Enums.enumarrays_array_enum list; -} [@@deriving yojson, show ];; - -let create () : t = { - just_symbol = None; - array_enum = []; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/enum_test.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/enum_test.ml deleted file mode 100644 index 5a92f51ff70..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/enum_test.ml +++ /dev/null @@ -1,29 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - enum_string: Enums.enum_string option; - enum_string_required: Enums.enum_string; - enum_integer: Enums.enum_integer option; - enum_number: Enums.enum_number option; - outer_enum: Enums.status option; - outer_enum_integer: Enums.outerenuminteger option; - outer_enum_default_value: Enums.status option; - outer_enum_integer_default_value: Enums.outerenuminteger option; -} [@@deriving yojson, show ];; - -let create (enum_string_required : Enums.enum_string) : t = { - enum_string = None; - enum_string_required = enum_string_required; - enum_integer = None; - enum_number = None; - outer_enum = None; - outer_enum_integer = None; - outer_enum_default_value = None; - outer_enum_integer_default_value = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/file.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/file.ml deleted file mode 100644 index fd79bb76abf..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/file.ml +++ /dev/null @@ -1,18 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - * Schema File.t : Must be named `File` for test. - *) - -type t = { - (* Test capitalization *) - source_uri: string option; -} [@@deriving yojson, show ];; - -(** Must be named `File` for test. *) -let create () : t = { - source_uri = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/file_schema_test_class.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/file_schema_test_class.ml deleted file mode 100644 index b0938b230f2..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/file_schema_test_class.ml +++ /dev/null @@ -1,17 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - file: File.t option; - files: File.t list; -} [@@deriving yojson, show ];; - -let create () : t = { - file = None; - files = []; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/foo.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/foo.ml deleted file mode 100644 index e4d05a7971a..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/foo.ml +++ /dev/null @@ -1,15 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - bar: string option; -} [@@deriving yojson, show ];; - -let create () : t = { - bar = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/format_test.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/format_test.ml deleted file mode 100644 index 1a5b28c9af2..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/format_test.ml +++ /dev/null @@ -1,45 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - integer: int32 option; - int32: int32 option; - int64: int64 option; - number: float; - float: float option; - double: float option; - string: string option; - byte: bytes; - binary: string option; - date: string; - date_time: string option; - uuid: string option; - password: string; - (* A string that is a 10 digit number. Can have leading zeros. *) - pattern_with_digits: string option; - (* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. *) - pattern_with_digits_and_delimiter: string option; -} [@@deriving yojson, show ];; - -let create (number : float) (byte : bytes) (date : string) (password : string) : t = { - integer = None; - int32 = None; - int64 = None; - number = number; - float = None; - double = None; - string = None; - byte = byte; - binary = None; - date = date; - date_time = None; - uuid = None; - password = password; - pattern_with_digits = None; - pattern_with_digits_and_delimiter = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/has_only_read_only.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/has_only_read_only.ml deleted file mode 100644 index f1fb4c639c9..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/has_only_read_only.ml +++ /dev/null @@ -1,17 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - bar: string option; - foo: string option; -} [@@deriving yojson, show ];; - -let create () : t = { - bar = None; - foo = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/health_check_result.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/health_check_result.ml deleted file mode 100644 index 6103f54fa2c..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/health_check_result.ml +++ /dev/null @@ -1,17 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - * Schema Health_check_result.t : Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. - *) - -type t = { - nullable_message: string option; -} [@@deriving yojson, show ];; - -(** Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. *) -let create () : t = { - nullable_message = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object.ml deleted file mode 100644 index 092a7bca691..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object.ml +++ /dev/null @@ -1,19 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - (* Updated name of the pet *) - name: string option; - (* Updated status of the pet *) - status: string option; -} [@@deriving yojson, show ];; - -let create () : t = { - name = None; - status = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_1.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_1.ml deleted file mode 100644 index be3c829f5e0..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_1.ml +++ /dev/null @@ -1,19 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - (* Additional data to pass to server *) - additional_metadata: string option; - (* file to upload *) - file: string option; -} [@@deriving yojson, show ];; - -let create () : t = { - additional_metadata = None; - file = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_2.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_2.ml deleted file mode 100644 index 433587a195c..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_2.ml +++ /dev/null @@ -1,19 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - (* Form parameter enum test (string array) *) - enum_form_string_array: Enums.inline_object_2_enum_form_string_array list; - (* Form parameter enum test (string) *) - enum_form_string: Enums.enumclass option; -} [@@deriving yojson, show ];; - -let create () : t = { - enum_form_string_array = []; - enum_form_string = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_3.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_3.ml deleted file mode 100644 index 9ae5a0c464d..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_3.ml +++ /dev/null @@ -1,55 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - (* None *) - integer: int32 option; - (* None *) - int32: int32 option; - (* None *) - int64: int64 option; - (* None *) - number: float; - (* None *) - float: float option; - (* None *) - double: float; - (* None *) - string: string option; - (* None *) - pattern_without_delimiter: string; - (* None *) - byte: bytes; - (* None *) - binary: string option; - (* None *) - date: string option; - (* None *) - date_time: string option; - (* None *) - password: string option; - (* None *) - callback: string option; -} [@@deriving yojson, show ];; - -let create (number : float) (double : float) (pattern_without_delimiter : string) (byte : bytes) : t = { - integer = None; - int32 = None; - int64 = None; - number = number; - float = None; - double = double; - string = None; - pattern_without_delimiter = pattern_without_delimiter; - byte = byte; - binary = None; - date = None; - date_time = None; - password = None; - callback = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_4.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_4.ml deleted file mode 100644 index 1291f3285ed..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_4.ml +++ /dev/null @@ -1,19 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - (* field1 *) - param: string; - (* field2 *) - param2: string; -} [@@deriving yojson, show ];; - -let create (param : string) (param2 : string) : t = { - param = param; - param2 = param2; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_5.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_5.ml deleted file mode 100644 index 9e4f0b04b27..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/inline_object_5.ml +++ /dev/null @@ -1,19 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - (* Additional data to pass to server *) - additional_metadata: string option; - (* file to upload *) - required_file: string; -} [@@deriving yojson, show ];; - -let create (required_file : string) : t = { - additional_metadata = None; - required_file = required_file; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/inline_response_default.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/inline_response_default.ml deleted file mode 100644 index c5b36a2ffd4..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/inline_response_default.ml +++ /dev/null @@ -1,15 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - string: Foo.t option; -} [@@deriving yojson, show ];; - -let create () : t = { - string = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/map_test.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/map_test.ml deleted file mode 100644 index 8b463f70791..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/map_test.ml +++ /dev/null @@ -1,21 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - map_map_of_string: (string * (string * string) list) list; - map_of_enum_string: (string * Enums.maptest_map_of_enum_string) list; - direct_map: (string * bool) list; - indirect_map: (string * bool) list; -} [@@deriving yojson, show ];; - -let create () : t = { - map_map_of_string = []; - map_of_enum_string = []; - direct_map = []; - indirect_map = []; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/mixed_properties_and_additional_properties_class.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/mixed_properties_and_additional_properties_class.ml deleted file mode 100644 index 3cae9de2711..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/mixed_properties_and_additional_properties_class.ml +++ /dev/null @@ -1,19 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - uuid: string option; - date_time: string option; - map: (string * Animal.t) list; -} [@@deriving yojson, show ];; - -let create () : t = { - uuid = None; - date_time = None; - map = []; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/model_200_response.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/model_200_response.ml deleted file mode 100644 index f8065e45dfc..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/model_200_response.ml +++ /dev/null @@ -1,19 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - * Schema Model_200_response.t : Model for testing model name starting with number - *) - -type t = { - name: int32 option; - _class: string option; -} [@@deriving yojson, show ];; - -(** Model for testing model name starting with number *) -let create () : t = { - name = None; - _class = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/model__special_model_name_.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/model__special_model_name_.ml deleted file mode 100644 index 5e70029989c..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/model__special_model_name_.ml +++ /dev/null @@ -1,15 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - special_property_name: int64 option; -} [@@deriving yojson, show ];; - -let create () : t = { - special_property_name = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/name.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/name.ml deleted file mode 100644 index 6a8377a933d..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/name.ml +++ /dev/null @@ -1,23 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - * Schema Name.t : Model for testing model name same as property name - *) - -type t = { - name: int32; - snake_case: int32 option; - property: string option; - var_123_number: int32 option; -} [@@deriving yojson, show ];; - -(** Model for testing model name same as property name *) -let create (name : int32) : t = { - name = name; - snake_case = None; - property = None; - var_123_number = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/nullable_class.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/nullable_class.ml deleted file mode 100644 index 1787dd6dd00..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/nullable_class.ml +++ /dev/null @@ -1,37 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - integer_prop: int32 option; - number_prop: float option; - boolean_prop: bool option; - string_prop: string option; - date_prop: string option; - datetime_prop: string option; - array_nullable_prop: Yojson.Safe.t list; - array_and_items_nullable_prop: Yojson.Safe.t list; - array_items_nullable: Yojson.Safe.t list; - object_nullable_prop: (string * Yojson.Safe.t) list; - object_and_items_nullable_prop: (string * Yojson.Safe.t) list; - object_items_nullable: (string * Yojson.Safe.t) list; -} [@@deriving yojson, show ];; - -let create () : t = { - integer_prop = None; - number_prop = None; - boolean_prop = None; - string_prop = None; - date_prop = None; - datetime_prop = None; - array_nullable_prop = []; - array_and_items_nullable_prop = []; - array_items_nullable = []; - object_nullable_prop = []; - object_and_items_nullable_prop = []; - object_items_nullable = []; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/number_only.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/number_only.ml deleted file mode 100644 index db1cefc7ef1..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/number_only.ml +++ /dev/null @@ -1,15 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - just_number: float option; -} [@@deriving yojson, show ];; - -let create () : t = { - just_number = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/order.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/order.ml deleted file mode 100644 index b2325d39c1e..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/order.ml +++ /dev/null @@ -1,26 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - id: int64 option; - pet_id: int64 option; - quantity: int32 option; - ship_date: string option; - (* Order Status *) - status: Enums.status option; - complete: bool option; -} [@@deriving yojson, show ];; - -let create () : t = { - id = None; - pet_id = None; - quantity = None; - ship_date = None; - status = None; - complete = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/outer_composite.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/outer_composite.ml deleted file mode 100644 index 82aa40fedd8..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/outer_composite.ml +++ /dev/null @@ -1,19 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - my_number: float option; - my_string: string option; - my_boolean: bool option; -} [@@deriving yojson, show ];; - -let create () : t = { - my_number = None; - my_string = None; - my_boolean = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/pet.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/pet.ml deleted file mode 100644 index 05a7481357c..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/pet.ml +++ /dev/null @@ -1,26 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - id: int64 option; - category: Category.t option; - name: string; - photo_urls: string list; - tags: Tag.t list; - (* pet status in the store *) - status: Enums.pet_status option; -} [@@deriving yojson, show ];; - -let create (name : string) (photo_urls : string list) : t = { - id = None; - category = None; - name = name; - photo_urls = photo_urls; - tags = []; - status = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/read_only_first.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/read_only_first.ml deleted file mode 100644 index c44891ba066..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/read_only_first.ml +++ /dev/null @@ -1,17 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - bar: string option; - baz: string option; -} [@@deriving yojson, show ];; - -let create () : t = { - bar = None; - baz = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/return.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/return.ml deleted file mode 100644 index 73f59b66e3c..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/return.ml +++ /dev/null @@ -1,17 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - * Schema Return.t : Model for testing reserved words - *) - -type t = { - return: int32 option; -} [@@deriving yojson, show ];; - -(** Model for testing reserved words *) -let create () : t = { - return = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/tag.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/tag.ml deleted file mode 100644 index 00f8072ef9c..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/tag.ml +++ /dev/null @@ -1,17 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - id: int64 option; - name: string option; -} [@@deriving yojson, show ];; - -let create () : t = { - id = None; - name = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/models/user.ml b/samples/openapi3/client/petstore/ocaml-client/src/models/user.ml deleted file mode 100644 index 2791779acad..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/models/user.ml +++ /dev/null @@ -1,30 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - id: int64 option; - username: string option; - first_name: string option; - last_name: string option; - email: string option; - password: string option; - phone: string option; - (* User Status *) - user_status: int32 option; -} [@@deriving yojson, show ];; - -let create () : t = { - id = None; - username = None; - first_name = None; - last_name = None; - email = None; - password = None; - phone = None; - user_status = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml-client/src/support/enums.ml b/samples/openapi3/client/petstore/ocaml-client/src/support/enums.ml deleted file mode 100644 index 13e0e6d0064..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/support/enums.ml +++ /dev/null @@ -1,142 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type outerenuminteger = [ -| `_0 [@printer fun fmt _ -> Format.pp_print_string fmt "0"] [@name "0"] -| `_1 [@printer fun fmt _ -> Format.pp_print_string fmt "1"] [@name "1"] -| `_2 [@printer fun fmt _ -> Format.pp_print_string fmt "2"] [@name "2"] -] [@@deriving yojson, show { with_path = false }];; - -let outerenuminteger_of_yojson json = outerenuminteger_of_yojson (`List [json]) -let outerenuminteger_to_yojson e = - match outerenuminteger_to_yojson e with - | `List [json] -> json - | json -> json - -type status = [ -| `Placed [@printer fun fmt _ -> Format.pp_print_string fmt "placed"] [@name "placed"] -| `Approved [@printer fun fmt _ -> Format.pp_print_string fmt "approved"] [@name "approved"] -| `Delivered [@printer fun fmt _ -> Format.pp_print_string fmt "delivered"] [@name "delivered"] -] [@@deriving yojson, show { with_path = false }];; - -let status_of_yojson json = status_of_yojson (`List [json]) -let status_to_yojson e = - match status_to_yojson e with - | `List [json] -> json - | json -> json - -type inline_object_2_enum_form_string_array = [ -| `Greater_Than [@printer fun fmt _ -> Format.pp_print_string fmt ">"] [@name ">"] -| `Dollar [@printer fun fmt _ -> Format.pp_print_string fmt "$"] [@name "$"] -] [@@deriving yojson, show { with_path = false }];; - -let inline_object_2_enum_form_string_array_of_yojson json = inline_object_2_enum_form_string_array_of_yojson (`List [json]) -let inline_object_2_enum_form_string_array_to_yojson e = - match inline_object_2_enum_form_string_array_to_yojson e with - | `List [json] -> json - | json -> json - -type enum_query_integer = [ -| `_1 [@printer fun fmt _ -> Format.pp_print_string fmt "1"] [@name "1"] -| `Minus2 [@printer fun fmt _ -> Format.pp_print_string fmt "-2"] [@name "-2"] -] [@@deriving yojson, show { with_path = false }];; - -let enum_query_integer_of_yojson json = enum_query_integer_of_yojson (`List [json]) -let enum_query_integer_to_yojson e = - match enum_query_integer_to_yojson e with - | `List [json] -> json - | json -> json - -type enum_number = [ -| `_1Period1 [@printer fun fmt _ -> Format.pp_print_string fmt "1.1"] [@name "1.1"] -| `Minus1Period2 [@printer fun fmt _ -> Format.pp_print_string fmt "-1.2"] [@name "-1.2"] -] [@@deriving yojson, show { with_path = false }];; - -let enum_number_of_yojson json = enum_number_of_yojson (`List [json]) -let enum_number_to_yojson e = - match enum_number_to_yojson e with - | `List [json] -> json - | json -> json - -type maptest_map_of_enum_string = [ -| `UPPER [@printer fun fmt _ -> Format.pp_print_string fmt "UPPER"] [@name "UPPER"] -| `Lower [@printer fun fmt _ -> Format.pp_print_string fmt "lower"] [@name "lower"] -] [@@deriving yojson, show { with_path = false }];; - -let maptest_map_of_enum_string_of_yojson json = maptest_map_of_enum_string_of_yojson (`List [json]) -let maptest_map_of_enum_string_to_yojson e = - match maptest_map_of_enum_string_to_yojson e with - | `List [json] -> json - | json -> json - -type enum_integer = [ -| `_1 [@printer fun fmt _ -> Format.pp_print_string fmt "1"] [@name "1"] -| `Minus1 [@printer fun fmt _ -> Format.pp_print_string fmt "-1"] [@name "-1"] -] [@@deriving yojson, show { with_path = false }];; - -let enum_integer_of_yojson json = enum_integer_of_yojson (`List [json]) -let enum_integer_to_yojson e = - match enum_integer_to_yojson e with - | `List [json] -> json - | json -> json - -type just_symbol = [ -| `Greater_ThanEqual [@printer fun fmt _ -> Format.pp_print_string fmt ">="] [@name ">="] -| `Dollar [@printer fun fmt _ -> Format.pp_print_string fmt "$"] [@name "$"] -] [@@deriving yojson, show { with_path = false }];; - -let just_symbol_of_yojson json = just_symbol_of_yojson (`List [json]) -let just_symbol_to_yojson e = - match just_symbol_to_yojson e with - | `List [json] -> json - | json -> json - -type enumarrays_array_enum = [ -| `Fish [@printer fun fmt _ -> Format.pp_print_string fmt "fish"] [@name "fish"] -| `Crab [@printer fun fmt _ -> Format.pp_print_string fmt "crab"] [@name "crab"] -] [@@deriving yojson, show { with_path = false }];; - -let enumarrays_array_enum_of_yojson json = enumarrays_array_enum_of_yojson (`List [json]) -let enumarrays_array_enum_to_yojson e = - match enumarrays_array_enum_to_yojson e with - | `List [json] -> json - | json -> json - -type pet_status = [ -| `Available [@printer fun fmt _ -> Format.pp_print_string fmt "available"] [@name "available"] -| `Pending [@printer fun fmt _ -> Format.pp_print_string fmt "pending"] [@name "pending"] -| `Sold [@printer fun fmt _ -> Format.pp_print_string fmt "sold"] [@name "sold"] -] [@@deriving yojson, show { with_path = false }];; - -let pet_status_of_yojson json = pet_status_of_yojson (`List [json]) -let pet_status_to_yojson e = - match pet_status_to_yojson e with - | `List [json] -> json - | json -> json - -type enumclass = [ -| `Underscoreabc [@printer fun fmt _ -> Format.pp_print_string fmt "_abc"] [@name "_abc"] -| `Minusefg [@printer fun fmt _ -> Format.pp_print_string fmt "-efg"] [@name "-efg"] -| `Left_ParenthesisxyzRight_Parenthesis [@printer fun fmt _ -> Format.pp_print_string fmt "(xyz)"] [@name "(xyz)"] -] [@@deriving yojson, show { with_path = false }];; - -let enumclass_of_yojson json = enumclass_of_yojson (`List [json]) -let enumclass_to_yojson e = - match enumclass_to_yojson e with - | `List [json] -> json - | json -> json - -type enum_string = [ -| `UPPER [@printer fun fmt _ -> Format.pp_print_string fmt "UPPER"] [@name "UPPER"] -| `Lower [@printer fun fmt _ -> Format.pp_print_string fmt "lower"] [@name "lower"] -] [@@deriving yojson, show { with_path = false }];; - -let enum_string_of_yojson json = enum_string_of_yojson (`List [json]) -let enum_string_to_yojson e = - match enum_string_to_yojson e with - | `List [json] -> json - | json -> json diff --git a/samples/openapi3/client/petstore/ocaml-client/src/support/jsonSupport.ml b/samples/openapi3/client/petstore/ocaml-client/src/support/jsonSupport.ml deleted file mode 100644 index 4b0fac77545..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/support/jsonSupport.ml +++ /dev/null @@ -1,55 +0,0 @@ -open Ppx_deriving_yojson_runtime - -let unwrap to_json json = - match to_json json with - | Result.Ok json -> json - | Result.Error s -> failwith s - -let to_int json = - match json with - | `Int x -> x - | `Intlit s -> int_of_string s - | _ -> failwith "JsonSupport.to_int" - -let to_bool json = - match json with - | `Bool x -> x - | _ -> failwith "JsonSupport.to_bool" - -let to_float json = - match json with - | `Float x -> x - | _ -> failwith "JsonSupport.to_float" - -let to_string json = - match json with - | `String s -> s - | _ -> failwith "JsonSupport.to_string" - -let to_int32 json : int32 = - match json with - | `Int x -> Int32.of_int x - | `Intlit s -> Int32.of_string s - | _ -> failwith "JsonSupport.to_int32" - -let to_int64 json : int64 = - match json with - | `Int x -> Int64.of_int x - | `Intlit s -> Int64.of_string s - | _ -> failwith "JsonSupport.to_int64" - -let of_int x = `Int x - -let of_bool b = `Bool b - -let of_float x = `Float x - -let of_string s = `String s - -let of_int32 x = `Intlit (Int32.to_string x) - -let of_int64 x = `Intlit (Int64.to_string x) - -let of_list_of of_f l = `List (List.map of_f l) - -let of_map_of of_f l = `Assoc (List.map (fun (k, v) -> (k, of_f v)) l) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ocaml-client/src/support/request.ml b/samples/openapi3/client/petstore/ocaml-client/src/support/request.ml deleted file mode 100644 index 5f864b36583..00000000000 --- a/samples/openapi3/client/petstore/ocaml-client/src/support/request.ml +++ /dev/null @@ -1,39 +0,0 @@ -let base_url = "http://petstore.swagger.io:80/v2" -let default_headers = Cohttp.Header.init_with "Content-Type" "application/json" - -let build_uri operation_path = Uri.of_string (base_url ^ operation_path) -let write_json_body to_json payload = - to_json payload |> Yojson.Safe.to_string ~std:true |> Cohttp_lwt.Body.of_string - -let read_json_body body = - Lwt.(Cohttp_lwt.Body.to_string body >|= Yojson.Safe.from_string) - -let read_json_body_as of_json body = - Lwt.(read_json_body body >|= of_json) - -let read_json_body_as_list body = - Lwt.(read_json_body body >|= Yojson.Safe.Util.to_list) - -let read_json_body_as_list_of of_json body = - Lwt.(read_json_body_as_list body >|= List.map of_json) - -let read_json_body_as_map_of of_json body = - Lwt.(read_json_body body >|= Yojson.Safe.Util.to_assoc >|= List.map (fun (s, v) -> (s, of_json v))) - -let replace_path_param uri param_name param_value = - let regexp = Str.regexp (Str.quote ("{" ^ param_name ^ "}")) in - let path = Str.global_replace regexp param_value (Uri.path uri) in - Uri.with_path uri path - -let init_form_encoded_body () = "" - -let add_form_encoded_body_param params (paramName, paramValue) = - let new_param_enc = Printf.sprintf {|%s=%s|} (Uri.pct_encode paramName) (Uri.pct_encode paramValue) in - if params = "" - then new_param_enc - else Printf.sprintf {|%s&%s|} params new_param_enc - -let add_form_encoded_body_params params (paramName, new_params) = - add_form_encoded_body_param params (paramName, String.concat "," new_params) - -let finalize_form_encoded_body body = Cohttp_lwt.Body.of_string body \ No newline at end of file From 752030890f5da10e6eb4ac7e2454207b7bc005d3 Mon Sep 17 00:00:00 2001 From: dan-drl <43010333+dan-drl@users.noreply.github.com> Date: Thu, 8 Aug 2019 09:17:54 -0700 Subject: [PATCH 65/75] Fix issue deserializing to nullptr (#3572) * Fix issue deserializing to nullptr * Update codegen files --- .../languages/CppRestSdkClientCodegen.java | 3 ++ .../modelbase-source.mustache | 15 ++++++---- .../petstore/cpp-restsdk/client/.gitignore | 29 +++++++++++++++++++ .../client/.openapi-generator-ignore | 23 +++++++++++++++ .../client/.openapi-generator/VERSION | 1 + .../petstore/cpp-restsdk/client/ApiClient.cpp | 2 +- .../petstore/cpp-restsdk/client/ApiClient.h | 2 +- .../cpp-restsdk/client/ApiConfiguration.cpp | 2 +- .../cpp-restsdk/client/ApiConfiguration.h | 2 +- .../cpp-restsdk/client/ApiException.cpp | 2 +- .../cpp-restsdk/client/ApiException.h | 2 +- .../cpp-restsdk/client/HttpContent.cpp | 2 +- .../petstore/cpp-restsdk/client/HttpContent.h | 2 +- .../petstore/cpp-restsdk/client/IHttpBody.h | 2 +- .../petstore/cpp-restsdk/client/JsonBody.cpp | 2 +- .../petstore/cpp-restsdk/client/JsonBody.h | 2 +- .../petstore/cpp-restsdk/client/ModelBase.cpp | 17 ++++++----- .../petstore/cpp-restsdk/client/ModelBase.h | 2 +- .../cpp-restsdk/client/MultipartFormData.cpp | 2 +- .../cpp-restsdk/client/MultipartFormData.h | 2 +- .../petstore/cpp-restsdk/client/Object.cpp | 2 +- .../petstore/cpp-restsdk/client/Object.h | 2 +- .../cpp-restsdk/client/api/PetApi.cpp | 2 +- .../petstore/cpp-restsdk/client/api/PetApi.h | 2 +- .../cpp-restsdk/client/api/StoreApi.cpp | 2 +- .../cpp-restsdk/client/api/StoreApi.h | 2 +- .../cpp-restsdk/client/api/UserApi.cpp | 2 +- .../petstore/cpp-restsdk/client/api/UserApi.h | 2 +- .../cpp-restsdk/client/model/ApiResponse.cpp | 2 +- .../cpp-restsdk/client/model/ApiResponse.h | 2 +- .../cpp-restsdk/client/model/Category.cpp | 2 +- .../cpp-restsdk/client/model/Category.h | 2 +- .../cpp-restsdk/client/model/Order.cpp | 2 +- .../petstore/cpp-restsdk/client/model/Order.h | 2 +- .../petstore/cpp-restsdk/client/model/Pet.cpp | 2 +- .../petstore/cpp-restsdk/client/model/Pet.h | 2 +- .../petstore/cpp-restsdk/client/model/Tag.cpp | 2 +- .../petstore/cpp-restsdk/client/model/Tag.h | 2 +- .../cpp-restsdk/client/model/User.cpp | 2 +- .../petstore/cpp-restsdk/client/model/User.h | 2 +- 40 files changed, 109 insertions(+), 47 deletions(-) create mode 100644 samples/client/petstore/cpp-restsdk/client/.gitignore create mode 100644 samples/client/petstore/cpp-restsdk/client/.openapi-generator-ignore create mode 100644 samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java index aabac7f7a38..ddfdcbb0e0b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppRestSdkClientCodegen.java @@ -359,7 +359,10 @@ public class CppRestSdkClientCodegen extends AbstractCppCodegen { return "new " + toModelName(ModelUtils.getSimpleRef(p.get$ref())) + "()"; } else if (ModelUtils.isStringSchema(p)) { return "utility::conversions::to_string_t(\"\")"; + } else if (ModelUtils.isFreeFormObject(p)) { + return "new Object()"; } + return "nullptr"; } diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-source.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-source.mustache index 97f8aea1090..91446e73a33 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-source.mustache @@ -265,16 +265,19 @@ std::shared_ptr ModelBase::fromBase64( const utility::string_t& en int64_t ModelBase::int64_tFromJson(const web::json::value& val) { - return val.as_number().to_int64(); + return val.is_null() ? std::numeric_limits::quiet_NaN() : val.as_number().to_int64(); } + int32_t ModelBase::int32_tFromJson(const web::json::value& val) { - return val.as_integer(); + return val.is_null() ? std::numeric_limits::quiet_NaN() : val.as_integer(); } + float ModelBase::floatFromJson(const web::json::value& val) { - return static_cast(val.as_double()); + return val.is_null() ? std::numeric_limits::quiet_NaN() : static_cast(val.as_double()); } + utility::string_t ModelBase::stringFromJson(const web::json::value& val) { return val.is_string() ? val.as_string() : utility::conversions::to_string_t(""); @@ -282,15 +285,15 @@ utility::string_t ModelBase::stringFromJson(const web::json::value& val) utility::datetime ModelBase::dateFromJson(const web::json::value& val) { - return utility::datetime::from_string(val.as_string(), utility::datetime::ISO_8601); + return val.is_null() ? utility::datetime::from_string(L"NULL", utility::datetime::ISO_8601) : utility::datetime::from_string(val.as_string(), utility::datetime::ISO_8601); } bool ModelBase::boolFromJson(const web::json::value& val) { - return val.as_bool(); + return val.is_null() ? false : val.as_bool(); } double ModelBase::doubleFromJson(const web::json::value& val) { - return val.as_double(); + return val.is_null() ? std::numeric_limits::quiet_NaN(): val.as_double(); } int64_t ModelBase::int64_tFromHttpContent(std::shared_ptr val) diff --git a/samples/client/petstore/cpp-restsdk/client/.gitignore b/samples/client/petstore/cpp-restsdk/client/.gitignore new file mode 100644 index 00000000000..4581ef2eeef --- /dev/null +++ b/samples/client/petstore/cpp-restsdk/client/.gitignore @@ -0,0 +1,29 @@ +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app diff --git a/samples/client/petstore/cpp-restsdk/client/.openapi-generator-ignore b/samples/client/petstore/cpp-restsdk/client/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/cpp-restsdk/client/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION b/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION new file mode 100644 index 00000000000..83a328a9227 --- /dev/null +++ b/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp b/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp index 384eb8a8bc5..7322c22305c 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiClient.h b/samples/client/petstore/cpp-restsdk/client/ApiClient.h index 5c5d78c765e..c41ffa71558 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiClient.h +++ b/samples/client/petstore/cpp-restsdk/client/ApiClient.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp index 251b0d0d299..6d189ae2091 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h index f6f35205990..12701aabdd2 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h +++ b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiException.cpp b/samples/client/petstore/cpp-restsdk/client/ApiException.cpp index b0a637cf600..f45ee1f0179 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiException.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ApiException.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiException.h b/samples/client/petstore/cpp-restsdk/client/ApiException.h index 30f5ef51df3..882f9941ca7 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiException.h +++ b/samples/client/petstore/cpp-restsdk/client/ApiException.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp b/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp index 6dedcd29908..595b5368ea5 100644 --- a/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp +++ b/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/HttpContent.h b/samples/client/petstore/cpp-restsdk/client/HttpContent.h index b357475da38..aadb725cedd 100644 --- a/samples/client/petstore/cpp-restsdk/client/HttpContent.h +++ b/samples/client/petstore/cpp-restsdk/client/HttpContent.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/IHttpBody.h b/samples/client/petstore/cpp-restsdk/client/IHttpBody.h index 865bd467f30..de53bbe061d 100644 --- a/samples/client/petstore/cpp-restsdk/client/IHttpBody.h +++ b/samples/client/petstore/cpp-restsdk/client/IHttpBody.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp b/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp index e2edc1b67ef..d0a8630ded6 100644 --- a/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp +++ b/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/JsonBody.h b/samples/client/petstore/cpp-restsdk/client/JsonBody.h index fba123dfc42..cc5132f968a 100644 --- a/samples/client/petstore/cpp-restsdk/client/JsonBody.h +++ b/samples/client/petstore/cpp-restsdk/client/JsonBody.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp b/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp index 8b9f859dd6e..1aab52acc40 100644 --- a/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ @@ -276,16 +276,19 @@ std::shared_ptr ModelBase::fromBase64( const utility::string_t& en int64_t ModelBase::int64_tFromJson(const web::json::value& val) { - return val.as_number().to_int64(); + return val.is_null() ? std::numeric_limits::quiet_NaN() : val.as_number().to_int64(); } + int32_t ModelBase::int32_tFromJson(const web::json::value& val) { - return val.as_integer(); + return val.is_null() ? std::numeric_limits::quiet_NaN() : val.as_integer(); } + float ModelBase::floatFromJson(const web::json::value& val) { - return static_cast(val.as_double()); + return val.is_null() ? std::numeric_limits::quiet_NaN() : static_cast(val.as_double()); } + utility::string_t ModelBase::stringFromJson(const web::json::value& val) { return val.is_string() ? val.as_string() : utility::conversions::to_string_t(""); @@ -293,15 +296,15 @@ utility::string_t ModelBase::stringFromJson(const web::json::value& val) utility::datetime ModelBase::dateFromJson(const web::json::value& val) { - return utility::datetime::from_string(val.as_string(), utility::datetime::ISO_8601); + return val.is_null() ? utility::datetime::from_string(L"NULL", utility::datetime::ISO_8601) : utility::datetime::from_string(val.as_string(), utility::datetime::ISO_8601); } bool ModelBase::boolFromJson(const web::json::value& val) { - return val.as_bool(); + return val.is_null() ? false : val.as_bool(); } double ModelBase::doubleFromJson(const web::json::value& val) { - return val.as_double(); + return val.is_null() ? std::numeric_limits::quiet_NaN(): val.as_double(); } int64_t ModelBase::int64_tFromHttpContent(std::shared_ptr val) diff --git a/samples/client/petstore/cpp-restsdk/client/ModelBase.h b/samples/client/petstore/cpp-restsdk/client/ModelBase.h index 26459aa5895..903259b3568 100644 --- a/samples/client/petstore/cpp-restsdk/client/ModelBase.h +++ b/samples/client/petstore/cpp-restsdk/client/ModelBase.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp index ec6af2de5e0..c9dbb87ccbc 100644 --- a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp +++ b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h index 96d8c3a662a..d8eec95b333 100644 --- a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h +++ b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/Object.cpp b/samples/client/petstore/cpp-restsdk/client/Object.cpp index 3624e24a017..4ff21f09375 100644 --- a/samples/client/petstore/cpp-restsdk/client/Object.cpp +++ b/samples/client/petstore/cpp-restsdk/client/Object.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/Object.h b/samples/client/petstore/cpp-restsdk/client/Object.h index bc2c7aa7573..c688e4f28d6 100644 --- a/samples/client/petstore/cpp-restsdk/client/Object.h +++ b/samples/client/petstore/cpp-restsdk/client/Object.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp b/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp index 0c67b5ecbf5..93e5d8d4897 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp +++ b/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/PetApi.h b/samples/client/petstore/cpp-restsdk/client/api/PetApi.h index 09b2f06da9b..f95c29ddd4c 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/PetApi.h +++ b/samples/client/petstore/cpp-restsdk/client/api/PetApi.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp index a7bcf614ee2..e991f48b07f 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp +++ b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h index 2aaf9bf5969..cc2420fe3ae 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h +++ b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp b/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp index a4c4f1bf462..dadd8fdbe14 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp +++ b/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/UserApi.h b/samples/client/petstore/cpp-restsdk/client/api/UserApi.h index aa840cf1f90..cce86a50186 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/UserApi.h +++ b/samples/client/petstore/cpp-restsdk/client/api/UserApi.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp index 3fa6061fb04..22a5325268f 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h index 9b1d7abc1a7..430d8263a82 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h +++ b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Category.cpp b/samples/client/petstore/cpp-restsdk/client/model/Category.cpp index 8d21469964c..e3dacdc5a71 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Category.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Category.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Category.h b/samples/client/petstore/cpp-restsdk/client/model/Category.h index 1d425850a5b..2f84432cfc5 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Category.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Category.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Order.cpp b/samples/client/petstore/cpp-restsdk/client/model/Order.cpp index e137a045fa6..e0c8efb0def 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Order.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Order.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Order.h b/samples/client/petstore/cpp-restsdk/client/model/Order.h index 9d697587404..c1dd6cc72a5 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Order.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Order.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp b/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp index 76a39be3db6..3f595e30214 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Pet.h b/samples/client/petstore/cpp-restsdk/client/model/Pet.h index 3ebb80bf285..875754ec678 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Pet.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Pet.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp b/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp index a4af089387e..20585ada362 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Tag.h b/samples/client/petstore/cpp-restsdk/client/model/Tag.h index db92cc2549c..0ff1241b09f 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Tag.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Tag.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/User.cpp b/samples/client/petstore/cpp-restsdk/client/model/User.cpp index 8ffd2ea50d0..33547426e0f 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/User.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/User.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/User.h b/samples/client/petstore/cpp-restsdk/client/model/User.h index e3a970cb4df..9ff871a6108 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/User.h +++ b/samples/client/petstore/cpp-restsdk/client/model/User.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ From fbb2f1e05a6685499447758749f6b8129a6dfe1c Mon Sep 17 00:00:00 2001 From: Mario De Schaepmeester Date: Thu, 8 Aug 2019 18:24:47 +0200 Subject: [PATCH 66/75] [C#][client][csharp-netcore] Fix csharp netcore defaultheaders (#3562) * [csharp-netcore] Send default HTTP headers with requests * [csharp-netcore] Add DefaultHeaders in favor of DefaultHeader --- .../csharp-netcore/ApiClient.mustache | 8 ++++ .../csharp-netcore/Configuration.mustache | 40 +++++++++++++------ .../IReadableConfiguration.mustache | 8 ++++ .../src/Org.OpenAPITools/Client/ApiClient.cs | 8 ++++ .../Org.OpenAPITools/Client/Configuration.cs | 40 +++++++++++++------ .../Client/IReadableConfiguration.cs | 8 ++++ .../src/Org.OpenAPITools/Client/ApiClient.cs | 8 ++++ .../Org.OpenAPITools/Client/Configuration.cs | 40 +++++++++++++------ .../Client/IReadableConfiguration.cs | 8 ++++ 9 files changed, 132 insertions(+), 36 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache index f3232ec5f16..55b3e96c4c7 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache @@ -270,6 +270,14 @@ namespace {{packageName}}.Client } } + if (configuration.DefaultHeaders != null) + { + foreach (var headerParam in configuration.DefaultHeaders) + { + request.AddHeader(headerParam.Key, headerParam.Value); + } + } + if (options.HeaderParameters != null) { foreach (var headerParam in options.HeaderParameters) diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache index 7f70ee4c5e6..f9a29c90aa3 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache @@ -35,7 +35,7 @@ namespace {{packageName}}.Client #endregion Constants #region Static Members - + /// /// Default creation of exceptions for a given method name and response object /// @@ -65,7 +65,7 @@ namespace {{packageName}}.Client /// Example: http://localhost:3000/v1/ /// private String _basePath; - + /// /// Gets or sets the API key based on the authentication name. /// This is the key and value comprising the "secret" for acessing an API. @@ -94,7 +94,7 @@ namespace {{packageName}}.Client { UserAgent = "{{#httpUserAgent}}{{.}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{packageVersion}}/csharp{{/httpUserAgent}}"; BasePath = "{{{basePath}}}"; - DefaultHeader = new {{^net35}}Concurrent{{/net35}}Dictionary(); + DefaultHeaders = new {{^net35}}Concurrent{{/net35}}Dictionary(); ApiKey = new {{^net35}}Concurrent{{/net35}}Dictionary(); ApiKeyPrefix = new {{^net35}}Concurrent{{/net35}}Dictionary(); @@ -107,15 +107,15 @@ namespace {{packageName}}.Client /// [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] public Configuration( - IDictionary defaultHeader, + IDictionary defaultHeaders, IDictionary apiKey, IDictionary apiKeyPrefix, string basePath = "{{{basePath}}}") : this() { if (string.{{^net35}}IsNullOrWhiteSpace{{/net35}}{{#net35}}IsNullOrEmpty{{/net35}}(basePath)) throw new ArgumentException("The provided basePath is invalid.", "basePath"); - if (defaultHeader == null) - throw new ArgumentNullException("defaultHeader"); + if (defaultHeaders == null) + throw new ArgumentNullException("defaultHeaders"); if (apiKey == null) throw new ArgumentNullException("apiKey"); if (apiKeyPrefix == null) @@ -123,9 +123,9 @@ namespace {{packageName}}.Client BasePath = basePath; - foreach (var keyValuePair in defaultHeader) + foreach (var keyValuePair in defaultHeaders) { - DefaultHeader.Add(keyValuePair); + DefaultHeaders.Add(keyValuePair); } foreach (var keyValuePair in apiKey) @@ -156,7 +156,23 @@ namespace {{packageName}}.Client /// /// Gets or sets the default header. /// - public virtual IDictionary DefaultHeader { get; set; } + [Obsolete("Use DefaultHeaders instead.")] + public virtual IDictionary DefaultHeader + { + get + { + return DefaultHeaders; + } + set + { + DefaultHeaders = value; + } + } + + /// + /// Gets or sets the default headers. + /// + public virtual IDictionary DefaultHeaders { get; set; } /// /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. @@ -374,17 +390,17 @@ namespace {{packageName}}.Client Dictionary apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); Dictionary apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); - Dictionary defaultHeader = first.DefaultHeader.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary defaultHeaders = first.DefaultHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); foreach (var kvp in second.ApiKey) apiKey[kvp.Key] = kvp.Value; foreach (var kvp in second.ApiKeyPrefix) apiKeyPrefix[kvp.Key] = kvp.Value; - foreach (var kvp in second.DefaultHeader) defaultHeader[kvp.Key] = kvp.Value; + foreach (var kvp in second.DefaultHeaders) defaultHeaders[kvp.Key] = kvp.Value; var config = new Configuration { ApiKey = apiKey, ApiKeyPrefix = apiKeyPrefix, - DefaultHeader = defaultHeader, + DefaultHeader = defaultHeaders, BasePath = second.BasePath ?? first.BasePath, Timeout = second.Timeout, UserAgent = second.UserAgent ?? first.UserAgent, diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/IReadableConfiguration.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/IReadableConfiguration.mustache index ce165e0c81d..0acef255d6c 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/IReadableConfiguration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/IReadableConfiguration.mustache @@ -1,5 +1,6 @@ {{>partial_header}} +using System; using System.Collections.Generic; namespace {{packageName}}.Client @@ -43,8 +44,15 @@ namespace {{packageName}}.Client /// Gets the default header. /// /// Default header. + [Obsolete("Use DefaultHeaders instead.")] IDictionary DefaultHeader { get; } + /// + /// Gets the default headers. + /// + /// Default headers. + IDictionary DefaultHeaders { get; } + /// /// Gets the temp folder path. /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs index cb5dc1a6bca..af5165ee251 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs @@ -273,6 +273,14 @@ namespace Org.OpenAPITools.Client } } + if (configuration.DefaultHeaders != null) + { + foreach (var headerParam in configuration.DefaultHeaders) + { + request.AddHeader(headerParam.Key, headerParam.Value); + } + } + if (options.HeaderParameters != null) { foreach (var headerParam in options.HeaderParameters) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs index 520e1420265..9fadf1712f3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs @@ -42,7 +42,7 @@ namespace Org.OpenAPITools.Client #endregion Constants #region Static Members - + /// /// Default creation of exceptions for a given method name and response object /// @@ -68,7 +68,7 @@ namespace Org.OpenAPITools.Client /// Example: http://localhost:3000/v1/ /// private String _basePath; - + /// /// Gets or sets the API key based on the authentication name. /// This is the key and value comprising the "secret" for acessing an API. @@ -97,7 +97,7 @@ namespace Org.OpenAPITools.Client { UserAgent = "OpenAPI-Generator/1.0.0/csharp"; BasePath = "http://petstore.swagger.io:80/v2"; - DefaultHeader = new ConcurrentDictionary(); + DefaultHeaders = new ConcurrentDictionary(); ApiKey = new ConcurrentDictionary(); ApiKeyPrefix = new ConcurrentDictionary(); @@ -110,15 +110,15 @@ namespace Org.OpenAPITools.Client /// [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] public Configuration( - IDictionary defaultHeader, + IDictionary defaultHeaders, IDictionary apiKey, IDictionary apiKeyPrefix, string basePath = "http://petstore.swagger.io:80/v2") : this() { if (string.IsNullOrWhiteSpace(basePath)) throw new ArgumentException("The provided basePath is invalid.", "basePath"); - if (defaultHeader == null) - throw new ArgumentNullException("defaultHeader"); + if (defaultHeaders == null) + throw new ArgumentNullException("defaultHeaders"); if (apiKey == null) throw new ArgumentNullException("apiKey"); if (apiKeyPrefix == null) @@ -126,9 +126,9 @@ namespace Org.OpenAPITools.Client BasePath = basePath; - foreach (var keyValuePair in defaultHeader) + foreach (var keyValuePair in defaultHeaders) { - DefaultHeader.Add(keyValuePair); + DefaultHeaders.Add(keyValuePair); } foreach (var keyValuePair in apiKey) @@ -159,7 +159,23 @@ namespace Org.OpenAPITools.Client /// /// Gets or sets the default header. /// - public virtual IDictionary DefaultHeader { get; set; } + [Obsolete("Use DefaultHeaders instead.")] + public virtual IDictionary DefaultHeader + { + get + { + return DefaultHeaders; + } + set + { + DefaultHeaders = value; + } + } + + /// + /// Gets or sets the default headers. + /// + public virtual IDictionary DefaultHeaders { get; set; } /// /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. @@ -369,17 +385,17 @@ namespace Org.OpenAPITools.Client Dictionary apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); Dictionary apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); - Dictionary defaultHeader = first.DefaultHeader.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary defaultHeaders = first.DefaultHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); foreach (var kvp in second.ApiKey) apiKey[kvp.Key] = kvp.Value; foreach (var kvp in second.ApiKeyPrefix) apiKeyPrefix[kvp.Key] = kvp.Value; - foreach (var kvp in second.DefaultHeader) defaultHeader[kvp.Key] = kvp.Value; + foreach (var kvp in second.DefaultHeaders) defaultHeaders[kvp.Key] = kvp.Value; var config = new Configuration { ApiKey = apiKey, ApiKeyPrefix = apiKeyPrefix, - DefaultHeader = defaultHeader, + DefaultHeader = defaultHeaders, BasePath = second.BasePath ?? first.BasePath, Timeout = second.Timeout, UserAgent = second.UserAgent ?? first.UserAgent, diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/IReadableConfiguration.cs index 23e1a0c2e19..8faa7f57838 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/IReadableConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -9,6 +9,7 @@ */ +using System; using System.Collections.Generic; namespace Org.OpenAPITools.Client @@ -52,8 +53,15 @@ namespace Org.OpenAPITools.Client /// Gets the default header. /// /// Default header. + [Obsolete("Use DefaultHeaders instead.")] IDictionary DefaultHeader { get; } + /// + /// Gets the default headers. + /// + /// Default headers. + IDictionary DefaultHeaders { get; } + /// /// Gets the temp folder path. /// diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs index e3db56be21b..05c50bceac0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs @@ -274,6 +274,14 @@ namespace Org.OpenAPITools.Client } } + if (configuration.DefaultHeaders != null) + { + foreach (var headerParam in configuration.DefaultHeaders) + { + request.AddHeader(headerParam.Key, headerParam.Value); + } + } + if (options.HeaderParameters != null) { foreach (var headerParam in options.HeaderParameters) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Configuration.cs index 25010fbef9e..4317d59a939 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Configuration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Configuration.cs @@ -42,7 +42,7 @@ namespace Org.OpenAPITools.Client #endregion Constants #region Static Members - + /// /// Default creation of exceptions for a given method name and response object /// @@ -72,7 +72,7 @@ namespace Org.OpenAPITools.Client /// Example: http://localhost:3000/v1/ /// private String _basePath; - + /// /// Gets or sets the API key based on the authentication name. /// This is the key and value comprising the "secret" for acessing an API. @@ -101,7 +101,7 @@ namespace Org.OpenAPITools.Client { UserAgent = "OpenAPI-Generator/1.0.0/csharp"; BasePath = "http://petstore.swagger.io:80/v2"; - DefaultHeader = new ConcurrentDictionary(); + DefaultHeaders = new ConcurrentDictionary(); ApiKey = new ConcurrentDictionary(); ApiKeyPrefix = new ConcurrentDictionary(); @@ -114,15 +114,15 @@ namespace Org.OpenAPITools.Client /// [System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] public Configuration( - IDictionary defaultHeader, + IDictionary defaultHeaders, IDictionary apiKey, IDictionary apiKeyPrefix, string basePath = "http://petstore.swagger.io:80/v2") : this() { if (string.IsNullOrWhiteSpace(basePath)) throw new ArgumentException("The provided basePath is invalid.", "basePath"); - if (defaultHeader == null) - throw new ArgumentNullException("defaultHeader"); + if (defaultHeaders == null) + throw new ArgumentNullException("defaultHeaders"); if (apiKey == null) throw new ArgumentNullException("apiKey"); if (apiKeyPrefix == null) @@ -130,9 +130,9 @@ namespace Org.OpenAPITools.Client BasePath = basePath; - foreach (var keyValuePair in defaultHeader) + foreach (var keyValuePair in defaultHeaders) { - DefaultHeader.Add(keyValuePair); + DefaultHeaders.Add(keyValuePair); } foreach (var keyValuePair in apiKey) @@ -163,7 +163,23 @@ namespace Org.OpenAPITools.Client /// /// Gets or sets the default header. /// - public virtual IDictionary DefaultHeader { get; set; } + [Obsolete("Use DefaultHeaders instead.")] + public virtual IDictionary DefaultHeader + { + get + { + return DefaultHeaders; + } + set + { + DefaultHeaders = value; + } + } + + /// + /// Gets or sets the default headers. + /// + public virtual IDictionary DefaultHeaders { get; set; } /// /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds. @@ -374,17 +390,17 @@ namespace Org.OpenAPITools.Client Dictionary apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); Dictionary apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); - Dictionary defaultHeader = first.DefaultHeader.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + Dictionary defaultHeaders = first.DefaultHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); foreach (var kvp in second.ApiKey) apiKey[kvp.Key] = kvp.Value; foreach (var kvp in second.ApiKeyPrefix) apiKeyPrefix[kvp.Key] = kvp.Value; - foreach (var kvp in second.DefaultHeader) defaultHeader[kvp.Key] = kvp.Value; + foreach (var kvp in second.DefaultHeaders) defaultHeaders[kvp.Key] = kvp.Value; var config = new Configuration { ApiKey = apiKey, ApiKeyPrefix = apiKeyPrefix, - DefaultHeader = defaultHeader, + DefaultHeader = defaultHeaders, BasePath = second.BasePath ?? first.BasePath, Timeout = second.Timeout, UserAgent = second.UserAgent ?? first.UserAgent, diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs index 23e1a0c2e19..8faa7f57838 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/IReadableConfiguration.cs @@ -9,6 +9,7 @@ */ +using System; using System.Collections.Generic; namespace Org.OpenAPITools.Client @@ -52,8 +53,15 @@ namespace Org.OpenAPITools.Client /// Gets the default header. /// /// Default header. + [Obsolete("Use DefaultHeaders instead.")] IDictionary DefaultHeader { get; } + /// + /// Gets the default headers. + /// + /// Default headers. + IDictionary DefaultHeaders { get; } + /// /// Gets the temp folder path. /// From 2d7cc778dbcc117ce3f71a42551ee9ab2cb9aa6a Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 9 Aug 2019 00:30:47 +0800 Subject: [PATCH 67/75] Add a new NodeJS Express server generator (#3567) * create nodejs express esrver * 1st commit of the express.js module. Express server working, api-docs loads properly. No real paths yet * 1st commit of the express.js module. Express server working, api-docs loads properly. No real paths yet (#2839) * Working Express server with successful routing to controllers. * rewrote controllers and services. Haven't tested yet * controllers and services have passed tests successfully * Added documentation * Added documentation * Support for openApi v3, using 'express-openapi-validator' for parsing and validation, and an internal router to pass arguments to controllers and services. /controllers/Pet.js and /services/PetService.js should be used for reverse engineering for future codegen script * update generator and template * update samples * more update * update service, controller * add vendor extensions * some updates to adapt to changes in the generator (removing references to swager); some work on handling file uploads; some work on tests * Update NodeJS server generator and templates based on new output (#3261) * update generator and template * update samples * more update * update service, controller * add vendor extensions * update doc * Changed routing code to follow the following convention: Each path operation has a 'x-openapi-router-controller' and 'x-openapi-router-service'. Automated files will be placed under /controllers and /services respectively. Controller file names will end with 'Controller.js'. Removed swaggerRouter, replaced it with openapiRouter Routing works and simple tests show a return of 200 to requests. * [nodejs-express-server] various updates, fixes (#3319) * various fix * remove dot from service * add space * better method empty argument * remove test service (#3379) * add new doc * 1. routingTests.js runs through all operations described in openapi.yaml and tries calling them, expecting 200 in return. Currently not all tests pass - not supporting xml, and problems with formData 2. Removed old testing files. 3. Added model files - contain data and structure as defined in openapi.yaml. Model.js has static methods relevant to all model files. 4. Changed openapi.yaml to allow running tests easily. * 1. routingTests.js runs through all operations described in openapi.yaml and tries calling them, expecting 200 in return. Currently not all tests pass - not supporting xml, and problems with formData (#3442) 2. Removed old testing files. 3. Added model files - contain data and structure as defined in openapi.yaml. Model.js has static methods relevant to all model files. 4. Changed openapi.yaml to allow running tests easily. * added model classes. Currently as a concept only. Seems like won't be in use * Updated README.md to be a detailed description of the project. Removed test files that are not needed. Removed utils/writer.js which is not needed, and the references to it in the codegen files * Removed redundant file app.js - this file has no benefit at this point. index.js now calls ExpressServer.js directly. Updated files that used to call app.js. Updated README.md accordingly Added a path to call the openapi.yaml, and a test file for all endpoints that are not in the openapi.yaml, ensuring that they return 200. Updated README.md accordingly * Remove test controller (#3575) * remove test controller * add back changes to templates * remove app.js * update wording --- README.md | 1 + bin/nodejs-express-petstore-server.sh | 32 + docs/generators.md | 1 + docs/generators/nodejs-express-server.md | 14 + .../languages/NodeJSExpressServerCodegen.java | 390 +++++++++ .../org.openapitools.codegen.CodegenConfig | 1 + .../nodejs-express-server/README.mustache | 72 ++ .../nodejs-express-server/app.mustache | 30 + .../nodejs-express-server/config.mustache | 12 + .../nodejs-express-server/controller.mustache | 18 + .../controllers/Controller.mustache | 72 ++ .../controllers/index.mustache | 25 + .../controllers/test.mustache | 72 ++ .../nodejs-express-server/eslintrc.mustache | 8 + .../expressServer.mustache | 93 ++ .../nodejs-express-server/index.mustache | 28 + .../nodejs-express-server/logger.mustache | 17 + .../nodejs-express-server/openapi.mustache | 1 + .../nodejs-express-server/package.mustache | 46 + .../nodejs-express-server/service.mustache | 45 + .../services/Service.mustache | 11 + .../services/index.mustache | 25 + .../utils/openapiRouter.mustache | 67 ++ .../utils/writer.mustache | 43 + .../petstore/nodejs-express-server/.eslintrc | 8 + .../nodejs-express-server/.eslintrc.json | 8 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/VERSION | 1 + .../petstore/nodejs-express-server/README.md | 71 ++ .../nodejs-express-server/api/openapi.yaml | 802 ++++++++++++++++++ .../nodejs-express-server/api/swagger.yaml | 795 +++++++++++++++++ .../petstore/nodejs-express-server/config.js | 12 + .../controllers/Controller.js | 72 ++ .../controllers/PetController.js | 42 + .../controllers/StoreController.js | 26 + .../controllers/UserController.js | 42 + .../controllers/index.js | 9 + .../nodejs-express-server/expressServer.js | 93 ++ .../petstore/nodejs-express-server/index.js | 28 + .../petstore/nodejs-express-server/logger.js | 17 + .../nodejs-express-server/models/Category.js | 23 + .../nodejs-express-server/models/Model.js | 47 + .../nodejs-express-server/models/Pet.js | 35 + .../nodejs-express-server/models/Tag.js | 24 + .../models/UpdatePetWithFormModel.js | 25 + .../models/UploadFileModel.js | 25 + .../nodejs-express-server/models/index.js | 9 + .../nodejs-express-server/package.json | 46 + .../services/PetService.js | 184 ++++ .../nodejs-express-server/services/Service.js | 11 + .../services/StoreService.js | 94 ++ .../services/UserService.js | 180 ++++ .../nodejs-express-server/services/index.js | 9 + .../tests/additionalEndpointsTests.js | 46 + .../nodejs-express-server/tests/config.js | 12 + .../nodejs-express-server/tests/logger.js | 14 + .../tests/routingTests.js | 147 ++++ .../tests/serverTests.js | 57 ++ .../nodejs-express-server/tests/testModels.js | 29 + .../utils/openapiRouter.js | 67 ++ 60 files changed, 4257 insertions(+) create mode 100755 bin/nodejs-express-petstore-server.sh create mode 100644 docs/generators/nodejs-express-server.md create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSExpressServerCodegen.java create mode 100644 modules/openapi-generator/src/main/resources/nodejs-express-server/README.mustache create mode 100644 modules/openapi-generator/src/main/resources/nodejs-express-server/app.mustache create mode 100644 modules/openapi-generator/src/main/resources/nodejs-express-server/config.mustache create mode 100644 modules/openapi-generator/src/main/resources/nodejs-express-server/controller.mustache create mode 100644 modules/openapi-generator/src/main/resources/nodejs-express-server/controllers/Controller.mustache create mode 100644 modules/openapi-generator/src/main/resources/nodejs-express-server/controllers/index.mustache create mode 100644 modules/openapi-generator/src/main/resources/nodejs-express-server/controllers/test.mustache create mode 100644 modules/openapi-generator/src/main/resources/nodejs-express-server/eslintrc.mustache create mode 100644 modules/openapi-generator/src/main/resources/nodejs-express-server/expressServer.mustache create mode 100644 modules/openapi-generator/src/main/resources/nodejs-express-server/index.mustache create mode 100644 modules/openapi-generator/src/main/resources/nodejs-express-server/logger.mustache create mode 100644 modules/openapi-generator/src/main/resources/nodejs-express-server/openapi.mustache create mode 100644 modules/openapi-generator/src/main/resources/nodejs-express-server/package.mustache create mode 100644 modules/openapi-generator/src/main/resources/nodejs-express-server/service.mustache create mode 100644 modules/openapi-generator/src/main/resources/nodejs-express-server/services/Service.mustache create mode 100644 modules/openapi-generator/src/main/resources/nodejs-express-server/services/index.mustache create mode 100644 modules/openapi-generator/src/main/resources/nodejs-express-server/utils/openapiRouter.mustache create mode 100644 modules/openapi-generator/src/main/resources/nodejs-express-server/utils/writer.mustache create mode 100644 samples/server/petstore/nodejs-express-server/.eslintrc create mode 100644 samples/server/petstore/nodejs-express-server/.eslintrc.json create mode 100644 samples/server/petstore/nodejs-express-server/.openapi-generator-ignore create mode 100644 samples/server/petstore/nodejs-express-server/.openapi-generator/VERSION create mode 100644 samples/server/petstore/nodejs-express-server/README.md create mode 100644 samples/server/petstore/nodejs-express-server/api/openapi.yaml create mode 100644 samples/server/petstore/nodejs-express-server/api/swagger.yaml create mode 100644 samples/server/petstore/nodejs-express-server/config.js create mode 100644 samples/server/petstore/nodejs-express-server/controllers/Controller.js create mode 100644 samples/server/petstore/nodejs-express-server/controllers/PetController.js create mode 100644 samples/server/petstore/nodejs-express-server/controllers/StoreController.js create mode 100644 samples/server/petstore/nodejs-express-server/controllers/UserController.js create mode 100644 samples/server/petstore/nodejs-express-server/controllers/index.js create mode 100644 samples/server/petstore/nodejs-express-server/expressServer.js create mode 100644 samples/server/petstore/nodejs-express-server/index.js create mode 100644 samples/server/petstore/nodejs-express-server/logger.js create mode 100644 samples/server/petstore/nodejs-express-server/models/Category.js create mode 100644 samples/server/petstore/nodejs-express-server/models/Model.js create mode 100644 samples/server/petstore/nodejs-express-server/models/Pet.js create mode 100644 samples/server/petstore/nodejs-express-server/models/Tag.js create mode 100644 samples/server/petstore/nodejs-express-server/models/UpdatePetWithFormModel.js create mode 100644 samples/server/petstore/nodejs-express-server/models/UploadFileModel.js create mode 100644 samples/server/petstore/nodejs-express-server/models/index.js create mode 100644 samples/server/petstore/nodejs-express-server/package.json create mode 100644 samples/server/petstore/nodejs-express-server/services/PetService.js create mode 100644 samples/server/petstore/nodejs-express-server/services/Service.js create mode 100644 samples/server/petstore/nodejs-express-server/services/StoreService.js create mode 100644 samples/server/petstore/nodejs-express-server/services/UserService.js create mode 100644 samples/server/petstore/nodejs-express-server/services/index.js create mode 100644 samples/server/petstore/nodejs-express-server/tests/additionalEndpointsTests.js create mode 100644 samples/server/petstore/nodejs-express-server/tests/config.js create mode 100644 samples/server/petstore/nodejs-express-server/tests/logger.js create mode 100644 samples/server/petstore/nodejs-express-server/tests/routingTests.js create mode 100644 samples/server/petstore/nodejs-express-server/tests/serverTests.js create mode 100644 samples/server/petstore/nodejs-express-server/tests/testModels.js create mode 100644 samples/server/petstore/nodejs-express-server/utils/openapiRouter.js diff --git a/README.md b/README.md index 75aeef76cf7..b40e0653213 100644 --- a/README.md +++ b/README.md @@ -730,6 +730,7 @@ Here is a list of template creators: * JAX-RS RestEasy (JBoss EAP): @jfiala * Kotlin: @jimschubert [:heart:](https://www.patreon.com/jimschubert) * Kotlin (Spring Boot): @dr4ke616 + * NodeJS Express: @YishTish * PHP Laravel: @renepardon * PHP Lumen: @abcsun * PHP Slim: @jfastnacht diff --git a/bin/nodejs-express-petstore-server.sh b/bin/nodejs-express-petstore-server.sh new file mode 100755 index 00000000000..8ebaac9de10 --- /dev/null +++ b/bin/nodejs-express-petstore-server.sh @@ -0,0 +1,32 @@ +#!/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 -B 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/nodejs-express-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g nodejs-express-server -o samples/server/petstore/nodejs-express-server -Dservice $@" + +java $JAVA_OPTS -jar $executable $ags diff --git a/docs/generators.md b/docs/generators.md index 46a9c92365f..77f0a887afb 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -94,6 +94,7 @@ The following generators are available: - [jaxrs-spec](generators/jaxrs-spec.md) - [kotlin-server](generators/kotlin-server.md) - [kotlin-spring](generators/kotlin-spring.md) + - [nodejs-express-server](generators/nodejs-express-server.md) (beta) - [nodejs-server-deprecated](generators/nodejs-server-deprecated.md) (deprecated) - [php-laravel](generators/php-laravel.md) - [php-lumen](generators/php-lumen.md) diff --git a/docs/generators/nodejs-express-server.md b/docs/generators/nodejs-express-server.md new file mode 100644 index 00000000000..25a84db36d6 --- /dev/null +++ b/docs/generators/nodejs-express-server.md @@ -0,0 +1,14 @@ + +--- +id: generator-opts-server-nodejs-express-server +title: Config Options for nodejs-express-server +sidebar_label: nodejs-express-server +--- + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|serverPort|TCP port to listen on.| |null| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSExpressServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSExpressServerCodegen.java new file mode 100644 index 00000000000..14f305f654c --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSExpressServerCodegen.java @@ -0,0 +1,390 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.languages; + +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.Lists; +import com.google.common.collect.Multimap; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.PathItem; +import io.swagger.v3.oas.models.PathItem.HttpMethod; +import io.swagger.v3.oas.models.Paths; +import io.swagger.v3.oas.models.info.Info; +import org.openapitools.codegen.*; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; +import org.openapitools.codegen.utils.URLPathUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.net.URL; +import java.util.*; +import java.util.Map.Entry; +import java.util.regex.Pattern; + +import static org.openapitools.codegen.utils.StringUtils.*; + +public class NodeJSExpressServerCodegen extends DefaultCodegen implements CodegenConfig { + + private static final Logger LOGGER = LoggerFactory.getLogger(NodeJSExpressServerCodegen.class); + public static final String EXPORTED_NAME = "exportedName"; + public static final String SERVER_PORT = "serverPort"; + + protected String apiVersion = "1.0.0"; + protected String defaultServerPort = "8080"; + protected String implFolder = "services"; + protected String projectName = "openapi-server"; + protected String exportedName; + + public NodeJSExpressServerCodegen() { + super(); + + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .stability(Stability.BETA) + .build(); + + outputFolder = "generated-code/nodejs-express-server"; + embeddedTemplateDir = templateDir = "nodejs-express-server"; + + setReservedWordsLowerCase( + Arrays.asList( + "break", "case", "class", "catch", "const", "continue", "debugger", + "default", "delete", "do", "else", "export", "extends", "finally", + "for", "function", "if", "import", "in", "instanceof", "let", "new", + "return", "super", "switch", "this", "throw", "try", "typeof", "var", + "void", "while", "with", "yield") + ); + + additionalProperties.put("apiVersion", apiVersion); + additionalProperties.put("implFolder", implFolder); + + // no model file + modelTemplateFiles.clear(); + + apiTemplateFiles.put("controller.mustache", ".js"); + apiTemplateFiles.put("service.mustache", ".js"); + + supportingFiles.add(new SupportingFile("openapi.mustache", "api", "openapi.yaml")); + supportingFiles.add(new SupportingFile("config.mustache", "", "config.js")); + supportingFiles.add(new SupportingFile("expressServer.mustache", "", "expressServer.js")); + supportingFiles.add(new SupportingFile("index.mustache", "", "index.js")); + supportingFiles.add(new SupportingFile("logger.mustache", "", "logger.js")); + supportingFiles.add(new SupportingFile("eslintrc.mustache", "", ".eslintrc.json")); + + // utils folder + supportingFiles.add(new SupportingFile("utils" + File.separator + "openapiRouter.mustache", "utils", "openapiRouter.js")); + + // controllers folder + supportingFiles.add(new SupportingFile("controllers" + File.separator + "index.mustache", "controllers", "index.js")); + supportingFiles.add(new SupportingFile("controllers" + File.separator + "Controller.mustache", "controllers", "Controller.js")); + // service folder + supportingFiles.add(new SupportingFile("services" + File.separator + "index.mustache", "services", "index.js")); + supportingFiles.add(new SupportingFile("services" + File.separator + "Service.mustache", "services", "Service.js")); + + // do not overwrite if the file is already present + writeOptional(outputFolder, new SupportingFile("package.mustache", "", "package.json")); + writeOptional(outputFolder, new SupportingFile("README.mustache", "", "README.md")); + + cliOptions.add(new CliOption(SERVER_PORT, + "TCP port to listen on.")); + } + + @Override + public String apiPackage() { + return "controllers"; + } + + /** + * Configures the type of generator. + * + * @return the CodegenType for this generator + * @see org.openapitools.codegen.CodegenType + */ + @Override + public CodegenType getTag() { + return CodegenType.SERVER; + } + + /** + * Configures a friendly name for the generator. This will be used by the generator + * to select the library with the -g flag. + * + * @return the friendly name for the generator + */ + @Override + public String getName() { + return "nodejs-express-server"; + } + + /** + * Returns human-friendly help for the generator. Provide the consumer with help + * tips, parameters here + * + * @return A string value for the help message + */ + @Override + public String getHelp() { + return "Generates a NodeJS Express server (alpha). IMPORTANT: this generator may subject to breaking changes without further notice)."; + } + + @Override + public String toApiName(String name) { + if (name.length() == 0) { + return "Default"; + } + return camelize(name); + } + + @Override + public String toApiFilename(String name) { + return toApiName(name) + "Controller"; + } + + @Override + public String apiFilename(String templateName, String tag) { + String result = super.apiFilename(templateName, tag); + + if (templateName.equals("service.mustache")) { + String stringToMatch = File.separator + "controllers" + File.separator; + String replacement = File.separator + implFolder + File.separator; + result = result.replaceAll(Pattern.quote(stringToMatch), replacement); + + stringToMatch = "Controller.js"; + replacement = "Service.js"; + result = result.replaceAll(Pattern.quote(stringToMatch), replacement); + } + return result; + } + +/* + @Override + protected String implFileFolder(String output) { + return outputFolder + File.separator + output + File.separator + apiPackage().replace('.', File.separatorChar); + } +*/ + + /** + * Escapes a reserved word as defined in the `reservedWords` array. Handle escaping + * those terms here. This logic is only called if a variable matches the reserved words + * + * @return the escaped term + */ + @Override + public String escapeReservedWord(String name) { + if (this.reservedWordsMappings().containsKey(name)) { + return this.reservedWordsMappings().get(name); + } + return "_" + name; + } + + /** + * Location to write api files. You can use the apiPackage() as defined when the class is + * instantiated + */ + @Override + public String apiFileFolder() { + return outputFolder + File.separator + apiPackage().replace('.', File.separatorChar); + } + + public String getExportedName() { + return exportedName; + } + + public void setExportedName(String name) { + exportedName = name; + } + + @Override + public Map postProcessOperationsWithModels(Map objs, List allModels) { + @SuppressWarnings("unchecked") + Map objectMap = (Map) objs.get("operations"); + @SuppressWarnings("unchecked") + List operations = (List) objectMap.get("operation"); + for (CodegenOperation operation : operations) { + operation.httpMethod = operation.httpMethod.toLowerCase(Locale.ROOT); + + List params = operation.allParams; + if (params != null && params.size() == 0) { + operation.allParams = null; + } + List responses = operation.responses; + if (responses != null) { + for (CodegenResponse resp : responses) { + if ("0".equals(resp.code)) { + resp.code = "default"; + } + } + } + if (operation.examples != null && !operation.examples.isEmpty()) { + // Leave application/json* items only + for (Iterator> it = operation.examples.iterator(); it.hasNext(); ) { + final Map example = it.next(); + final String contentType = example.get("contentType"); + if (contentType == null || !contentType.startsWith("application/json")) { + it.remove(); + } + } + } + } + return objs; + } + + @SuppressWarnings("unchecked") + private static List> getOperations(Map objs) { + List> result = new ArrayList>(); + Map apiInfo = (Map) objs.get("apiInfo"); + List> apis = (List>) apiInfo.get("apis"); + for (Map api : apis) { + result.add((Map) api.get("operations")); + } + return result; + } + + private static List> sortOperationsByPath(List ops) { + Multimap opsByPath = ArrayListMultimap.create(); + + for (CodegenOperation op : ops) { + opsByPath.put(op.path, op); + } + + List> opsByPathList = new ArrayList>(); + for (Entry> entry : opsByPath.asMap().entrySet()) { + Map opsByPathEntry = new HashMap(); + opsByPathList.add(opsByPathEntry); + opsByPathEntry.put("path", entry.getKey()); + opsByPathEntry.put("operation", entry.getValue()); + List operationsForThisPath = Lists.newArrayList(entry.getValue()); + operationsForThisPath.get(operationsForThisPath.size() - 1).hasMore = false; + if (opsByPathList.size() < opsByPath.asMap().size()) { + opsByPathEntry.put("hasMore", "true"); + } + } + + return opsByPathList; + } + + @Override + public void processOpts() { + super.processOpts(); + + if (additionalProperties.containsKey(EXPORTED_NAME)) { + setExportedName((String) additionalProperties.get(EXPORTED_NAME)); + } + + /* + * Supporting Files. You can write single files for the generator with the + * entire object tree available. If the input file has a suffix of `.mustache + * it will be processed by the template engine. Otherwise, it will be copied + */ + // supportingFiles.add(new SupportingFile("controller.mustache", + // "controllers", + // "controller.js") + // ); + } + + @Override + public void preprocessOpenAPI(OpenAPI openAPI) { + URL url = URLPathUtils.getServerURL(openAPI); + String host = URLPathUtils.getProtocolAndHost(url); + String port = URLPathUtils.getPort(url, defaultServerPort) ; + String basePath = url.getPath(); + + if (additionalProperties.containsKey(SERVER_PORT)) { + port = additionalProperties.get(SERVER_PORT).toString(); + } + this.additionalProperties.put(SERVER_PORT, port); + + if (openAPI.getInfo() != null) { + Info info = openAPI.getInfo(); + if (info.getTitle() != null) { + // when info.title is defined, use it for projectName + // used in package.json + projectName = info.getTitle() + .replaceAll("[^a-zA-Z0-9]", "-") + .replaceAll("^[-]*", "") + .replaceAll("[-]*$", "") + .replaceAll("[-]{2,}", "-") + .toLowerCase(Locale.ROOT); + this.additionalProperties.put("projectName", projectName); + } + } + + // need vendor extensions + Paths paths = openAPI.getPaths(); + if (paths != null) { + for (String pathname : paths.keySet()) { + PathItem path = paths.get(pathname); + Map operationMap = path.readOperationsMap(); + if (operationMap != null) { + for (HttpMethod method : operationMap.keySet()) { + Operation operation = operationMap.get(method); + String tag = "default"; + if (operation.getTags() != null && operation.getTags().size() > 0) { + tag = toApiName(operation.getTags().get(0)); + } + if (operation.getOperationId() == null) { + operation.setOperationId(getOrGenerateOperationId(operation, pathname, method.toString())); + } + // add x-openapi-router-controller + if (operation.getExtensions() == null || + operation.getExtensions().get("x-openapi-router-controller") == null) { + operation.addExtension("x-openapi-router-controller", sanitizeTag(tag) + "Controller"); + } + // add x-openapi-router-service + if (operation.getExtensions() == null || + operation.getExtensions().get("x-openapi-router-service") == null) { + operation.addExtension("x-openapi-router-service", sanitizeTag(tag) + "Service"); + } + } + } + } + } + + } + + @Override + public Map postProcessSupportingFileData(Map objs) { + generateYAMLSpecFile(objs); + + for (Map operations : getOperations(objs)) { + @SuppressWarnings("unchecked") + List ops = (List) operations.get("operation"); + + List> opsByPathList = sortOperationsByPath(ops); + operations.put("operationsByPath", opsByPathList); + } + return super.postProcessSupportingFileData(objs); + } + + @Override + public String removeNonNameElementToCamelCase(String name) { + return removeNonNameElementToCamelCase(name, "[-:;#]"); + } + + @Override + public String escapeUnsafeCharacters(String input) { + return input.replace("*/", "*_/").replace("/*", "/_*"); + } + + @Override + public String escapeQuotationMark(String input) { + // remove " to avoid code injection + return input.replace("\"", ""); + } +} diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig index a27cc518fdc..9a8fba9fc43 100644 --- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig +++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig @@ -61,6 +61,7 @@ org.openapitools.codegen.languages.JMeterClientCodegen org.openapitools.codegen.languages.LuaClientCodegen org.openapitools.codegen.languages.MysqlSchemaCodegen org.openapitools.codegen.languages.NodeJSServerCodegen +org.openapitools.codegen.languages.NodeJSExpressServerCodegen org.openapitools.codegen.languages.ObjcClientCodegen org.openapitools.codegen.languages.OCamlClientCodegen org.openapitools.codegen.languages.OpenAPIGenerator diff --git a/modules/openapi-generator/src/main/resources/nodejs-express-server/README.mustache b/modules/openapi-generator/src/main/resources/nodejs-express-server/README.mustache new file mode 100644 index 00000000000..2bc0198b4a2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/nodejs-express-server/README.mustache @@ -0,0 +1,72 @@ +{{=<% %>=}} +# OpenAPI Generated JavaScript/Express Server + +## Overview +This server was generated using the [OpenAPI Generator](https://openapi-generator.tech) project. The code generator, and it's generated code allows you to develop your system with an API-First attitude, where the API contract is the anchor and definer of your project, and your code and business-logic aims to complete and comply to the terms in the API contract. + +### prerequisites +- NodeJS >= 10.4 +- NPM >= 6.10.0 + +The code was written on a mac, so assuming all should work smoothly on Linux-based computers. However, there is no reason not to run this library on Windows-based machines. If you find an OS-related problem, please open an issue and it will be resolved. + +### Running the server +To run the server, run: + +``` +npm start +``` +### View and test the API +You can see the API documentation, and check the available endpoints by going to http://localhost:3000/api-docs/. Endpoints that require security need to have security handlers configured before they can return a successful response. At this point they will return [ a response code of 401](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401). +##### At this stage the server does not support document body sent in xml format. Forms will be supported in the near future. + +### Node version and guidelines +The code was written using Node version 10.6, and complies to the [Airbnb .eslint guiding rules](https://github.com/airbnb/javascript). + +### Project Files +#### Root Directory: +In the root directory we have (besides package.json, config.js, and log files): +- **logger.js** - where we define the logger for the project. The project uses winston, but the purpose of this file is to enable users to change and modify their own logger behavior. +- **index.js** - This is the project's 'main' file, and from here we launch the application. This is a very short and concise file, and the idea behind launching from this short file is to allow use-cases of launching the server with different parameters (changing config and/or logger) without affecting the rest of the code. +- **expressServer.js** - The core of the Express.js server. This is where the express server is initialized, together with the OpenAPI validator, OpenAPI UI, and other libraries needed to start our server. If we want to add external links, that's where they would go. Our project uses the [express-openapi-validator](https://www.npmjs.com/package/express-openapi-validator) library that acts as a first step in the routing process - requests that are directed to paths defined in the `openapi.yaml` file are caught by this process, and it's parameters and bodyContent are validated against the schema. A successful result of this validation will be a new 'openapi' object added to the request. If the path requested is not part of the openapi.yaml file, the validator ignores the request and passes it on, as is, down the flow of the Express server. + +#### api/ +- **openapi.yaml** - This is the OpenAPI contract to which this server will comply. The file was generated using the codegen, and should contain everything needed to run the API Gateway - no references to external models/schemas. + +#### utils/ +Currently a single file: + +- **openapiRouter.js** - This is where the routing to our back-end code happens. If the request object includes an ```openapi``` object, it picks up the following values (that are part of the ```openapi.yaml``` file): 'x-openapi-router-controller', and 'x-openapi-router-service'. These variables are names of files/classes in the controllers and services directories respectively. The operationId of the request is also extracted. The operationId is a method in the controller and the service that was generated as part of the codegen process. The routing process sends the request and response objects to the controller, which will extract the expected variables from the request, and send it to be processed by the service, returning the response from the service to the caller. + +#### controllers/ +After validating the request, and ensuring this belongs to our API gateway, we send the request to a `controller`, where the variables and parameters are extracted from the request and sent to the relevant `service` for processing. The `controller` handles the response from the `service` and builds the appropriate HTTP response to be sent back to the user. + +- **index.js** - load all the controllers that were generated for this project, and export them to be used dynamically by the `openapiRouter.js`. If you would like to customize your controller, it is advised that you link to your controller here, and ensure that the codegen does not rewrite this file. + +- **Controller.js** - The core processor of the generated controllers. The generated controllers are designed to be as slim and generic as possible, referencing to the `Controller.js` for the business logic of parsing the needed variables and arguments from the request, and for building the HTTP response which will be sent back. The `Controller.js` is a class with static methods. + +- **{{x-openapi-router-controller}}.js** - auto-generated code, processing all the operations. The Controller is a class that is constructed with the service class it will be sending the request to. Every request defined by the `openapi.yaml` has an operationId. The operationId is the name of the method that will be called. Every method receives the request and response, and calls the `Controller.js` to process the request and response, adding the service method that should be called for the actual business-logic processing. + +#### services/ +This is where the API Gateway ends, and the unique business-logic of your application kicks in. Every endpoint in the `openapi.yaml` has a variable 'x-openapi-router-service', which is the name of the service class that is generated. The operationID of the endpoint is the name of the method that will be called. The generated code provides a simple promise with a try/catch clause. A successful operation ends with a call to the generic `Service.js` to build a successful response (payload and response code), and a failure will call the generic `Service.js` to build a response with an error object and the relevant response code. It is recommended to have the services be generated automatically once, and after the initial build add methods manually. + +- **index.js** - load all the services that were generated for this project, and export them to be used dynamically by the `openapiRouter.js`. If you would like to customize your service, it is advised that you link to your controller here, and ensure that the codegen does not rewrite this file. + +- **Service.js** - A utility class, very simple and thin at this point, with two static methods for building a response object for successful and failed results in the service operation. The default response code is 200 for success and 500 for failure. It is recommended to send more accurate response codes and override these defaults when relevant. + +- **{{x-openapi-router-service}}.js** - auto-generated code, providing a stub Promise for each operationId defined in the `openapi.yaml`. Each method receives the variables that were defined in the `openapi.yaml` file, and wraps a Promise in a try/catch clause. The Promise resolves both success and failure in a call to the `Service.js` utility class for building the appropriate response that will be sent back to the Controller and then to the caller of this endpoint. + +#### tests/ +- **serverTests.js** - basic server validation tests, checking that the server is up, that a call to an endpoint within the scope of the `openapi.yaml` file returns 200, that a call to a path outside that scope returns 200 if it exists and a 404 if not. +- **routingTests.js** - Runs through all the endpoints defined in the `openapi.yaml`, and constructs a dummy request to send to the server. Confirms that the response code is 200. At this point requests containing xml or formData fail - currently they are not supported in the router. +- **additionalEndpointsTests.js** - A test file for all the endpoints that are defined outside the openapi.yaml scope. Confirms that these endpoints return a successful 200 response. + + +Future tests should be written to ensure that the response of every request sent should conform to the structure defined in the `openapi.yaml`. This test will fail 100% initially, and the job of the development team will be to clear these tests. + + +#### models/ +Currently a concept awaiting feedback. The idea is to have the objects defined in the openapi.yaml act as models which are passed between the different modules. This will conform the programmers to interact using defined objects, rather than loosley-defined JSON objects. Given the nature of JavaScript progrmmers, who want to work with their own bootstrapped parameters, this concept might not work. Keeping this here for future discussion and feedback. + + + diff --git a/modules/openapi-generator/src/main/resources/nodejs-express-server/app.mustache b/modules/openapi-generator/src/main/resources/nodejs-express-server/app.mustache new file mode 100644 index 00000000000..34d7c9c1636 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/nodejs-express-server/app.mustache @@ -0,0 +1,30 @@ +const ExpressServer = require('./expressServer'); +const logger = require('./logger'); +// const swaggerRouter = require('./utils/swaggerRouter'); + +class App { + constructor(config) { + this.config = config; + } + + async launch() { + try { + this.expressServer = new ExpressServer(this.config.URL_PORT, this.config.OPENAPI_YAML); + // this.expressServer.app.use(swaggerRouter()); + await this.expressServer.launch(); + logger.info('Express server running'); + } catch (error) { + logger.error(error); + await this.close(); + } + } + + async close() { + if (this.expressServer !== undefined) { + await this.expressServer.close(); + logger.info(`Server shut down on port ${this.config.URL_PORT}`); + } + } +} + +module.exports = App; diff --git a/modules/openapi-generator/src/main/resources/nodejs-express-server/config.mustache b/modules/openapi-generator/src/main/resources/nodejs-express-server/config.mustache new file mode 100644 index 00000000000..80f568992bd --- /dev/null +++ b/modules/openapi-generator/src/main/resources/nodejs-express-server/config.mustache @@ -0,0 +1,12 @@ +const path = require('path'); + +const config = { + ROOT_DIR: __dirname, + URL_PORT: 3000, + URL_PATH: 'http://localhost', + BASE_VERSION: 'v2', + CONTROLLER_DIRECTORY: path.join(__dirname, 'controllers'), +}; +config.OPENAPI_YAML = path.join(config.ROOT_DIR, 'api', 'openapi.yaml'); +config.FULL_PATH = `${config.URL_PATH}:${config.URL_PORT}/${config.BASE_VERSION}`; +module.exports = config; diff --git a/modules/openapi-generator/src/main/resources/nodejs-express-server/controller.mustache b/modules/openapi-generator/src/main/resources/nodejs-express-server/controller.mustache new file mode 100644 index 00000000000..61d7290a3ed --- /dev/null +++ b/modules/openapi-generator/src/main/resources/nodejs-express-server/controller.mustache @@ -0,0 +1,18 @@ +const Controller = require('./Controller'); + +class {{{classname}}}Controller { + constructor(Service) { + this.service = Service; + } + +{{#operations}} +{{#operation}} + async {{operationId}}(request, response) { + await Controller.handleRequest(request, response, this.service.{{operationId}}); + } + +{{/operation}} +} + +module.exports = {{classname}}Controller; +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/nodejs-express-server/controllers/Controller.mustache b/modules/openapi-generator/src/main/resources/nodejs-express-server/controllers/Controller.mustache new file mode 100644 index 00000000000..bdf8776c0e4 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/nodejs-express-server/controllers/Controller.mustache @@ -0,0 +1,72 @@ +const logger = require('../logger'); + +class Controller { + static sendResponse(response, payload) { + /** + * The default response-code is 200. We want to allow to change that. in That case, + * payload will be an object consisting of a code and a payload. If not customized + * send 200 and the payload as received in this method. + */ + response.status(payload.code || 200); + const responsePayload = payload.payload !== undefined ? payload.payload : payload; + if (responsePayload instanceof Object) { + response.json(responsePayload); + } else { + response.end(responsePayload); + } + } + + static sendError(response, error) { + response.status(error.code || 500); + if (error.error instanceof Object) { + response.json(error.error); + } else { + response.end(error.error || error.message); + } + } + + static collectFiles(request) { + logger.info('Checking if files are expected in schema'); + if (request.openapi.schema.requestBody !== undefined) { + const [contentType] = request.headers['content-type'].split(';'); + if (contentType === 'multipart/form-data') { + const contentSchema = request.openapi.schema.requestBody.content[contentType].schema; + Object.entries(contentSchema.properties).forEach(([name, property]) => { + if (property.type === 'string' && ['binary', 'base64'].indexOf(property.format) > -1) { + request.body[name] = request.files.find(file => file.fieldname === name); + } + }); + } else if (request.openapi.schema.requestBody.content[contentType] !== undefined + && request.files !== undefined) { + [request.body] = request.files; + } + } + } + + static collectRequestParams(request) { + this.collectFiles(request); + const requestParams = {}; + if (request.openapi.schema.requestBody !== undefined) { + requestParams.body = request.body; + } + request.openapi.schema.parameters.forEach((param) => { + if (param.in === 'path') { + requestParams[param.name] = request.openapi.pathParams[param.name]; + } else if (param.in === 'query') { + requestParams[param.name] = request.query[param.name]; + } + }); + return requestParams; + } + + static async handleRequest(request, response, serviceOperation) { + try { + const serviceResponse = await serviceOperation(this.collectRequestParams(request)); + Controller.sendResponse(response, serviceResponse); + } catch (error) { + Controller.sendError(response, error); + } + } +} + +module.exports = Controller; diff --git a/modules/openapi-generator/src/main/resources/nodejs-express-server/controllers/index.mustache b/modules/openapi-generator/src/main/resources/nodejs-express-server/controllers/index.mustache new file mode 100644 index 00000000000..439b7d8f025 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/nodejs-express-server/controllers/index.mustache @@ -0,0 +1,25 @@ +{{#apiInfo}} +{{#apis}} +{{#operations}} +{{#operation}} +{{#-first}} +const {{classname}}Controller = require('./{{classname}}Controller'); +{{/-first}} +{{/operation}} +{{/operations}} +{{/apis}} +{{/apiInfo}} + +module.exports = { +{{#apiInfo}} +{{#apis}} +{{#operations}} +{{#operation}} + {{#-first}} + {{classname}}Controller, + {{/-first}} +{{/operation}} +{{/operations}} +{{/apis}} +{{/apiInfo}} +}; diff --git a/modules/openapi-generator/src/main/resources/nodejs-express-server/controllers/test.mustache b/modules/openapi-generator/src/main/resources/nodejs-express-server/controllers/test.mustache new file mode 100644 index 00000000000..516c135b45b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/nodejs-express-server/controllers/test.mustache @@ -0,0 +1,72 @@ +const Service = require('../services/Service'); + +const testItems = require('../tests/testFiles/testItems.json'); + +class TestService { + static testGetController() { + return new Promise( + async (resolve, reject) => { + try { + resolve(Service.successResponse( + testItems, + 200, + )); + } catch (e) { + const message = e.getMessage() || 'Could not get items. Server error'; + reject(Service.rejectResponse(message, 500)); + } + }, + ); + + sendResponse(request, response) { + response.status(200); + const objectToReturn = {}; + Object.keys(request.swagger.paramValues).forEach((key) => { + const val = request.swagger.paramValues[key]; + if (val instanceof Object) { + objectToReturn[key] = val.originalname || val.name || val; + } else { + objectToReturn[key] = request.swagger.paramValues[key]; + } + }); + response.json(objectToReturn); + } + + confirmRouteGetSingle(request, response) { + this.sendResponse(request, response); + } + + confirmRouteGetMany(request, response) { + this.sendResponse(request, response); + } + + confirmRoutePost(request, response) { + this.sendResponse(request, response); + } + + confirmRoutePut(request, response) { + this.sendResponse(request, response); + } + + async testGetController(request, response) { + await Controller.handleRequest(request, response, this.service.testGetController); + } + + async testPostController(request, response) { + await Controller.handleRequest(request, response, this.service.testPostController); + } + + async testPutController(request, response) { + await Controller.handleRequest(request, response, this.service.testPutController); + } + + async testDeleteController(request, response) { + await Controller.handleRequest(request, response, this.service.testDeleteController); + } + + async testFindByIdController(request, response) { + await Controller.handleRequest(request, response, this.service.testFindByIdController); + } +} + +module.exports = TestController; diff --git a/modules/openapi-generator/src/main/resources/nodejs-express-server/eslintrc.mustache b/modules/openapi-generator/src/main/resources/nodejs-express-server/eslintrc.mustache new file mode 100644 index 00000000000..6d8abec4c52 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/nodejs-express-server/eslintrc.mustache @@ -0,0 +1,8 @@ +// Use this file as a starting point for your project's .eslintrc. +// Copy this file, and add rule overrides as needed. +{ + "extends": "airbnb", + "rules": { + "no-console": "off" + } +} diff --git a/modules/openapi-generator/src/main/resources/nodejs-express-server/expressServer.mustache b/modules/openapi-generator/src/main/resources/nodejs-express-server/expressServer.mustache new file mode 100644 index 00000000000..64998cf2563 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/nodejs-express-server/expressServer.mustache @@ -0,0 +1,93 @@ +// const { Middleware } = require('swagger-express-middleware'); +const path = require('path'); +const swaggerUI = require('swagger-ui-express'); +const yamljs = require('yamljs'); +const express = require('express'); +const cors = require('cors'); +const cookieParser = require('cookie-parser'); +const bodyParser = require('body-parser'); +const { OpenApiValidator } = require('express-openapi-validator'); +const openapiRouter = require('./utils/openapiRouter'); +const logger = require('./logger'); + +class ExpressServer { + constructor(port, openApiYaml) { + this.port = port; + this.app = express(); + this.openApiPath = openApiYaml; + this.schema = yamljs.load(openApiYaml); + this.setupMiddleware(); + } + + setupMiddleware() { + // this.setupAllowedMedia(); + this.app.use(cors()); + this.app.use(bodyParser.json()); + this.app.use(express.json()); + this.app.use(express.urlencoded({ extended: false })); + this.app.use(cookieParser()); + this.app.use('/spec', express.static(path.join(__dirname, 'api'))); + this.app.get('/hello', (req, res) => res.send('Hello World. path: '+this.openApiPath)); + // this.app.get('/spec', express.static(this.openApiPath)); + this.app.use('/api-docs', swaggerUI.serve, swaggerUI.setup(this.schema)); + this.app.get('/login-redirect', (req, res) => { + res.status(200); + res.json(req.query); + }); + this.app.get('/oauth2-redirect.html', (req, res) => { + res.status(200); + res.json(req.query); + }); + new OpenApiValidator({ + apiSpecPath: this.openApiPath, + }).install(this.app); + this.app.use(openapiRouter()); + this.app.get('/', (req, res) => { + res.status(200); + res.end('Hello World'); + }); + } + + addErrorHandler() { + this.app.use('*', (req, res) => { + res.status(404); + res.send(JSON.stringify({ error: `path ${req.baseUrl} doesn't exist` })); + }); + /** + * suppressed eslint rule: The next variable is required here, even though it's not used. + * + ** */ + // eslint-disable-next-line no-unused-vars + this.app.use((error, req, res, next) => { + const errorResponse = error.error || error.errors || error.message || 'Unknown error'; + res.status(error.status || 500); + res.type('json'); + res.json({ error: errorResponse }); + }); + } + + async launch() { + return new Promise( + async (resolve, reject) => { + try { + this.addErrorHandler(); + this.server = await this.app.listen(this.port, () => { + console.log(`server running on port ${this.port}`); + resolve(this.server); + }); + } catch (error) { + reject(error); + } + }, + ); + } + + async close() { + if (this.server !== undefined) { + await this.server.close(); + console.log(`Server on port ${this.port} shut down`); + } + } +} + +module.exports = ExpressServer; diff --git a/modules/openapi-generator/src/main/resources/nodejs-express-server/index.mustache b/modules/openapi-generator/src/main/resources/nodejs-express-server/index.mustache new file mode 100644 index 00000000000..cc9dbc7e54b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/nodejs-express-server/index.mustache @@ -0,0 +1,28 @@ +const config = require('./config'); +const logger = require('./logger'); +const ExpressServer = require('./expressServer'); +// const App = require('./app'); + +// const app = new App(config); +// app.launch() +// .then(() => { +// logger.info('Server launched'); +// }) +// .catch((error) => { +// logger.error('found error, shutting down server'); +// app.close() +// .catch(closeError => logger.error(closeError)) +// .finally(() => logger.error(error)); +// }); +const launchServer = async () => { + try { + this.expressServer = new ExpressServer(config.URL_PORT, config.OPENAPI_YAML); + await this.expressServer.launch(); + logger.info('Express server running'); + } catch (error) { + logger.error(error); + await this.close(); + } +}; + +launchServer().catch(e => logger.error(e)); diff --git a/modules/openapi-generator/src/main/resources/nodejs-express-server/logger.mustache b/modules/openapi-generator/src/main/resources/nodejs-express-server/logger.mustache new file mode 100644 index 00000000000..27134586f8e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/nodejs-express-server/logger.mustache @@ -0,0 +1,17 @@ +const winston = require('winston'); + +const logger = winston.createLogger({ + level: 'info', + format: winston.format.json(), + defaultMeta: { service: 'user-service' }, + transports: [ + new winston.transports.File({ filename: 'error.log', level: 'error' }), + new winston.transports.File({ filename: 'combined.log' }), + ], +}); + +if (process.env.NODE_ENV !== 'production') { + logger.add(new winston.transports.Console({ format: winston.format.simple() })); +} + +module.exports = logger; diff --git a/modules/openapi-generator/src/main/resources/nodejs-express-server/openapi.mustache b/modules/openapi-generator/src/main/resources/nodejs-express-server/openapi.mustache new file mode 100644 index 00000000000..51ebafb0187 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/nodejs-express-server/openapi.mustache @@ -0,0 +1 @@ +{{{openapi-yaml}}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/nodejs-express-server/package.mustache b/modules/openapi-generator/src/main/resources/nodejs-express-server/package.mustache new file mode 100644 index 00000000000..e4bdc09d99b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/nodejs-express-server/package.mustache @@ -0,0 +1,46 @@ +{ + "name": "openapi-petstore", + "version": "1.0.0", + "description": "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.", + "main": "index.js", + "scripts": { + "prestart": "npm install", + "start": "node index.js" + }, + "keywords": [ + "openapi-generator", + "openapi" + ], + "license": "Unlicense", + "private": true, + "dependencies": { + "body-parser": "^1.19.0", + "connect": "^3.2.0", + "cookie-parser": "^1.4.4", + "cors": "^2.8.5", + "express": "^4.16.4", + "express-openapi-validator": "^1.0.0", + "js-yaml": "^3.3.0", + "jstoxml": "^1.5.0", + "ono": "^5.0.1", + "openapi-sampler": "^1.0.0-beta.15", + "swagger-express-middleware": "^2.0.2", + "swagger-tools": "^0.10.4", + "swagger-ui-express": "^4.0.2", + "winston": "^3.2.1", + "yamljs": "^0.3.0", + "mocha": "^6.1.4", + "axios": "^0.19.0", + "chai": "^4.2.0", + "chai-as-promised": "^7.1.1", + "eslint": "^5.16.0", + "eslint-config-airbnb-base": "^13.1.0", + "eslint-plugin-import": "^2.17.2", + "form-data": "^2.3.3" + }, + "eslintConfig": { + "env": { + "node": true + } + } +} diff --git a/modules/openapi-generator/src/main/resources/nodejs-express-server/service.mustache b/modules/openapi-generator/src/main/resources/nodejs-express-server/service.mustache new file mode 100644 index 00000000000..b5f39b4577f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/nodejs-express-server/service.mustache @@ -0,0 +1,45 @@ +/* eslint-disable no-unused-vars */ +const Service = require('./Service'); + +class {{{classname}}}Service { + +{{#operations}} +{{#operation}} + /** + {{#summary}} + * {{{summary}}} + {{/summary}} + {{#notes}} + * {{{notes}}} + {{/notes}} + * + {{#allParams}} + * {{paramName}} {{{dataType}}} {{{description}}}{{^required}} (optional){{/required}} + {{/allParams}} + {{^returnType}} + * no response value expected for this operation + {{/returnType}} + {{#returnType}} + * returns {{{returnType}}} + {{/returnType}} + **/ + static {{{operationId}}}({{#allParams}}{{#-first}}{ {{/-first}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{#-last}} }{{/-last}}{{/allParams}}) { + return new Promise( + async (resolve) => { + try { + resolve(Service.successResponse('')); + } catch (e) { + resolve(Service.rejectResponse( + e.message || 'Invalid input', + e.status || 405, + )); + } + }, + ); + } + +{{/operation}} +} + +module.exports = {{{classname}}}Service; +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/nodejs-express-server/services/Service.mustache b/modules/openapi-generator/src/main/resources/nodejs-express-server/services/Service.mustache new file mode 100644 index 00000000000..11f8c9a1c3a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/nodejs-express-server/services/Service.mustache @@ -0,0 +1,11 @@ +class Service { + static rejectResponse(error, code = 500) { + return { error, code }; + } + + static successResponse(payload, code = 200) { + return { payload, code }; + } +} + +module.exports = Service; diff --git a/modules/openapi-generator/src/main/resources/nodejs-express-server/services/index.mustache b/modules/openapi-generator/src/main/resources/nodejs-express-server/services/index.mustache new file mode 100644 index 00000000000..19478453fa8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/nodejs-express-server/services/index.mustache @@ -0,0 +1,25 @@ +{{#apiInfo}} +{{#apis}} +{{#operations}} +{{#operation}} +{{#-first}} +const {{classname}}Service = require('./{{classname}}Service'); +{{/-first}} +{{/operation}} +{{/operations}} +{{/apis}} +{{/apiInfo}} + +module.exports = { +{{#apiInfo}} +{{#apis}} +{{#operations}} +{{#operation}} +{{#-first}} + {{classname}}Service, +{{/-first}} +{{/operation}} +{{/operations}} +{{/apis}} +{{/apiInfo}} +}; diff --git a/modules/openapi-generator/src/main/resources/nodejs-express-server/utils/openapiRouter.mustache b/modules/openapi-generator/src/main/resources/nodejs-express-server/utils/openapiRouter.mustache new file mode 100644 index 00000000000..1a77fec7b61 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/nodejs-express-server/utils/openapiRouter.mustache @@ -0,0 +1,67 @@ +const logger = require('../logger'); +const controllers = require('../controllers'); +const Services = require('../services'); + +function handleError(err, request, response, next) { + logger.error(err); + const code = err.code || 400; + response.status(code); + response.error = err; + next(JSON.stringify({ + code, + error: err, + })); +} + +/** + * The purpose of this route is to collect the request variables as defined in the + * OpenAPI document and pass them to the handling controller as another Express + * middleware. All parameters are collected in the requet.swagger.values key-value object + * + * The assumption is that security handlers have already verified and allowed access + * to this path. If the business-logic of a particular path is dependant on authentication + * parameters (e.g. scope checking) - it is recommended to define the authentication header + * as one of the parameters expected in the OpenAPI/Swagger document. + * + * Requests made to paths that are not in the OpernAPI scope + * are passed on to the next middleware handler. + * @returns {Function} + */ +function openApiRouter() { + return async (request, response, next) => { + try { + /** + * This middleware runs after a previous process have applied an openapi object + * to the request. + * If none was applied This is because the path requested is not in the schema. + * If there's no openapi object, we have nothing to do, and pass on to next middleware. + */ + if (request.openapi === undefined + || request.openapi.schema === undefined + ) { + next(); + return; + } + // request.swagger.paramValues = {}; + // request.swagger.params.forEach((param) => { + // request.swagger.paramValues[param.name] = getValueFromRequest(request, param); + // }); + const controllerName = request.openapi.schema['x-openapi-router-controller']; + const serviceName = request.openapi.schema['x-openapi-router-service']; + if (!controllers[controllerName] || controllers[controllerName] === undefined) { + handleError(`request sent to controller '${controllerName}' which has not been defined`, + request, response, next); + } else { + const apiController = new controllers[controllerName](Services[serviceName]); + const controllerOperation = request.openapi.schema.operationId; + await apiController[controllerOperation](request, response, next); + } + } catch (error) { + console.error(error); + const err = { code: 500, error: error.message }; + handleError(err, request, response, next); + } + }; +} + +module.exports = openApiRouter; diff --git a/modules/openapi-generator/src/main/resources/nodejs-express-server/utils/writer.mustache b/modules/openapi-generator/src/main/resources/nodejs-express-server/utils/writer.mustache new file mode 100644 index 00000000000..d79f6e1a526 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/nodejs-express-server/utils/writer.mustache @@ -0,0 +1,43 @@ +var ResponsePayload = function(code, payload) { + this.code = code; + this.payload = payload; +} + +exports.respondWithCode = function(code, payload) { + return new ResponsePayload(code, payload); +} + +var writeJson = exports.writeJson = function(response, arg1, arg2) { + var code; + var payload; + + if(arg1 && arg1 instanceof ResponsePayload) { + writeJson(response, arg1.payload, arg1.code); + return; + } + + if(arg2 && Number.isInteger(arg2)) { + code = arg2; + } + else { + if(arg1 && Number.isInteger(arg1)) { + code = arg1; + } + } + if(code && arg1) { + payload = arg1; + } + else if(arg1) { + payload = arg1; + } + + if(!code) { + // if no response code given, we default to 200 + code = 200; + } + if(typeof payload === 'object') { + payload = JSON.stringify(payload, null, 2); + } + response.writeHead(code, {'Content-Type': 'application/json'}); + response.end(payload); +} diff --git a/samples/server/petstore/nodejs-express-server/.eslintrc b/samples/server/petstore/nodejs-express-server/.eslintrc new file mode 100644 index 00000000000..6d8abec4c52 --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/.eslintrc @@ -0,0 +1,8 @@ +// Use this file as a starting point for your project's .eslintrc. +// Copy this file, and add rule overrides as needed. +{ + "extends": "airbnb", + "rules": { + "no-console": "off" + } +} diff --git a/samples/server/petstore/nodejs-express-server/.eslintrc.json b/samples/server/petstore/nodejs-express-server/.eslintrc.json new file mode 100644 index 00000000000..6d8abec4c52 --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/.eslintrc.json @@ -0,0 +1,8 @@ +// Use this file as a starting point for your project's .eslintrc. +// Copy this file, and add rule overrides as needed. +{ + "extends": "airbnb", + "rules": { + "no-console": "off" + } +} diff --git a/samples/server/petstore/nodejs-express-server/.openapi-generator-ignore b/samples/server/petstore/nodejs-express-server/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/nodejs-express-server/.openapi-generator/VERSION b/samples/server/petstore/nodejs-express-server/.openapi-generator/VERSION new file mode 100644 index 00000000000..83a328a9227 --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/nodejs-express-server/README.md b/samples/server/petstore/nodejs-express-server/README.md new file mode 100644 index 00000000000..d3d47c09fdc --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/README.md @@ -0,0 +1,71 @@ +# OpenAPI Generated JavaScript/Express Server + +## Overview +This server was generated using the [OpenAPI Generator](https://openapi-generator.tech) project. The code generator, and it's generated code allows you to develop your system with an API-First attitude, where the API contract is the anchor and definer of your project, and your code and business-logic aims to complete and comply to the terms in the API contract. + +### prerequisites +- NodeJS >= 10.4 +- NPM >= 6.10.0 + +The code was written on a mac, so assuming all should work smoothly on Linux-based computers. However, there is no reason not to run this library on Windows-based machines. If you find an OS-related problem, please open an issue and it will be resolved. + +### Running the server +To run the server, run: + +``` +npm start +``` +### View and test the API +You can see the API documentation, and check the available endpoints by going to http://localhost:3000/api-docs/. Endpoints that require security need to have security handlers configured before they can return a successful response. At this point they will return [ a response code of 401](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401). +##### At this stage the server does not support document body sent in xml format. Forms will be supported in the near future. + +### Node version and guidelines +The code was written using Node version 10.6, and complies to the [Airbnb .eslint guiding rules](https://github.com/airbnb/javascript). + +### Project Files +#### Root Directory: +In the root directory we have (besides package.json, config.js, and log files): +- **logger.js** - where we define the logger for the project. The project uses winston, but the purpose of this file is to enable users to change and modify their own logger behavior. +- **index.js** - This is the project's 'main' file, and from here we launch the application. This is a very short and concise file, and the idea behind launching from this short file is to allow use-cases of launching the server with different parameters (changing config and/or logger) without affecting the rest of the code. +- **expressServer.js** - The core of the Express.js server. This is where the express server is initialized, together with the OpenAPI validator, OpenAPI UI, and other libraries needed to start our server. If we want to add external links, that's where they would go. Our project uses the [express-openapi-validator](https://www.npmjs.com/package/express-openapi-validator) library that acts as a first step in the routing process - requests that are directed to paths defined in the `openapi.yaml` file are caught by this process, and it's parameters and bodyContent are validated against the schema. A successful result of this validation will be a new 'openapi' object added to the request. If the path requested is not part of the openapi.yaml file, the validator ignores the request and passes it on, as is, down the flow of the Express server. + +#### api/ +- **openapi.yaml** - This is the OpenAPI contract to which this server will comply. The file was generated using the codegen, and should contain everything needed to run the API Gateway - no references to external models/schemas. + +#### utils/ +Currently a single file: + +- **openapiRouter.js** - This is where the routing to our back-end code happens. If the request object includes an ```openapi``` object, it picks up the following values (that are part of the ```openapi.yaml``` file): 'x-openapi-router-controller', and 'x-openapi-router-service'. These variables are names of files/classes in the controllers and services directories respectively. The operationId of the request is also extracted. The operationId is a method in the controller and the service that was generated as part of the codegen process. The routing process sends the request and response objects to the controller, which will extract the expected variables from the request, and send it to be processed by the service, returning the response from the service to the caller. + +#### controllers/ +After validating the request, and ensuring this belongs to our API gateway, we send the request to a `controller`, where the variables and parameters are extracted from the request and sent to the relevant `service` for processing. The `controller` handles the response from the `service` and builds the appropriate HTTP response to be sent back to the user. + +- **index.js** - load all the controllers that were generated for this project, and export them to be used dynamically by the `openapiRouter.js`. If you would like to customize your controller, it is advised that you link to your controller here, and ensure that the codegen does not rewrite this file. + +- **Controller.js** - The core processor of the generated controllers. The generated controllers are designed to be as slim and generic as possible, referencing to the `Controller.js` for the business logic of parsing the needed variables and arguments from the request, and for building the HTTP response which will be sent back. The `Controller.js` is a class with static methods. + +- **{{x-openapi-router-controller}}.js** - auto-generated code, processing all the operations. The Controller is a class that is constructed with the service class it will be sending the request to. Every request defined by the `openapi.yaml` has an operationId. The operationId is the name of the method that will be called. Every method receives the request and response, and calls the `Controller.js` to process the request and response, adding the service method that should be called for the actual business-logic processing. + +#### services/ +This is where the API Gateway ends, and the unique business-logic of your application kicks in. Every endpoint in the `openapi.yaml` has a variable 'x-openapi-router-service', which is the name of the service class that is generated. The operationID of the endpoint is the name of the method that will be called. The generated code provides a simple promise with a try/catch clause. A successful operation ends with a call to the generic `Service.js` to build a successful response (payload and response code), and a failure will call the generic `Service.js` to build a response with an error object and the relevant response code. It is recommended to have the services be generated automatically once, and after the initial build add methods manually. + +- **index.js** - load all the services that were generated for this project, and export them to be used dynamically by the `openapiRouter.js`. If you would like to customize your service, it is advised that you link to your controller here, and ensure that the codegen does not rewrite this file. + +- **Service.js** - A utility class, very simple and thin at this point, with two static methods for building a response object for successful and failed results in the service operation. The default response code is 200 for success and 500 for failure. It is recommended to send more accurate response codes and override these defaults when relevant. + +- **{{x-openapi-router-service}}.js** - auto-generated code, providing a stub Promise for each operationId defined in the `openapi.yaml`. Each method receives the variables that were defined in the `openapi.yaml` file, and wraps a Promise in a try/catch clause. The Promise resolves both success and failure in a call to the `Service.js` utility class for building the appropriate response that will be sent back to the Controller and then to the caller of this endpoint. + +#### tests/ +- **serverTests.js** - basic server validation tests, checking that the server is up, that a call to an endpoint within the scope of the `openapi.yaml` file returns 200, that a call to a path outside that scope returns 200 if it exists and a 404 if not. +- **routingTests.js** - Runs through all the endpoints defined in the `openapi.yaml`, and constructs a dummy request to send to the server. Confirms that the response code is 200. At this point requests containing xml or formData fail - currently they are not supported in the router. +- **additionalEndpointsTests.js** - A test file for all the endpoints that are defined outside the openapi.yaml scope. Confirms that these endpoints return a successful 200 response. + + +Future tests should be written to ensure that the response of every request sent should conform to the structure defined in the `openapi.yaml`. This test will fail 100% initially, and the job of the development team will be to clear these tests. + + +#### models/ +Currently a concept awaiting feedback. The idea is to have the objects defined in the openapi.yaml act as models which are passed between the different modules. This will conform the programmers to interact using defined objects, rather than loosley-defined JSON objects. Given the nature of JavaScript progrmmers, who want to work with their own bootstrapped parameters, this concept might not work. Keeping this here for future discussion and feedback. + + + diff --git a/samples/server/petstore/nodejs-express-server/api/openapi.yaml b/samples/server/petstore/nodejs-express-server/api/openapi.yaml new file mode 100644 index 00000000000..401e628f3bd --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/api/openapi.yaml @@ -0,0 +1,802 @@ +openapi: 3.0.1 +info: + description: This is a sample server Petstore server. For this sample, you can use + the api key `special-key` to test the authorization filters. + license: + name: Apache-2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- url: http://petstore.swagger.io/v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /pet: + post: + operationId: addPet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + responses: + 405: + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-codegen-request-body-name: body + x-openapi-router-controller: PetController + x-openapi-router-service: PetService + put: + operationId: updatePet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + responses: + 400: + content: {} + description: Invalid ID supplied + 404: + content: {} + description: Pet not found + 405: + content: {} + description: Validation exception + security: + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + x-codegen-request-body-name: body + x-openapi-router-controller: PetController + x-openapi-router-service: PetService + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + 200: + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + 400: + content: {} + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-openapi-router-controller: PetController + x-openapi-router-service: PetService + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + 200: + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + 400: + content: {} + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-openapi-router-controller: PetController + x-openapi-router-service: PetService + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - in: header + name: api_key + schema: + type: string + - description: Pet id to delete + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + 400: + content: {} + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-openapi-router-controller: PetController + x-openapi-router-service: PetService + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + 200: + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + 400: + content: {} + description: Invalid ID supplied + 404: + content: {} + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-openapi-router-controller: PetController + x-openapi-router-service: PetService + post: + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + responses: + 405: + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + x-openapi-router-controller: PetController + x-openapi-router-service: PetService + /pet/{petId}/uploadImage: + post: + operationId: uploadFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + responses: + 200: + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-openapi-router-controller: PetController + x-openapi-router-service: PetService + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + 200: + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-openapi-router-controller: StoreController + x-openapi-router-service: StoreService + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + 200: + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + 400: + content: {} + description: Invalid Order + summary: Place an order for a pet + tags: + - store + x-codegen-request-body-name: body + x-openapi-router-controller: StoreController + x-openapi-router-service: StoreService + /store/order/{orderId}: + delete: + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + in: path + name: orderId + required: true + schema: + type: string + responses: + 400: + content: {} + description: Invalid ID supplied + 404: + content: {} + description: Order not found + summary: Delete purchase order by ID + tags: + - store + x-openapi-router-controller: StoreController + x-openapi-router-service: StoreService + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + in: path + name: orderId + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + responses: + 200: + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + 400: + content: {} + description: Invalid ID supplied + 404: + content: {} + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-openapi-router-controller: StoreController + x-openapi-router-service: StoreService + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Create user + tags: + - user + x-codegen-request-body-name: body + x-openapi-router-controller: UserController + x-openapi-router-service: UserService + /user/createWithArray: + post: + operationId: createUsersWithArrayInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-openapi-router-controller: UserController + x-openapi-router-service: UserService + /user/createWithList: + post: + operationId: createUsersWithListInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-openapi-router-controller: UserController + x-openapi-router-service: UserService + /user/login: + get: + operationId: loginUser + parameters: + - description: The user name for login + in: query + name: username + required: true + schema: + type: string + - description: The password for login in clear text + in: query + name: password + required: true + schema: + type: string + responses: + 200: + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + format: int32 + type: integer + X-Expires-After: + description: date in UTC when toekn expires + schema: + format: date-time + type: string + 400: + content: {} + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-openapi-router-controller: UserController + x-openapi-router-service: UserService + /user/logout: + get: + operationId: logoutUser + responses: + default: + content: {} + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-openapi-router-controller: UserController + x-openapi-router-service: UserService + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + in: path + name: username + required: true + schema: + type: string + responses: + 400: + content: {} + description: Invalid username supplied + 404: + content: {} + description: User not found + summary: Delete user + tags: + - user + x-openapi-router-controller: UserController + x-openapi-router-service: UserService + get: + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + in: path + name: username + required: true + schema: + type: string + responses: + 200: + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + 400: + content: {} + description: Invalid username supplied + 404: + content: {} + description: User not found + summary: Get user by user name + tags: + - user + x-openapi-router-controller: UserController + x-openapi-router-service: UserService + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + in: path + name: username + required: true + schema: + type: string + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + 400: + content: {} + description: Invalid user supplied + 404: + content: {} + description: User not found + summary: Updated user + tags: + - user + x-codegen-request-body-name: body + x-openapi-router-controller: UserController + x-openapi-router-service: UserService +components: + schemas: + Order: + description: An order for a pets from the pet store + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + title: Pet Order + type: object + xml: + name: Order + Category: + description: A category for a pet + example: + name: name + id: 6 + properties: + id: + format: int64 + type: integer + name: + type: string + title: Pet category + type: object + xml: + name: Category + User: + description: A User who is purchasing from the pet store + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + title: a User + type: object + xml: + name: User + Tag: + description: A tag for a pet + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + title: Pet Tag + type: object + xml: + name: Tag + Pet: + description: A pet for sale in the pet store + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + title: a Pet + type: object + xml: + name: Pet + ApiResponse: + description: Describes the result of uploading an image resource + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + title: An uploaded response + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey diff --git a/samples/server/petstore/nodejs-express-server/api/swagger.yaml b/samples/server/petstore/nodejs-express-server/api/swagger.yaml new file mode 100644 index 00000000000..85b742e57ae --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/api/swagger.yaml @@ -0,0 +1,795 @@ +--- +swagger: "2.0" +info: + description: | + "This is a sample server Petstore server. You can find out more about\ + \ Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).\ + \ For this sample, you can use the api key `special-key` to test the authorization\ + \ filters." + version: "1.0.0" + title: "Swagger Petstore" + termsOfService: "http://swagger.io/terms/" + contact: + email: "apiteam@swagger.io" + license: + name: "Apache-2.0" + url: "http://www.apache.org/licenses/LICENSE-2.0.html" +basePath: "/v2" +tags: +- name: "pet" + description: "Everything about your Pets" + externalDocs: + description: "Find out more" + url: "http://swagger.io" +- name: "store" + description: "Access to Petstore orders" +- name: "user" + description: "Operations about user" + externalDocs: + description: "Find out more about our store" + url: "http://swagger.io" +schemes: +- "http" +paths: + /pet: + post: + tags: + - "pet" + summary: "Add a new pet to the store" + description: "" + operationId: "addPet" + consumes: + - "application/json" + - "application/xml" + produces: + - "application/xml" + - "application/json" + parameters: + - in: "body" + name: "body" + description: "Pet object that needs to be added to the store" + required: true + schema: + $ref: "#/definitions/Pet" + responses: + 405: + description: "Invalid input" + security: + - petstore_auth: + - "write:pets" + - "read:pets" + x-swagger-router-controller: "Pet" + put: + tags: + - "pet" + summary: "Update an existing pet" + description: "" + operationId: "updatePet" + consumes: + - "application/json" + - "application/xml" + produces: + - "application/xml" + - "application/json" + parameters: + - in: "body" + name: "body" + description: "Pet object that needs to be added to the store" + required: true + schema: + $ref: "#/definitions/Pet" + responses: + 400: + description: "Invalid ID supplied" + 404: + description: "Pet not found" + 405: + description: "Validation exception" + security: + - petstore_auth: + - "write:pets" + - "read:pets" + x-swagger-router-controller: "Pet" + /pet/findByStatus: + get: + tags: + - "pet" + summary: "Finds Pets by status" + description: "Multiple status values can be provided with comma separated strings" + operationId: "findPetsByStatus" + produces: + - "application/xml" + - "application/json" + parameters: + - name: "status" + in: "query" + description: "Status values that need to be considered for filter" + required: true + type: "array" + items: + type: "string" + default: "available" + enum: + - "available" + - "pending" + - "sold" + collectionFormat: "csv" + responses: + 200: + description: "successful operation" + schema: + type: "array" + items: + $ref: "#/definitions/Pet" + 400: + description: "Invalid status value" + security: + - petstore_auth: + - "write:pets" + - "read:pets" + x-swagger-router-controller: "Pet" + /pet/findByTags: + get: + tags: + - "pet" + summary: "Finds Pets by tags" + description: | + "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." + operationId: "findPetsByTags" + produces: + - "application/xml" + - "application/json" + parameters: + - name: "tags" + in: "query" + description: "Tags to filter by" + required: true + type: "array" + items: + type: "string" + collectionFormat: "csv" + responses: + 200: + description: "successful operation" + schema: + type: "array" + items: + $ref: "#/definitions/Pet" + 400: + description: "Invalid tag value" + security: + - petstore_auth: + - "write:pets" + - "read:pets" + deprecated: true + x-swagger-router-controller: "Pet" + /pet/{petId}: + get: + tags: + - "pet" + summary: "Find pet by ID" + description: "Returns a single pet" + operationId: "getPetById" + produces: + - "application/xml" + - "application/json" + parameters: + - name: "petId" + in: "path" + description: "ID of pet to return" + required: true + type: "integer" + format: "int64" + responses: + 200: + description: "successful operation" + schema: + $ref: "#/definitions/Pet" + 400: + description: "Invalid ID supplied" + 404: + description: "Pet not found" + security: + - api_key: [] + x-swagger-router-controller: "Pet" + post: + tags: + - "pet" + summary: "Updates a pet in the store with form data" + description: "" + operationId: "updatePetWithForm" + consumes: + - "application/x-www-form-urlencoded" + produces: + - "application/xml" + - "application/json" + parameters: + - name: "petId" + in: "path" + description: "ID of pet that needs to be updated" + required: true + type: "integer" + format: "int64" + - name: "name" + in: "formData" + description: "Updated name of the pet" + required: false + type: "string" + - name: "status" + in: "formData" + description: "Updated status of the pet" + required: false + type: "string" + responses: + 405: + description: "Invalid input" + security: + - petstore_auth: + - "write:pets" + - "read:pets" + x-swagger-router-controller: "Pet" + delete: + tags: + - "pet" + summary: "Deletes a pet" + description: "" + operationId: "deletePet" + produces: + - "application/xml" + - "application/json" + parameters: + - name: "api_key" + in: "header" + required: false + type: "string" + - name: "petId" + in: "path" + description: "Pet id to delete" + required: true + type: "integer" + format: "int64" + responses: + 400: + description: "Invalid pet value" + security: + - petstore_auth: + - "write:pets" + - "read:pets" + x-swagger-router-controller: "Pet" + /pet/{petId}/uploadImage: + post: + tags: + - "pet" + summary: "uploads an image" + description: "" + operationId: "uploadFile" + consumes: + - "multipart/form-data" + produces: + - "application/json" + parameters: + - name: "petId" + in: "path" + description: "ID of pet to update" + required: true + type: "integer" + format: "int64" + - name: "additionalMetadata" + in: "formData" + description: "Additional data to pass to server" + required: false + type: "string" + - name: "file" + in: "formData" + description: "file to upload" + required: false + type: "file" + responses: + 200: + description: "successful operation" + schema: + $ref: "#/definitions/ApiResponse" + security: + - petstore_auth: + - "write:pets" + - "read:pets" + x-swagger-router-controller: "Pet" + /store/inventory: + get: + tags: + - "store" + summary: "Returns pet inventories by status" + description: "Returns a map of status codes to quantities" + operationId: "getInventory" + produces: + - "application/json" + parameters: [] + responses: + 200: + description: "successful operation" + schema: + type: "object" + additionalProperties: + type: "integer" + format: "int32" + security: + - api_key: [] + x-swagger-router-controller: "Store" + /store/order: + post: + tags: + - "store" + summary: "Place an order for a pet" + description: "" + operationId: "placeOrder" + produces: + - "application/xml" + - "application/json" + parameters: + - in: "body" + name: "body" + description: "order placed for purchasing the pet" + required: true + schema: + $ref: "#/definitions/Order" + responses: + 200: + description: "successful operation" + schema: + $ref: "#/definitions/Order" + 400: + description: "Invalid Order" + x-swagger-router-controller: "Store" + /store/order/{orderId}: + get: + tags: + - "store" + summary: "Find purchase order by ID" + description: | + "For valid response try integer IDs with value <= 5 or > 10. Other\ + \ values will generated exceptions" + operationId: "getOrderById" + produces: + - "application/xml" + - "application/json" + parameters: + - name: "orderId" + in: "path" + description: "ID of pet that needs to be fetched" + required: true + type: "integer" + maximum: 5 + minimum: 1 + format: "int64" + responses: + 200: + description: "successful operation" + schema: + $ref: "#/definitions/Order" + 400: + description: "Invalid ID supplied" + 404: + description: "Order not found" + x-swagger-router-controller: "Store" + delete: + tags: + - "store" + summary: "Delete purchase order by ID" + description: | + "For valid response try integer IDs with value < 1000. Anything\ + \ above 1000 or nonintegers will generate API errors" + operationId: "deleteOrder" + produces: + - "application/xml" + - "application/json" + parameters: + - name: "orderId" + in: "path" + description: "ID of the order that needs to be deleted" + required: true + type: "string" + responses: + 400: + description: "Invalid ID supplied" + 404: + description: "Order not found" + x-swagger-router-controller: "Store" + /user: + post: + tags: + - "user" + summary: "Create user" + description: "This can only be done by the logged in user." + operationId: "createUser" + produces: + - "application/xml" + - "application/json" + parameters: + - in: "body" + name: "body" + description: "Created user object" + required: true + schema: + $ref: "#/definitions/User" + responses: + default: + description: "successful operation" + x-swagger-router-controller: "User" + /user/createWithArray: + post: + tags: + - "user" + summary: "Creates list of users with given input array" + description: "" + operationId: "createUsersWithArrayInput" + produces: + - "application/xml" + - "application/json" + parameters: + - in: "body" + name: "body" + description: "List of user object" + required: true + schema: + type: "array" + items: + $ref: "#/definitions/User" + responses: + default: + description: "successful operation" + x-swagger-router-controller: "User" + /user/createWithList: + post: + tags: + - "user" + summary: "Creates list of users with given input array" + description: "" + operationId: "createUsersWithListInput" + produces: + - "application/xml" + - "application/json" + parameters: + - in: "body" + name: "body" + description: "List of user object" + required: true + schema: + type: "array" + items: + $ref: "#/definitions/User" + responses: + default: + description: "successful operation" + x-swagger-router-controller: "User" + /user/login: + get: + tags: + - "user" + summary: "Logs user into the system" + description: "" + operationId: "loginUser" + produces: + - "application/xml" + - "application/json" + parameters: + - name: "username" + in: "query" + description: "The user name for login" + required: true + type: "string" + - name: "password" + in: "query" + description: "The password for login in clear text" + required: true + type: "string" + responses: + 200: + description: "successful operation" + schema: + type: "string" + headers: + X-Rate-Limit: + type: "integer" + format: "int32" + description: "calls per hour allowed by the user" + X-Expires-After: + type: "string" + format: "date-time" + description: "date in UTC when toekn expires" + 400: + description: "Invalid username/password supplied" + x-swagger-router-controller: "User" + /user/logout: + get: + tags: + - "user" + summary: "Logs out current logged in user session" + description: "" + operationId: "logoutUser" + produces: + - "application/xml" + - "application/json" + parameters: [] + responses: + default: + description: "successful operation" + x-swagger-router-controller: "User" + /user/{username}: + get: + tags: + - "user" + summary: "Get user by user name" + description: "" + operationId: "getUserByName" + produces: + - "application/xml" + - "application/json" + parameters: + - name: "username" + in: "path" + description: "The name that needs to be fetched. Use user1 for testing." + required: true + type: "string" + responses: + 200: + description: "successful operation" + schema: + $ref: "#/definitions/User" + 400: + description: "Invalid username supplied" + 404: + description: "User not found" + x-swagger-router-controller: "User" + put: + tags: + - "user" + summary: "Updated user" + description: "This can only be done by the logged in user." + operationId: "updateUser" + produces: + - "application/xml" + - "application/json" + parameters: + - name: "username" + in: "path" + description: "name that need to be deleted" + required: true + type: "string" + - in: "body" + name: "body" + description: "Updated user object" + required: true + schema: + $ref: "#/definitions/User" + responses: + 400: + description: "Invalid user supplied" + 404: + description: "User not found" + x-swagger-router-controller: "User" + delete: + tags: + - "user" + summary: "Delete user" + description: "This can only be done by the logged in user." + operationId: "deleteUser" + produces: + - "application/xml" + - "application/json" + parameters: + - name: "username" + in: "path" + description: "The name that needs to be deleted" + required: true + type: "string" + responses: + 400: + description: "Invalid username supplied" + 404: + description: "User not found" + x-swagger-router-controller: "User" + +securityDefinitions: + petstore_auth: + type: "oauth2" + authorizationUrl: "http://petstore.swagger.io/api/oauth/dialog" + flow: "implicit" + scopes: + write:pets: "modify pets in your account" + read:pets: "read your pets" + api_key: + type: "apiKey" + name: "api_key" + in: "header" +definitions: + Order: + type: "object" + properties: + id: + type: "integer" + format: "int64" + petId: + type: "integer" + format: "int64" + quantity: + type: "integer" + format: "int32" + shipDate: + type: "string" + format: "date-time" + status: + type: "string" + description: "Order Status" + enum: + - "placed" + - "approved" + - "delivered" + complete: + type: "boolean" + default: false + title: "Pet Order" + description: "An order for a pets from the pet store" + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: "2000-01-23T04:56:07.000+00:00" + complete: false + status: "placed" + xml: + name: "Order" + Category: + type: "object" + properties: + id: + type: "integer" + format: "int64" + name: + type: "string" + title: "Pet category" + description: "A category for a pet" + example: + name: "name" + id: 6 + xml: + name: "Category" + User: + type: "object" + properties: + id: + type: "integer" + format: "int64" + username: + type: "string" + firstName: + type: "string" + lastName: + type: "string" + email: + type: "string" + password: + type: "string" + phone: + type: "string" + userStatus: + type: "integer" + format: "int32" + description: "User Status" + title: "a User" + description: "A User who is purchasing from the pet store" + example: + firstName: "firstName" + lastName: "lastName" + password: "password" + userStatus: 6 + phone: "phone" + id: 0 + email: "email" + username: "username" + xml: + name: "User" + Tag: + type: "object" + properties: + id: + type: "integer" + format: "int64" + name: + type: "string" + title: "Pet Tag" + description: "A tag for a pet" + example: + name: "name" + id: 1 + xml: + name: "Tag" + Pet: + type: "object" + required: + - "name" + - "photoUrls" + properties: + id: + type: "integer" + format: "int64" + category: + $ref: "#/definitions/Category" + name: + type: "string" + example: "doggie" + photoUrls: + type: "array" + xml: + name: "photoUrl" + wrapped: true + items: + type: "string" + tags: + type: "array" + xml: + name: "tag" + wrapped: true + items: + $ref: "#/definitions/Tag" + status: + type: "string" + description: "pet status in the store" + enum: + - "available" + - "pending" + - "sold" + title: "a Pet" + description: "A pet for sale in the pet store" + example: + photoUrls: + - "photoUrls" + - "photoUrls" + name: "doggie" + id: 0 + category: + name: "name" + id: 6 + tags: + - name: "name" + id: 1 + - name: "name" + id: 1 + status: "available" + xml: + name: "Pet" + ApiResponse: + type: "object" + properties: + code: + type: "integer" + format: "int32" + type: + type: "string" + message: + type: "string" + title: "An uploaded response" + description: "Describes the result of uploading an image resource" + example: + code: 0 + type: "type" + message: "message" + testItem: + type: object + properties: + id: + type: integer + name: + type: string + descrtiption: + type: string + version: + type: number + example: + id: 1 + name: "testItem" + description: "An item which means very little, as it's only a test" + version: 2.3 +externalDocs: + description: "Find out more about Swagger" + url: "http://swagger.io" diff --git a/samples/server/petstore/nodejs-express-server/config.js b/samples/server/petstore/nodejs-express-server/config.js new file mode 100644 index 00000000000..80f568992bd --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/config.js @@ -0,0 +1,12 @@ +const path = require('path'); + +const config = { + ROOT_DIR: __dirname, + URL_PORT: 3000, + URL_PATH: 'http://localhost', + BASE_VERSION: 'v2', + CONTROLLER_DIRECTORY: path.join(__dirname, 'controllers'), +}; +config.OPENAPI_YAML = path.join(config.ROOT_DIR, 'api', 'openapi.yaml'); +config.FULL_PATH = `${config.URL_PATH}:${config.URL_PORT}/${config.BASE_VERSION}`; +module.exports = config; diff --git a/samples/server/petstore/nodejs-express-server/controllers/Controller.js b/samples/server/petstore/nodejs-express-server/controllers/Controller.js new file mode 100644 index 00000000000..bdf8776c0e4 --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/controllers/Controller.js @@ -0,0 +1,72 @@ +const logger = require('../logger'); + +class Controller { + static sendResponse(response, payload) { + /** + * The default response-code is 200. We want to allow to change that. in That case, + * payload will be an object consisting of a code and a payload. If not customized + * send 200 and the payload as received in this method. + */ + response.status(payload.code || 200); + const responsePayload = payload.payload !== undefined ? payload.payload : payload; + if (responsePayload instanceof Object) { + response.json(responsePayload); + } else { + response.end(responsePayload); + } + } + + static sendError(response, error) { + response.status(error.code || 500); + if (error.error instanceof Object) { + response.json(error.error); + } else { + response.end(error.error || error.message); + } + } + + static collectFiles(request) { + logger.info('Checking if files are expected in schema'); + if (request.openapi.schema.requestBody !== undefined) { + const [contentType] = request.headers['content-type'].split(';'); + if (contentType === 'multipart/form-data') { + const contentSchema = request.openapi.schema.requestBody.content[contentType].schema; + Object.entries(contentSchema.properties).forEach(([name, property]) => { + if (property.type === 'string' && ['binary', 'base64'].indexOf(property.format) > -1) { + request.body[name] = request.files.find(file => file.fieldname === name); + } + }); + } else if (request.openapi.schema.requestBody.content[contentType] !== undefined + && request.files !== undefined) { + [request.body] = request.files; + } + } + } + + static collectRequestParams(request) { + this.collectFiles(request); + const requestParams = {}; + if (request.openapi.schema.requestBody !== undefined) { + requestParams.body = request.body; + } + request.openapi.schema.parameters.forEach((param) => { + if (param.in === 'path') { + requestParams[param.name] = request.openapi.pathParams[param.name]; + } else if (param.in === 'query') { + requestParams[param.name] = request.query[param.name]; + } + }); + return requestParams; + } + + static async handleRequest(request, response, serviceOperation) { + try { + const serviceResponse = await serviceOperation(this.collectRequestParams(request)); + Controller.sendResponse(response, serviceResponse); + } catch (error) { + Controller.sendError(response, error); + } + } +} + +module.exports = Controller; diff --git a/samples/server/petstore/nodejs-express-server/controllers/PetController.js b/samples/server/petstore/nodejs-express-server/controllers/PetController.js new file mode 100644 index 00000000000..488389927cb --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/controllers/PetController.js @@ -0,0 +1,42 @@ +const Controller = require('./Controller'); + +class PetController { + constructor(Service) { + this.service = Service; + } + + async addPet(request, response) { + await Controller.handleRequest(request, response, this.service.addPet); + } + + async deletePet(request, response) { + await Controller.handleRequest(request, response, this.service.deletePet); + } + + async findPetsByStatus(request, response) { + await Controller.handleRequest(request, response, this.service.findPetsByStatus); + } + + async findPetsByTags(request, response) { + await Controller.handleRequest(request, response, this.service.findPetsByTags); + } + + async getPetById(request, response) { + await Controller.handleRequest(request, response, this.service.getPetById); + } + + async updatePet(request, response) { + await Controller.handleRequest(request, response, this.service.updatePet); + } + + async updatePetWithForm(request, response) { + await Controller.handleRequest(request, response, this.service.updatePetWithForm); + } + + async uploadFile(request, response) { + await Controller.handleRequest(request, response, this.service.uploadFile); + } + +} + +module.exports = PetController; diff --git a/samples/server/petstore/nodejs-express-server/controllers/StoreController.js b/samples/server/petstore/nodejs-express-server/controllers/StoreController.js new file mode 100644 index 00000000000..fabc3e523f8 --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/controllers/StoreController.js @@ -0,0 +1,26 @@ +const Controller = require('./Controller'); + +class StoreController { + constructor(Service) { + this.service = Service; + } + + async deleteOrder(request, response) { + await Controller.handleRequest(request, response, this.service.deleteOrder); + } + + async getInventory(request, response) { + await Controller.handleRequest(request, response, this.service.getInventory); + } + + async getOrderById(request, response) { + await Controller.handleRequest(request, response, this.service.getOrderById); + } + + async placeOrder(request, response) { + await Controller.handleRequest(request, response, this.service.placeOrder); + } + +} + +module.exports = StoreController; diff --git a/samples/server/petstore/nodejs-express-server/controllers/UserController.js b/samples/server/petstore/nodejs-express-server/controllers/UserController.js new file mode 100644 index 00000000000..4dafcfa8903 --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/controllers/UserController.js @@ -0,0 +1,42 @@ +const Controller = require('./Controller'); + +class UserController { + constructor(Service) { + this.service = Service; + } + + async createUser(request, response) { + await Controller.handleRequest(request, response, this.service.createUser); + } + + async createUsersWithArrayInput(request, response) { + await Controller.handleRequest(request, response, this.service.createUsersWithArrayInput); + } + + async createUsersWithListInput(request, response) { + await Controller.handleRequest(request, response, this.service.createUsersWithListInput); + } + + async deleteUser(request, response) { + await Controller.handleRequest(request, response, this.service.deleteUser); + } + + async getUserByName(request, response) { + await Controller.handleRequest(request, response, this.service.getUserByName); + } + + async loginUser(request, response) { + await Controller.handleRequest(request, response, this.service.loginUser); + } + + async logoutUser(request, response) { + await Controller.handleRequest(request, response, this.service.logoutUser); + } + + async updateUser(request, response) { + await Controller.handleRequest(request, response, this.service.updateUser); + } + +} + +module.exports = UserController; diff --git a/samples/server/petstore/nodejs-express-server/controllers/index.js b/samples/server/petstore/nodejs-express-server/controllers/index.js new file mode 100644 index 00000000000..0ad912de205 --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/controllers/index.js @@ -0,0 +1,9 @@ +const PetController = require('./PetController'); +const StoreController = require('./StoreController'); +const UserController = require('./UserController'); + +module.exports = { + PetController, + StoreController, + UserController, +}; diff --git a/samples/server/petstore/nodejs-express-server/expressServer.js b/samples/server/petstore/nodejs-express-server/expressServer.js new file mode 100644 index 00000000000..64998cf2563 --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/expressServer.js @@ -0,0 +1,93 @@ +// const { Middleware } = require('swagger-express-middleware'); +const path = require('path'); +const swaggerUI = require('swagger-ui-express'); +const yamljs = require('yamljs'); +const express = require('express'); +const cors = require('cors'); +const cookieParser = require('cookie-parser'); +const bodyParser = require('body-parser'); +const { OpenApiValidator } = require('express-openapi-validator'); +const openapiRouter = require('./utils/openapiRouter'); +const logger = require('./logger'); + +class ExpressServer { + constructor(port, openApiYaml) { + this.port = port; + this.app = express(); + this.openApiPath = openApiYaml; + this.schema = yamljs.load(openApiYaml); + this.setupMiddleware(); + } + + setupMiddleware() { + // this.setupAllowedMedia(); + this.app.use(cors()); + this.app.use(bodyParser.json()); + this.app.use(express.json()); + this.app.use(express.urlencoded({ extended: false })); + this.app.use(cookieParser()); + this.app.use('/spec', express.static(path.join(__dirname, 'api'))); + this.app.get('/hello', (req, res) => res.send('Hello World. path: '+this.openApiPath)); + // this.app.get('/spec', express.static(this.openApiPath)); + this.app.use('/api-docs', swaggerUI.serve, swaggerUI.setup(this.schema)); + this.app.get('/login-redirect', (req, res) => { + res.status(200); + res.json(req.query); + }); + this.app.get('/oauth2-redirect.html', (req, res) => { + res.status(200); + res.json(req.query); + }); + new OpenApiValidator({ + apiSpecPath: this.openApiPath, + }).install(this.app); + this.app.use(openapiRouter()); + this.app.get('/', (req, res) => { + res.status(200); + res.end('Hello World'); + }); + } + + addErrorHandler() { + this.app.use('*', (req, res) => { + res.status(404); + res.send(JSON.stringify({ error: `path ${req.baseUrl} doesn't exist` })); + }); + /** + * suppressed eslint rule: The next variable is required here, even though it's not used. + * + ** */ + // eslint-disable-next-line no-unused-vars + this.app.use((error, req, res, next) => { + const errorResponse = error.error || error.errors || error.message || 'Unknown error'; + res.status(error.status || 500); + res.type('json'); + res.json({ error: errorResponse }); + }); + } + + async launch() { + return new Promise( + async (resolve, reject) => { + try { + this.addErrorHandler(); + this.server = await this.app.listen(this.port, () => { + console.log(`server running on port ${this.port}`); + resolve(this.server); + }); + } catch (error) { + reject(error); + } + }, + ); + } + + async close() { + if (this.server !== undefined) { + await this.server.close(); + console.log(`Server on port ${this.port} shut down`); + } + } +} + +module.exports = ExpressServer; diff --git a/samples/server/petstore/nodejs-express-server/index.js b/samples/server/petstore/nodejs-express-server/index.js new file mode 100644 index 00000000000..cc9dbc7e54b --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/index.js @@ -0,0 +1,28 @@ +const config = require('./config'); +const logger = require('./logger'); +const ExpressServer = require('./expressServer'); +// const App = require('./app'); + +// const app = new App(config); +// app.launch() +// .then(() => { +// logger.info('Server launched'); +// }) +// .catch((error) => { +// logger.error('found error, shutting down server'); +// app.close() +// .catch(closeError => logger.error(closeError)) +// .finally(() => logger.error(error)); +// }); +const launchServer = async () => { + try { + this.expressServer = new ExpressServer(config.URL_PORT, config.OPENAPI_YAML); + await this.expressServer.launch(); + logger.info('Express server running'); + } catch (error) { + logger.error(error); + await this.close(); + } +}; + +launchServer().catch(e => logger.error(e)); diff --git a/samples/server/petstore/nodejs-express-server/logger.js b/samples/server/petstore/nodejs-express-server/logger.js new file mode 100644 index 00000000000..27134586f8e --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/logger.js @@ -0,0 +1,17 @@ +const winston = require('winston'); + +const logger = winston.createLogger({ + level: 'info', + format: winston.format.json(), + defaultMeta: { service: 'user-service' }, + transports: [ + new winston.transports.File({ filename: 'error.log', level: 'error' }), + new winston.transports.File({ filename: 'combined.log' }), + ], +}); + +if (process.env.NODE_ENV !== 'production') { + logger.add(new winston.transports.Console({ format: winston.format.simple() })); +} + +module.exports = logger; diff --git a/samples/server/petstore/nodejs-express-server/models/Category.js b/samples/server/petstore/nodejs-express-server/models/Category.js new file mode 100644 index 00000000000..b911b01bf1e --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/models/Category.js @@ -0,0 +1,23 @@ +const ono = require('ono'); +const Model = require('./Model'); + +class Category { + constructor(id, name) { + const validationErrors = (Model.validateModel(Category, { name, id })); + if (validationErrors.length === 0) { + this.id = id; + this.name = name; + } else { + throw ono('Tried to create an invalid Category instance', { errors: validationErrors }); + } + } +} + +Category.types = { + id: 'integer', + name: 'string', +}; + +Category.required = []; + +module.exports = Category; diff --git a/samples/server/petstore/nodejs-express-server/models/Model.js b/samples/server/petstore/nodejs-express-server/models/Model.js new file mode 100644 index 00000000000..57527445e55 --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/models/Model.js @@ -0,0 +1,47 @@ +class Model { + static validateModel(modelClass, variables) { + const invalidArray = []; + Object.entries(variables).forEach(([key, value]) => { + const typeToCheck = modelClass.types[key]; + switch (typeToCheck) { + case 'string': + if (!(typeof value === 'string' || value instanceof String)) { + invalidArray.push({ key, expectedType: typeToCheck, value }); + } + break; + case 'number': + case 'integer': + if (!(typeof value === 'number' && !Number.isNaN(value))) { + invalidArray.push({ key, expectedType: typeToCheck, value }); + } + break; + case 'array': + if (!(value && typeof value === 'object' && value.constructor === Array)) { + invalidArray.push({ key, expectedType: typeToCheck, value }); + } + break; + case 'object': + if (!(value && typeof value === 'object' && value.constructor === Object)) { + invalidArray.push({ key, expectedType: typeToCheck, value }); + } + break; + case 'boolean': + if (!(typeof value === 'boolean')) { + invalidArray.push({ key, expectedType: typeToCheck, value }); + } + break; + default: + break; + } + }); + modelClass.required.forEach((requiredFieldName) => { + if (variables[requiredFieldName] === undefined || variables[requiredFieldName] === '') { + invalidArray.push( + { field: requiredFieldName, required: true, value: variables[requiredFieldName] }, + ); + } + }); + return invalidArray; + } +} +module.exports = Model; diff --git a/samples/server/petstore/nodejs-express-server/models/Pet.js b/samples/server/petstore/nodejs-express-server/models/Pet.js new file mode 100644 index 00000000000..040cec2f991 --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/models/Pet.js @@ -0,0 +1,35 @@ +const ono = require('ono'); +const Model = require('./Model'); +const Tag = require('./Tag'); +const Category = require('./Category'); + +class Pet { + constructor(photoUrls, name, id, tags, status, category) { + const validationErrors = Model.validateModel(Pet, { + photoUrls, name, id, tags, status, category, + }); + if (validationErrors.length === 0) { + this.photoUrls = photoUrls; + this.name = name; + this.id = id; + this.tags = tags.map(t => new Tag(t.id, t.name)); + this.status = status; + this.category = new Category(category.id, category.name); + } else { + throw ono('Tried to create an invalid Pet instance', { errors: validationErrors }); + } + } +} + +Pet.types = { + photoUrls: 'array', + name: 'string', + id: 'integer', + tags: 'array', + status: 'string', + category: 'object', +}; + +Pet.required = ['name', 'photoUrls']; + +module.exports = Pet; diff --git a/samples/server/petstore/nodejs-express-server/models/Tag.js b/samples/server/petstore/nodejs-express-server/models/Tag.js new file mode 100644 index 00000000000..1c352a45f0f --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/models/Tag.js @@ -0,0 +1,24 @@ +const ono = require('ono'); +const Model = require('./Model'); + +class Tag { + constructor(id, name) { + const validationErrors = Model.validateModel(Tag, + { name, id }); + if (validationErrors.length === 0) { + this.name = name; + this.id = id; + } else { + throw ono('Tried to create an invalid Tag instance', { errors: validationErrors }); + } + } +} + +Tag.types = { + name: 'string', + id: 'integer', +}; + +Tag.required = []; + +module.exports = Tag; diff --git a/samples/server/petstore/nodejs-express-server/models/UpdatePetWithFormModel.js b/samples/server/petstore/nodejs-express-server/models/UpdatePetWithFormModel.js new file mode 100644 index 00000000000..ed01cfb38c3 --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/models/UpdatePetWithFormModel.js @@ -0,0 +1,25 @@ +const ono = require('ono'); +const Model = require('./Model'); + +class UpdatePetWithFormModel { + constructor(name, status) { + const validationErrors = Model.validateModel(UpdatePetWithFormModel, { + name, status, + }); + if (validationErrors.length === 0) { + this.name = name; + this.status = status; + } else { + throw ono('Tried to create an invalid UpdatePetWithFormModel instance', { errors: validationErrors }); + } + } +} + +UpdatePetWithFormModel.types = { + name: 'string', + status: 'string', +}; + +UpdatePetWithFormModel.required = []; + +module.exports = UpdatePetWithFormModel; diff --git a/samples/server/petstore/nodejs-express-server/models/UploadFileModel.js b/samples/server/petstore/nodejs-express-server/models/UploadFileModel.js new file mode 100644 index 00000000000..62db8911f9e --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/models/UploadFileModel.js @@ -0,0 +1,25 @@ +const ono = require('ono'); +const Model = require('./Model'); + +class UploadFileModel { + constructor(additionalMetadata, file) { + const validationErrors = Model.validateModel(UploadFileModel, { + additionalMetadata, file, + }); + if (validationErrors.length === 0) { + this.additionalMetadata = additionalMetadata; + this.file = file; + } else { + throw ono('Tried to create an invalid UploadFileModel instance', { errors: validationErrors }); + } + } +} + +UploadFileModel.types = { + additionalMetadata: 'string', + file: 'string', +}; + +UploadFileModel.required = []; + +module.exports = UploadFileModel; diff --git a/samples/server/petstore/nodejs-express-server/models/index.js b/samples/server/petstore/nodejs-express-server/models/index.js new file mode 100644 index 00000000000..66963054a24 --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/models/index.js @@ -0,0 +1,9 @@ +const CategoryModel = require('./Category'); +const PetModel = require('./Pet'); +const TagModel = require('./Tag'); + +module.exports = { + CategoryModel, + PetModel, + TagModel, +}; diff --git a/samples/server/petstore/nodejs-express-server/package.json b/samples/server/petstore/nodejs-express-server/package.json new file mode 100644 index 00000000000..e4bdc09d99b --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/package.json @@ -0,0 +1,46 @@ +{ + "name": "openapi-petstore", + "version": "1.0.0", + "description": "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.", + "main": "index.js", + "scripts": { + "prestart": "npm install", + "start": "node index.js" + }, + "keywords": [ + "openapi-generator", + "openapi" + ], + "license": "Unlicense", + "private": true, + "dependencies": { + "body-parser": "^1.19.0", + "connect": "^3.2.0", + "cookie-parser": "^1.4.4", + "cors": "^2.8.5", + "express": "^4.16.4", + "express-openapi-validator": "^1.0.0", + "js-yaml": "^3.3.0", + "jstoxml": "^1.5.0", + "ono": "^5.0.1", + "openapi-sampler": "^1.0.0-beta.15", + "swagger-express-middleware": "^2.0.2", + "swagger-tools": "^0.10.4", + "swagger-ui-express": "^4.0.2", + "winston": "^3.2.1", + "yamljs": "^0.3.0", + "mocha": "^6.1.4", + "axios": "^0.19.0", + "chai": "^4.2.0", + "chai-as-promised": "^7.1.1", + "eslint": "^5.16.0", + "eslint-config-airbnb-base": "^13.1.0", + "eslint-plugin-import": "^2.17.2", + "form-data": "^2.3.3" + }, + "eslintConfig": { + "env": { + "node": true + } + } +} diff --git a/samples/server/petstore/nodejs-express-server/services/PetService.js b/samples/server/petstore/nodejs-express-server/services/PetService.js new file mode 100644 index 00000000000..779b40fb99d --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/services/PetService.js @@ -0,0 +1,184 @@ +/* eslint-disable no-unused-vars */ +const Service = require('./Service'); + +class PetService { + + /** + * Add a new pet to the store + * + * body Pet Pet object that needs to be added to the store + * no response value expected for this operation + **/ + static addPet({ body }) { + return new Promise( + async (resolve) => { + try { + resolve(Service.successResponse('')); + } catch (e) { + resolve(Service.rejectResponse( + e.message || 'Invalid input', + e.status || 405, + )); + } + }, + ); + } + + /** + * Deletes a pet + * + * petId Long Pet id to delete + * apiUnderscorekey String (optional) + * no response value expected for this operation + **/ + static deletePet({ petId, apiUnderscorekey }) { + return new Promise( + async (resolve) => { + try { + resolve(Service.successResponse('')); + } catch (e) { + resolve(Service.rejectResponse( + e.message || 'Invalid input', + e.status || 405, + )); + } + }, + ); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * status List Status values that need to be considered for filter + * returns List + **/ + static findPetsByStatus({ status }) { + return new Promise( + async (resolve) => { + try { + resolve(Service.successResponse('')); + } catch (e) { + resolve(Service.rejectResponse( + e.message || 'Invalid input', + e.status || 405, + )); + } + }, + ); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * tags List Tags to filter by + * returns List + **/ + static findPetsByTags({ tags }) { + return new Promise( + async (resolve) => { + try { + resolve(Service.successResponse('')); + } catch (e) { + resolve(Service.rejectResponse( + e.message || 'Invalid input', + e.status || 405, + )); + } + }, + ); + } + + /** + * Find pet by ID + * Returns a single pet + * + * petId Long ID of pet to return + * returns Pet + **/ + static getPetById({ petId }) { + return new Promise( + async (resolve) => { + try { + resolve(Service.successResponse('')); + } catch (e) { + resolve(Service.rejectResponse( + e.message || 'Invalid input', + e.status || 405, + )); + } + }, + ); + } + + /** + * Update an existing pet + * + * body Pet Pet object that needs to be added to the store + * no response value expected for this operation + **/ + static updatePet({ body }) { + return new Promise( + async (resolve) => { + try { + resolve(Service.successResponse('')); + } catch (e) { + resolve(Service.rejectResponse( + e.message || 'Invalid input', + e.status || 405, + )); + } + }, + ); + } + + /** + * Updates a pet in the store with form data + * + * petId Long ID of pet that needs to be updated + * name String Updated name of the pet (optional) + * status String Updated status of the pet (optional) + * no response value expected for this operation + **/ + static updatePetWithForm({ petId, name, status }) { + return new Promise( + async (resolve) => { + try { + resolve(Service.successResponse('')); + } catch (e) { + resolve(Service.rejectResponse( + e.message || 'Invalid input', + e.status || 405, + )); + } + }, + ); + } + + /** + * uploads an image + * + * petId Long ID of pet to update + * additionalMetadata String Additional data to pass to server (optional) + * file File file to upload (optional) + * returns ApiResponse + **/ + static uploadFile({ petId, additionalMetadata, file }) { + return new Promise( + async (resolve) => { + try { + resolve(Service.successResponse('')); + } catch (e) { + resolve(Service.rejectResponse( + e.message || 'Invalid input', + e.status || 405, + )); + } + }, + ); + } + +} + +module.exports = PetService; diff --git a/samples/server/petstore/nodejs-express-server/services/Service.js b/samples/server/petstore/nodejs-express-server/services/Service.js new file mode 100644 index 00000000000..11f8c9a1c3a --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/services/Service.js @@ -0,0 +1,11 @@ +class Service { + static rejectResponse(error, code = 500) { + return { error, code }; + } + + static successResponse(payload, code = 200) { + return { payload, code }; + } +} + +module.exports = Service; diff --git a/samples/server/petstore/nodejs-express-server/services/StoreService.js b/samples/server/petstore/nodejs-express-server/services/StoreService.js new file mode 100644 index 00000000000..78b53c34ab0 --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/services/StoreService.js @@ -0,0 +1,94 @@ +/* eslint-disable no-unused-vars */ +const Service = require('./Service'); + +class StoreService { + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * orderId String ID of the order that needs to be deleted + * no response value expected for this operation + **/ + static deleteOrder({ orderId }) { + return new Promise( + async (resolve) => { + try { + resolve(Service.successResponse('')); + } catch (e) { + resolve(Service.rejectResponse( + e.message || 'Invalid input', + e.status || 405, + )); + } + }, + ); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * + * returns Map + **/ + static getInventory() { + return new Promise( + async (resolve) => { + try { + resolve(Service.successResponse('')); + } catch (e) { + resolve(Service.rejectResponse( + e.message || 'Invalid input', + e.status || 405, + )); + } + }, + ); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * orderId Long ID of pet that needs to be fetched + * returns Order + **/ + static getOrderById({ orderId }) { + return new Promise( + async (resolve) => { + try { + resolve(Service.successResponse('')); + } catch (e) { + resolve(Service.rejectResponse( + e.message || 'Invalid input', + e.status || 405, + )); + } + }, + ); + } + + /** + * Place an order for a pet + * + * body Order order placed for purchasing the pet + * returns Order + **/ + static placeOrder({ body }) { + return new Promise( + async (resolve) => { + try { + resolve(Service.successResponse('')); + } catch (e) { + resolve(Service.rejectResponse( + e.message || 'Invalid input', + e.status || 405, + )); + } + }, + ); + } + +} + +module.exports = StoreService; diff --git a/samples/server/petstore/nodejs-express-server/services/UserService.js b/samples/server/petstore/nodejs-express-server/services/UserService.js new file mode 100644 index 00000000000..49028d6e921 --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/services/UserService.js @@ -0,0 +1,180 @@ +/* eslint-disable no-unused-vars */ +const Service = require('./Service'); + +class UserService { + + /** + * Create user + * This can only be done by the logged in user. + * + * body User Created user object + * no response value expected for this operation + **/ + static createUser({ body }) { + return new Promise( + async (resolve) => { + try { + resolve(Service.successResponse('')); + } catch (e) { + resolve(Service.rejectResponse( + e.message || 'Invalid input', + e.status || 405, + )); + } + }, + ); + } + + /** + * Creates list of users with given input array + * + * body List List of user object + * no response value expected for this operation + **/ + static createUsersWithArrayInput({ body }) { + return new Promise( + async (resolve) => { + try { + resolve(Service.successResponse('')); + } catch (e) { + resolve(Service.rejectResponse( + e.message || 'Invalid input', + e.status || 405, + )); + } + }, + ); + } + + /** + * Creates list of users with given input array + * + * body List List of user object + * no response value expected for this operation + **/ + static createUsersWithListInput({ body }) { + return new Promise( + async (resolve) => { + try { + resolve(Service.successResponse('')); + } catch (e) { + resolve(Service.rejectResponse( + e.message || 'Invalid input', + e.status || 405, + )); + } + }, + ); + } + + /** + * Delete user + * This can only be done by the logged in user. + * + * username String The name that needs to be deleted + * no response value expected for this operation + **/ + static deleteUser({ username }) { + return new Promise( + async (resolve) => { + try { + resolve(Service.successResponse('')); + } catch (e) { + resolve(Service.rejectResponse( + e.message || 'Invalid input', + e.status || 405, + )); + } + }, + ); + } + + /** + * Get user by user name + * + * username String The name that needs to be fetched. Use user1 for testing. + * returns User + **/ + static getUserByName({ username }) { + return new Promise( + async (resolve) => { + try { + resolve(Service.successResponse('')); + } catch (e) { + resolve(Service.rejectResponse( + e.message || 'Invalid input', + e.status || 405, + )); + } + }, + ); + } + + /** + * Logs user into the system + * + * username String The user name for login + * password String The password for login in clear text + * returns String + **/ + static loginUser({ username, password }) { + return new Promise( + async (resolve) => { + try { + resolve(Service.successResponse('')); + } catch (e) { + resolve(Service.rejectResponse( + e.message || 'Invalid input', + e.status || 405, + )); + } + }, + ); + } + + /** + * Logs out current logged in user session + * + * no response value expected for this operation + **/ + static logoutUser() { + return new Promise( + async (resolve) => { + try { + resolve(Service.successResponse('')); + } catch (e) { + resolve(Service.rejectResponse( + e.message || 'Invalid input', + e.status || 405, + )); + } + }, + ); + } + + /** + * Updated user + * This can only be done by the logged in user. + * + * username String name that need to be deleted + * body User Updated user object + * no response value expected for this operation + **/ + static updateUser({ username, body }) { + return new Promise( + async (resolve) => { + try { + resolve(Service.successResponse('')); + } catch (e) { + resolve(Service.rejectResponse( + e.message || 'Invalid input', + e.status || 405, + )); + } + }, + ); + } + +} + +module.exports = UserService; diff --git a/samples/server/petstore/nodejs-express-server/services/index.js b/samples/server/petstore/nodejs-express-server/services/index.js new file mode 100644 index 00000000000..bdf3c87fb74 --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/services/index.js @@ -0,0 +1,9 @@ +const PetService = require('./PetService'); +const StoreService = require('./StoreService'); +const UserService = require('./UserService'); + +module.exports = { + PetService, + StoreService, + UserService, +}; diff --git a/samples/server/petstore/nodejs-express-server/tests/additionalEndpointsTests.js b/samples/server/petstore/nodejs-express-server/tests/additionalEndpointsTests.js new file mode 100644 index 00000000000..b795af84220 --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/tests/additionalEndpointsTests.js @@ -0,0 +1,46 @@ +const { + describe, before, after, it, +} = require('mocha'); +const assert = require('assert').strict; +const chai = require('chai'); +const chaiAsPromised = require('chai-as-promised'); +const axios = require('axios'); +const logger = require('./logger'); +const config = require('./config'); +const ExpressServer = require('../expressServer'); + +const app = new ExpressServer(config.URL_PORT, config.OPENAPI_YAML); +chai.use(chaiAsPromised); +chai.should(); + +describe('Test endpoints that are not part of the openapi.yaml.', () => { + before(async () => { + try { + await app.launch(); + logger.info('express server launched\n'); + } catch (error) { + logger.info(error); + await app.close(); + throw (error); + } + }); + + after(async () => { + await app.close() + .catch(error => logger.error(error)); + logger.error('express server closed'); + }); + + + it('should confirm that requesting the openapi.yaml returns a successful 200 response', async () => { + const pathToCall = `${config.URL_PATH}:${config.URL_PORT}/spec/openapi.yaml`; + try { + const openapiResponse = await axios.get(pathToCall); + openapiResponse.should.have.property('status'); + openapiResponse.status.should.equal(200); + } catch (e) { + logger.error(`failed to call ${pathToCall}`); + assert.fail(`Failed to call openapi.yaml - ${e.message}`); + } + }); +}); diff --git a/samples/server/petstore/nodejs-express-server/tests/config.js b/samples/server/petstore/nodejs-express-server/tests/config.js new file mode 100644 index 00000000000..da4aa1b829f --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/tests/config.js @@ -0,0 +1,12 @@ +const path = require('path'); + +const config = { + ROOT_DIR: path.join(__dirname, '../'), + URL_PORT: 3009, + URL_PATH: 'http://localhost', + BASE_VERSION: 'v2', +}; +config.OPENAPI_YAML = path.join(config.ROOT_DIR, 'api', 'openapi.yaml'); +config.FULL_PATH = `${config.URL_PATH}:${config.URL_PORT}/${config.BASE_VERSION}`; + +module.exports = config; diff --git a/samples/server/petstore/nodejs-express-server/tests/logger.js b/samples/server/petstore/nodejs-express-server/tests/logger.js new file mode 100644 index 00000000000..b6e22aad9f4 --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/tests/logger.js @@ -0,0 +1,14 @@ +const winston = require('winston'); + +const logger = winston.createLogger({ + level: 'info', + format: winston.format.json(), + defaultMeta: { service: 'test-service' }, + transports: [ + new winston.transports.File({ filename: 'error.log', level: 'error' }), + new winston.transports.File({ filename: 'combined.log' }), + new winston.transports.Console({ format: winston.format.simple() }), + ], +}); + +module.exports = logger; diff --git a/samples/server/petstore/nodejs-express-server/tests/routingTests.js b/samples/server/petstore/nodejs-express-server/tests/routingTests.js new file mode 100644 index 00000000000..765a8ee93d9 --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/tests/routingTests.js @@ -0,0 +1,147 @@ +/** + * The purpose of these tests is to confirm that every path in the openapi spec, if built properly, + * returns a valid 200, with a simple text response. + * The codeGen will generate a response string including the name of the operation that was called. + * These tests confirm that the codeGen worked as expected. + * Once we start adding our own business logic, these + * tests will fail. It is recommended to keep these tests updated with the code changes. + */ +const { + describe, before, after, it, +} = require('mocha'); +const assert = require('assert').strict; +const chai = require('chai'); +const chaiAsPromised = require('chai-as-promised'); +const axios = require('axios'); +const yamljs = require('yamljs'); +const openApiSampler = require('openapi-sampler'); +const jstoxml = require('jstoxml'); +const logger = require('./logger'); +const config = require('./config'); +const ExpressServer = require('../expressServer'); + +const app = new ExpressServer(config.URL_PORT, config.OPENAPI_YAML); +chai.use(chaiAsPromised); +chai.should(); + + +const pathPrefix = `${config.URL_PATH}:${config.URL_PORT}/api/v2`; +const spec = yamljs.load(config.OPENAPI_YAML); + +const parseParameters = (originalPath, schemaParameters) => { + let path = originalPath; + const headers = {}; + const queryParams = []; + schemaParameters.forEach((parameter) => { + const parameterValue = parameter.example || openApiSampler.sample(parameter.schema); + switch (parameter.in) { + case 'header': + headers[parameter.name] = parameterValue; + break; + case 'path': + path = path.replace(`{${parameter.name}}`, parameterValue); + break; + case 'query': + queryParams.push(`${parameter.name}=${parameterValue}`); + break; + default: + break; + } + }); + return { path, headers, queryString: queryParams.join('&') }; +}; + +const buildRequestObject = (pathEndpoint, method, operationObject, requestsArray) => { + logger.info(`method: ${method}`); + let headers = {}; + let requestBody = {}; + let queryString = ''; + let path = pathEndpoint; + if (operationObject.parameters !== undefined) { + logger.info('this is a request with parameters'); + ({ path, headers, queryString } = parseParameters(pathEndpoint, operationObject.parameters)); + if (queryString.length > 0) { + path += `?${queryString}`; + } + Object.entries(headers).forEach(([headerName, headerValue]) => { + headers[headerName] = headerValue; + }); + } + if (operationObject.requestBody !== undefined) { + logger.info('This is a request with a body'); + const content = Object.entries(operationObject.requestBody.content); + content.forEach(([contentType, contentObject]) => { + requestBody = openApiSampler.sample(contentObject.schema, {}, spec); + let requestXML; + if (contentType === 'application/xml') { + requestXML = jstoxml.toXML(requestBody); + } + headers['Content-Type'] = contentType; + requestsArray.push({ + method, + path, + body: requestXML || requestBody, + headers, + }); + }); + } else { + requestsArray.push({ + method, + path, + headers, + }); + } +}; + +const getApiRequestsData = (apiSchema) => { + const requestsArray = []; + Object.entries(apiSchema.paths).forEach(([pathEndpoint, pathObject]) => { + logger.info(`adding path: ${pathPrefix}${pathEndpoint} to testing array`); + Object.entries(pathObject).forEach(([operationMethod, operationObject]) => { + buildRequestObject(pathEndpoint, operationMethod, operationObject, requestsArray); + }); + }); + return requestsArray; +}; + +describe('API tests, checking that the codegen generated code that allows all paths specified in schema to work', () => { + before(async () => { + try { + await app.launch(); + logger.info('express server launched\n'); + } catch (error) { + logger.info(error); + await app.close(); + throw (error); + } + }); + + after(async () => { + await app.close() + .catch(error => logger.error(error)); + logger.error('express server closed'); + }); + + const requestsArray = getApiRequestsData(spec); + requestsArray.forEach((requestObject) => { + it(`should run ${requestObject.method.toUpperCase()} request to ${requestObject.path} and return healthy 200`, async () => { + try { + const { + method, path, body, headers, + } = requestObject; + const url = `${pathPrefix}${path}`; + logger.info(`testing ${method.toUpperCase()} call to ${url}. encoding: ${headers['Content-Type']}`); + const response = await axios({ + method, + url, + data: body, + headers, + }); + response.should.have.property('status'); + response.status.should.equal(200); + } catch (e) { + assert.fail(e.message); + } + }); + }); +}); diff --git a/samples/server/petstore/nodejs-express-server/tests/serverTests.js b/samples/server/petstore/nodejs-express-server/tests/serverTests.js new file mode 100644 index 00000000000..035f3133430 --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/tests/serverTests.js @@ -0,0 +1,57 @@ +const { + describe, before, after, it, +} = require('mocha'); +const chai = require('chai'); +const chaiAsPromised = require('chai-as-promised'); +const { get } = require('axios'); + +const logger = require('./logger'); +const config = require('./config'); +const ExpressServer = require('../expressServer'); + +const app = new ExpressServer(config.URL_PORT, config.OPENAPI_YAML); +chai.use(chaiAsPromised); +chai.should(); + +describe('Server tests, checking launch, terminate, and various error messages', () => { + before(async () => { + try { + await app.launch(); + logger.info('express server launched\n'); + } catch (error) { + logger.info(error); + await app.close(); + throw (error); + } + }); + + after(async () => { + await app.close() + .catch(error => logger.error(error)); + logger.error('express server closed'); + }); + + it('should launch express server successfully', async () => { + const indexResponse = await get(`${config.URL_PATH}:${config.URL_PORT}/`); + indexResponse.status.should.equal(200, 'Expecting a call to root directory of server to return 200 code'); + }); + + it('should fail with a 404 on non-existing page', async () => { + get(`${config.FULL_PATH}/someRandomPage`) + .then(response => response.status.should.equal(404, 'expecting a 404 on a non-existing page request')) + .catch((responseError) => { + responseError.response.status.should.not.equal(undefined); + responseError.response.status.should.equal(404, 'expecting to receive a 404 on requesting a non-existing page'); + }); + }); + + it('should load api-doc', async () => { + try { + const response = await get(`http://localhost:${config.URL_PORT}/api-docs`); + response.status.should.equal(200, 'Expecting 200'); + } catch (e) { + console.log(e.message); + throw e; + } + }); +}); diff --git a/samples/server/petstore/nodejs-express-server/tests/testModels.js b/samples/server/petstore/nodejs-express-server/tests/testModels.js new file mode 100644 index 00000000000..8a3724e5070 --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/tests/testModels.js @@ -0,0 +1,29 @@ +const { + describe, it, +} = require('mocha'); +const chai = require('chai'); +const chaiAsPromised = require('chai-as-promised'); +const Pet = require('../models/Pet'); +const logger = require('./logger'); + +chai.use(chaiAsPromised); +chai.should(); + +describe('Model tests, checking that they are created correctly, and throw the expected message when not', () => { + it('Should create a model for Pet, according to openapi.yaml definition, and throw errors if fails', + async () => { + const photoUrls = ['petPhoto1.jpg', 'petPhoto2.jpg', 'petPhoto3.jpg']; + const name = 'petName'; + const id = 0; + const category = { id: 1, name: 'categoryName' }; + const tags = [{ id: 2, name: 'tagName1' }, { id: 3, name: 'tagName2' }]; + const status = 'available'; + const pet = new Pet(photoUrls, name, id, tags, status, category); + pet.id.should.equal(id); + pet.name.should.equal(name); + pet.category.id.should.equal(category.id); + pet.category.name.should.equal(category.name); + pet.tags.length.should.equal(tags.length); + pet.status.should.equal(status); + }); +}); diff --git a/samples/server/petstore/nodejs-express-server/utils/openapiRouter.js b/samples/server/petstore/nodejs-express-server/utils/openapiRouter.js new file mode 100644 index 00000000000..1a77fec7b61 --- /dev/null +++ b/samples/server/petstore/nodejs-express-server/utils/openapiRouter.js @@ -0,0 +1,67 @@ +const logger = require('../logger'); +const controllers = require('../controllers'); +const Services = require('../services'); + +function handleError(err, request, response, next) { + logger.error(err); + const code = err.code || 400; + response.status(code); + response.error = err; + next(JSON.stringify({ + code, + error: err, + })); +} + +/** + * The purpose of this route is to collect the request variables as defined in the + * OpenAPI document and pass them to the handling controller as another Express + * middleware. All parameters are collected in the requet.swagger.values key-value object + * + * The assumption is that security handlers have already verified and allowed access + * to this path. If the business-logic of a particular path is dependant on authentication + * parameters (e.g. scope checking) - it is recommended to define the authentication header + * as one of the parameters expected in the OpenAPI/Swagger document. + * + * Requests made to paths that are not in the OpernAPI scope + * are passed on to the next middleware handler. + * @returns {Function} + */ +function openApiRouter() { + return async (request, response, next) => { + try { + /** + * This middleware runs after a previous process have applied an openapi object + * to the request. + * If none was applied This is because the path requested is not in the schema. + * If there's no openapi object, we have nothing to do, and pass on to next middleware. + */ + if (request.openapi === undefined + || request.openapi.schema === undefined + ) { + next(); + return; + } + // request.swagger.paramValues = {}; + // request.swagger.params.forEach((param) => { + // request.swagger.paramValues[param.name] = getValueFromRequest(request, param); + // }); + const controllerName = request.openapi.schema['x-openapi-router-controller']; + const serviceName = request.openapi.schema['x-openapi-router-service']; + if (!controllers[controllerName] || controllers[controllerName] === undefined) { + handleError(`request sent to controller '${controllerName}' which has not been defined`, + request, response, next); + } else { + const apiController = new controllers[controllerName](Services[serviceName]); + const controllerOperation = request.openapi.schema.operationId; + await apiController[controllerOperation](request, response, next); + } + } catch (error) { + console.error(error); + const err = { code: 500, error: error.message }; + handleError(err, request, response, next); + } + }; +} + +module.exports = openApiRouter; From 65c7c1b39b5ee92bc4865a86d6816cf4f0461674 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 9 Aug 2019 01:32:50 +0800 Subject: [PATCH 68/75] restore openapi3 petstore.yaml (#3590) --- .../openapi-generator/src/test/resources/3_0/petstore.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore.yaml index 5cddb68050e..c424e27cd39 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore.yaml @@ -115,13 +115,6 @@ paths: type: array items: type: string - - name: maxCount - in: query - description: Maximum number of items to return - required: false - schema: - type: integer - format: int32 responses: '200': description: successful operation From 1ab7b9ceb686d0c600581a08aca6af03bbef81be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bresson?= Date: Fri, 9 Aug 2019 05:01:23 +0200 Subject: [PATCH 69/75] [java][client][jax-rs] Add a constant for Jackson @JsonProperty (#3560) --- .../src/main/resources/Java/pojo.mustache | 3 +- .../main/resources/JavaJaxRS/pojo.mustache | 6 +- .../model/AdditionalPropertiesAnyType.java | 3 +- .../model/AdditionalPropertiesArray.java | 3 +- .../model/AdditionalPropertiesBoolean.java | 3 +- .../model/AdditionalPropertiesClass.java | 33 ++++--- .../model/AdditionalPropertiesInteger.java | 3 +- .../model/AdditionalPropertiesNumber.java | 3 +- .../model/AdditionalPropertiesObject.java | 3 +- .../model/AdditionalPropertiesString.java | 3 +- .../org/openapitools/client/model/Animal.java | 6 +- .../model/ArrayOfArrayOfNumberOnly.java | 3 +- .../client/model/ArrayOfNumberOnly.java | 3 +- .../openapitools/client/model/ArrayTest.java | 9 +- .../client/model/Capitalization.java | 18 ++-- .../org/openapitools/client/model/Cat.java | 3 +- .../openapitools/client/model/CatAllOf.java | 3 +- .../openapitools/client/model/Category.java | 6 +- .../openapitools/client/model/ClassModel.java | 3 +- .../org/openapitools/client/model/Client.java | 3 +- .../org/openapitools/client/model/Dog.java | 3 +- .../openapitools/client/model/DogAllOf.java | 3 +- .../openapitools/client/model/EnumArrays.java | 6 +- .../openapitools/client/model/EnumTest.java | 15 ++-- .../client/model/FileSchemaTestClass.java | 6 +- .../openapitools/client/model/FormatTest.java | 39 ++++++--- .../client/model/HasOnlyReadOnly.java | 6 +- .../openapitools/client/model/MapTest.java | 12 ++- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../client/model/Model200Response.java | 6 +- .../client/model/ModelApiResponse.java | 9 +- .../client/model/ModelReturn.java | 3 +- .../org/openapitools/client/model/Name.java | 12 ++- .../openapitools/client/model/NumberOnly.java | 3 +- .../org/openapitools/client/model/Order.java | 18 ++-- .../client/model/OuterComposite.java | 9 +- .../org/openapitools/client/model/Pet.java | 18 ++-- .../client/model/ReadOnlyFirst.java | 6 +- .../client/model/SpecialModelName.java | 3 +- .../org/openapitools/client/model/Tag.java | 6 +- .../client/model/TypeHolderDefault.java | 15 ++-- .../client/model/TypeHolderExample.java | 15 ++-- .../org/openapitools/client/model/User.java | 24 +++-- .../openapitools/client/model/XmlItem.java | 87 ++++++++++++------- .../model/AdditionalPropertiesAnyType.java | 3 +- .../model/AdditionalPropertiesArray.java | 3 +- .../model/AdditionalPropertiesBoolean.java | 3 +- .../model/AdditionalPropertiesClass.java | 33 ++++--- .../model/AdditionalPropertiesInteger.java | 3 +- .../model/AdditionalPropertiesNumber.java | 3 +- .../model/AdditionalPropertiesObject.java | 3 +- .../model/AdditionalPropertiesString.java | 3 +- .../org/openapitools/client/model/Animal.java | 6 +- .../model/ArrayOfArrayOfNumberOnly.java | 3 +- .../client/model/ArrayOfNumberOnly.java | 3 +- .../openapitools/client/model/ArrayTest.java | 9 +- .../client/model/Capitalization.java | 18 ++-- .../org/openapitools/client/model/Cat.java | 3 +- .../openapitools/client/model/CatAllOf.java | 3 +- .../openapitools/client/model/Category.java | 6 +- .../openapitools/client/model/ClassModel.java | 3 +- .../org/openapitools/client/model/Client.java | 3 +- .../org/openapitools/client/model/Dog.java | 3 +- .../openapitools/client/model/DogAllOf.java | 3 +- .../openapitools/client/model/EnumArrays.java | 6 +- .../openapitools/client/model/EnumTest.java | 15 ++-- .../client/model/FileSchemaTestClass.java | 6 +- .../openapitools/client/model/FormatTest.java | 39 ++++++--- .../client/model/HasOnlyReadOnly.java | 6 +- .../openapitools/client/model/MapTest.java | 12 ++- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../client/model/Model200Response.java | 6 +- .../client/model/ModelApiResponse.java | 9 +- .../client/model/ModelReturn.java | 3 +- .../org/openapitools/client/model/Name.java | 12 ++- .../openapitools/client/model/NumberOnly.java | 3 +- .../org/openapitools/client/model/Order.java | 18 ++-- .../client/model/OuterComposite.java | 9 +- .../org/openapitools/client/model/Pet.java | 18 ++-- .../client/model/ReadOnlyFirst.java | 6 +- .../client/model/SpecialModelName.java | 3 +- .../org/openapitools/client/model/Tag.java | 6 +- .../client/model/TypeHolderDefault.java | 15 ++-- .../client/model/TypeHolderExample.java | 15 ++-- .../org/openapitools/client/model/User.java | 24 +++-- .../openapitools/client/model/XmlItem.java | 87 ++++++++++++------- .../model/AdditionalPropertiesAnyType.java | 3 +- .../model/AdditionalPropertiesArray.java | 3 +- .../model/AdditionalPropertiesBoolean.java | 3 +- .../model/AdditionalPropertiesClass.java | 33 ++++--- .../model/AdditionalPropertiesInteger.java | 3 +- .../model/AdditionalPropertiesNumber.java | 3 +- .../model/AdditionalPropertiesObject.java | 3 +- .../model/AdditionalPropertiesString.java | 3 +- .../org/openapitools/client/model/Animal.java | 6 +- .../model/ArrayOfArrayOfNumberOnly.java | 3 +- .../client/model/ArrayOfNumberOnly.java | 3 +- .../openapitools/client/model/ArrayTest.java | 9 +- .../client/model/Capitalization.java | 18 ++-- .../org/openapitools/client/model/Cat.java | 3 +- .../openapitools/client/model/CatAllOf.java | 3 +- .../openapitools/client/model/Category.java | 6 +- .../openapitools/client/model/ClassModel.java | 3 +- .../org/openapitools/client/model/Client.java | 3 +- .../org/openapitools/client/model/Dog.java | 3 +- .../openapitools/client/model/DogAllOf.java | 3 +- .../openapitools/client/model/EnumArrays.java | 6 +- .../openapitools/client/model/EnumTest.java | 15 ++-- .../client/model/FileSchemaTestClass.java | 6 +- .../openapitools/client/model/FormatTest.java | 39 ++++++--- .../client/model/HasOnlyReadOnly.java | 6 +- .../openapitools/client/model/MapTest.java | 12 ++- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../client/model/Model200Response.java | 6 +- .../client/model/ModelApiResponse.java | 9 +- .../client/model/ModelReturn.java | 3 +- .../org/openapitools/client/model/Name.java | 12 ++- .../openapitools/client/model/NumberOnly.java | 3 +- .../org/openapitools/client/model/Order.java | 18 ++-- .../client/model/OuterComposite.java | 9 +- .../org/openapitools/client/model/Pet.java | 18 ++-- .../client/model/ReadOnlyFirst.java | 6 +- .../client/model/SpecialModelName.java | 3 +- .../org/openapitools/client/model/Tag.java | 6 +- .../client/model/TypeHolderDefault.java | 15 ++-- .../client/model/TypeHolderExample.java | 15 ++-- .../org/openapitools/client/model/User.java | 24 +++-- .../openapitools/client/model/XmlItem.java | 87 ++++++++++++------- .../model/AdditionalPropertiesAnyType.java | 3 +- .../model/AdditionalPropertiesArray.java | 3 +- .../model/AdditionalPropertiesBoolean.java | 3 +- .../model/AdditionalPropertiesClass.java | 33 ++++--- .../model/AdditionalPropertiesInteger.java | 3 +- .../model/AdditionalPropertiesNumber.java | 3 +- .../model/AdditionalPropertiesObject.java | 3 +- .../model/AdditionalPropertiesString.java | 3 +- .../org/openapitools/client/model/Animal.java | 6 +- .../model/ArrayOfArrayOfNumberOnly.java | 3 +- .../client/model/ArrayOfNumberOnly.java | 3 +- .../openapitools/client/model/ArrayTest.java | 9 +- .../client/model/Capitalization.java | 18 ++-- .../org/openapitools/client/model/Cat.java | 3 +- .../openapitools/client/model/CatAllOf.java | 3 +- .../openapitools/client/model/Category.java | 6 +- .../openapitools/client/model/ClassModel.java | 3 +- .../org/openapitools/client/model/Client.java | 3 +- .../org/openapitools/client/model/Dog.java | 3 +- .../openapitools/client/model/DogAllOf.java | 3 +- .../openapitools/client/model/EnumArrays.java | 6 +- .../openapitools/client/model/EnumTest.java | 15 ++-- .../client/model/FileSchemaTestClass.java | 6 +- .../openapitools/client/model/FormatTest.java | 39 ++++++--- .../client/model/HasOnlyReadOnly.java | 6 +- .../openapitools/client/model/MapTest.java | 12 ++- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../client/model/Model200Response.java | 6 +- .../client/model/ModelApiResponse.java | 9 +- .../client/model/ModelReturn.java | 3 +- .../org/openapitools/client/model/Name.java | 12 ++- .../openapitools/client/model/NumberOnly.java | 3 +- .../org/openapitools/client/model/Order.java | 18 ++-- .../client/model/OuterComposite.java | 9 +- .../org/openapitools/client/model/Pet.java | 18 ++-- .../client/model/ReadOnlyFirst.java | 6 +- .../client/model/SpecialModelName.java | 3 +- .../org/openapitools/client/model/Tag.java | 6 +- .../client/model/TypeHolderDefault.java | 15 ++-- .../client/model/TypeHolderExample.java | 15 ++-- .../org/openapitools/client/model/User.java | 24 +++-- .../openapitools/client/model/XmlItem.java | 87 ++++++++++++------- .../model/AdditionalPropertiesAnyType.java | 3 +- .../model/AdditionalPropertiesArray.java | 3 +- .../model/AdditionalPropertiesBoolean.java | 3 +- .../model/AdditionalPropertiesClass.java | 33 ++++--- .../model/AdditionalPropertiesInteger.java | 3 +- .../model/AdditionalPropertiesNumber.java | 3 +- .../model/AdditionalPropertiesObject.java | 3 +- .../model/AdditionalPropertiesString.java | 3 +- .../org/openapitools/client/model/Animal.java | 6 +- .../model/ArrayOfArrayOfNumberOnly.java | 3 +- .../client/model/ArrayOfNumberOnly.java | 3 +- .../openapitools/client/model/ArrayTest.java | 9 +- .../client/model/Capitalization.java | 18 ++-- .../org/openapitools/client/model/Cat.java | 3 +- .../openapitools/client/model/CatAllOf.java | 3 +- .../openapitools/client/model/Category.java | 6 +- .../openapitools/client/model/ClassModel.java | 3 +- .../org/openapitools/client/model/Client.java | 3 +- .../org/openapitools/client/model/Dog.java | 3 +- .../openapitools/client/model/DogAllOf.java | 3 +- .../openapitools/client/model/EnumArrays.java | 6 +- .../openapitools/client/model/EnumTest.java | 15 ++-- .../client/model/FileSchemaTestClass.java | 6 +- .../openapitools/client/model/FormatTest.java | 39 ++++++--- .../client/model/HasOnlyReadOnly.java | 6 +- .../openapitools/client/model/MapTest.java | 12 ++- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../client/model/Model200Response.java | 6 +- .../client/model/ModelApiResponse.java | 9 +- .../client/model/ModelReturn.java | 3 +- .../org/openapitools/client/model/Name.java | 12 ++- .../openapitools/client/model/NumberOnly.java | 3 +- .../org/openapitools/client/model/Order.java | 18 ++-- .../client/model/OuterComposite.java | 9 +- .../org/openapitools/client/model/Pet.java | 18 ++-- .../client/model/ReadOnlyFirst.java | 6 +- .../client/model/SpecialModelName.java | 3 +- .../org/openapitools/client/model/Tag.java | 6 +- .../client/model/TypeHolderDefault.java | 15 ++-- .../client/model/TypeHolderExample.java | 15 ++-- .../org/openapitools/client/model/User.java | 24 +++-- .../openapitools/client/model/XmlItem.java | 87 ++++++++++++------- .../model/AdditionalPropertiesAnyType.java | 3 +- .../model/AdditionalPropertiesArray.java | 3 +- .../model/AdditionalPropertiesBoolean.java | 3 +- .../model/AdditionalPropertiesClass.java | 33 ++++--- .../model/AdditionalPropertiesInteger.java | 3 +- .../model/AdditionalPropertiesNumber.java | 3 +- .../model/AdditionalPropertiesObject.java | 3 +- .../model/AdditionalPropertiesString.java | 3 +- .../org/openapitools/client/model/Animal.java | 6 +- .../model/ArrayOfArrayOfNumberOnly.java | 3 +- .../client/model/ArrayOfNumberOnly.java | 3 +- .../openapitools/client/model/ArrayTest.java | 9 +- .../client/model/Capitalization.java | 18 ++-- .../org/openapitools/client/model/Cat.java | 3 +- .../openapitools/client/model/CatAllOf.java | 3 +- .../openapitools/client/model/Category.java | 6 +- .../openapitools/client/model/ClassModel.java | 3 +- .../org/openapitools/client/model/Client.java | 3 +- .../org/openapitools/client/model/Dog.java | 3 +- .../openapitools/client/model/DogAllOf.java | 3 +- .../openapitools/client/model/EnumArrays.java | 6 +- .../openapitools/client/model/EnumTest.java | 15 ++-- .../client/model/FileSchemaTestClass.java | 6 +- .../openapitools/client/model/FormatTest.java | 39 ++++++--- .../client/model/HasOnlyReadOnly.java | 6 +- .../openapitools/client/model/MapTest.java | 12 ++- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../client/model/Model200Response.java | 6 +- .../client/model/ModelApiResponse.java | 9 +- .../client/model/ModelReturn.java | 3 +- .../org/openapitools/client/model/Name.java | 12 ++- .../openapitools/client/model/NumberOnly.java | 3 +- .../org/openapitools/client/model/Order.java | 18 ++-- .../client/model/OuterComposite.java | 9 +- .../org/openapitools/client/model/Pet.java | 18 ++-- .../client/model/ReadOnlyFirst.java | 6 +- .../client/model/SpecialModelName.java | 3 +- .../org/openapitools/client/model/Tag.java | 6 +- .../client/model/TypeHolderDefault.java | 15 ++-- .../client/model/TypeHolderExample.java | 15 ++-- .../org/openapitools/client/model/User.java | 24 +++-- .../openapitools/client/model/XmlItem.java | 87 ++++++++++++------- .../model/AdditionalPropertiesAnyType.java | 3 +- .../model/AdditionalPropertiesArray.java | 3 +- .../model/AdditionalPropertiesBoolean.java | 3 +- .../model/AdditionalPropertiesClass.java | 33 ++++--- .../model/AdditionalPropertiesInteger.java | 3 +- .../model/AdditionalPropertiesNumber.java | 3 +- .../model/AdditionalPropertiesObject.java | 3 +- .../model/AdditionalPropertiesString.java | 3 +- .../org/openapitools/client/model/Animal.java | 6 +- .../model/ArrayOfArrayOfNumberOnly.java | 3 +- .../client/model/ArrayOfNumberOnly.java | 3 +- .../openapitools/client/model/ArrayTest.java | 9 +- .../client/model/Capitalization.java | 18 ++-- .../org/openapitools/client/model/Cat.java | 3 +- .../openapitools/client/model/CatAllOf.java | 3 +- .../openapitools/client/model/Category.java | 6 +- .../openapitools/client/model/ClassModel.java | 3 +- .../org/openapitools/client/model/Client.java | 3 +- .../org/openapitools/client/model/Dog.java | 3 +- .../openapitools/client/model/DogAllOf.java | 3 +- .../openapitools/client/model/EnumArrays.java | 6 +- .../openapitools/client/model/EnumTest.java | 15 ++-- .../client/model/FileSchemaTestClass.java | 6 +- .../openapitools/client/model/FormatTest.java | 39 ++++++--- .../client/model/HasOnlyReadOnly.java | 6 +- .../openapitools/client/model/MapTest.java | 12 ++- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../client/model/Model200Response.java | 6 +- .../client/model/ModelApiResponse.java | 9 +- .../client/model/ModelReturn.java | 3 +- .../org/openapitools/client/model/Name.java | 12 ++- .../openapitools/client/model/NumberOnly.java | 3 +- .../org/openapitools/client/model/Order.java | 18 ++-- .../client/model/OuterComposite.java | 9 +- .../org/openapitools/client/model/Pet.java | 18 ++-- .../client/model/ReadOnlyFirst.java | 6 +- .../client/model/SpecialModelName.java | 3 +- .../org/openapitools/client/model/Tag.java | 6 +- .../client/model/TypeHolderDefault.java | 15 ++-- .../client/model/TypeHolderExample.java | 15 ++-- .../org/openapitools/client/model/User.java | 24 +++-- .../openapitools/client/model/XmlItem.java | 87 ++++++++++++------- .../model/AdditionalPropertiesAnyType.java | 3 +- .../model/AdditionalPropertiesArray.java | 3 +- .../model/AdditionalPropertiesBoolean.java | 3 +- .../model/AdditionalPropertiesClass.java | 33 ++++--- .../model/AdditionalPropertiesInteger.java | 3 +- .../model/AdditionalPropertiesNumber.java | 3 +- .../model/AdditionalPropertiesObject.java | 3 +- .../model/AdditionalPropertiesString.java | 3 +- .../org/openapitools/client/model/Animal.java | 6 +- .../model/ArrayOfArrayOfNumberOnly.java | 3 +- .../client/model/ArrayOfNumberOnly.java | 3 +- .../openapitools/client/model/ArrayTest.java | 9 +- .../client/model/Capitalization.java | 18 ++-- .../org/openapitools/client/model/Cat.java | 3 +- .../openapitools/client/model/CatAllOf.java | 3 +- .../openapitools/client/model/Category.java | 6 +- .../openapitools/client/model/ClassModel.java | 3 +- .../org/openapitools/client/model/Client.java | 3 +- .../org/openapitools/client/model/Dog.java | 3 +- .../openapitools/client/model/DogAllOf.java | 3 +- .../openapitools/client/model/EnumArrays.java | 6 +- .../openapitools/client/model/EnumTest.java | 15 ++-- .../client/model/FileSchemaTestClass.java | 6 +- .../openapitools/client/model/FormatTest.java | 39 ++++++--- .../client/model/HasOnlyReadOnly.java | 6 +- .../openapitools/client/model/MapTest.java | 12 ++- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../client/model/Model200Response.java | 6 +- .../client/model/ModelApiResponse.java | 9 +- .../client/model/ModelReturn.java | 3 +- .../org/openapitools/client/model/Name.java | 12 ++- .../openapitools/client/model/NumberOnly.java | 3 +- .../org/openapitools/client/model/Order.java | 18 ++-- .../client/model/OuterComposite.java | 9 +- .../org/openapitools/client/model/Pet.java | 18 ++-- .../client/model/ReadOnlyFirst.java | 6 +- .../client/model/SpecialModelName.java | 3 +- .../org/openapitools/client/model/Tag.java | 6 +- .../client/model/TypeHolderDefault.java | 15 ++-- .../client/model/TypeHolderExample.java | 15 ++-- .../org/openapitools/client/model/User.java | 24 +++-- .../openapitools/client/model/XmlItem.java | 87 ++++++++++++------- .../model/AdditionalPropertiesAnyType.java | 3 +- .../model/AdditionalPropertiesArray.java | 3 +- .../model/AdditionalPropertiesBoolean.java | 3 +- .../model/AdditionalPropertiesClass.java | 33 ++++--- .../model/AdditionalPropertiesInteger.java | 3 +- .../model/AdditionalPropertiesNumber.java | 3 +- .../model/AdditionalPropertiesObject.java | 3 +- .../model/AdditionalPropertiesString.java | 3 +- .../org/openapitools/client/model/Animal.java | 6 +- .../model/ArrayOfArrayOfNumberOnly.java | 3 +- .../client/model/ArrayOfNumberOnly.java | 3 +- .../openapitools/client/model/ArrayTest.java | 9 +- .../client/model/Capitalization.java | 18 ++-- .../org/openapitools/client/model/Cat.java | 3 +- .../openapitools/client/model/CatAllOf.java | 3 +- .../openapitools/client/model/Category.java | 6 +- .../openapitools/client/model/ClassModel.java | 3 +- .../org/openapitools/client/model/Client.java | 3 +- .../org/openapitools/client/model/Dog.java | 3 +- .../openapitools/client/model/DogAllOf.java | 3 +- .../openapitools/client/model/EnumArrays.java | 6 +- .../openapitools/client/model/EnumTest.java | 15 ++-- .../client/model/FileSchemaTestClass.java | 6 +- .../openapitools/client/model/FormatTest.java | 39 ++++++--- .../client/model/HasOnlyReadOnly.java | 6 +- .../openapitools/client/model/MapTest.java | 12 ++- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../client/model/Model200Response.java | 6 +- .../client/model/ModelApiResponse.java | 9 +- .../client/model/ModelReturn.java | 3 +- .../org/openapitools/client/model/Name.java | 12 ++- .../openapitools/client/model/NumberOnly.java | 3 +- .../org/openapitools/client/model/Order.java | 18 ++-- .../client/model/OuterComposite.java | 9 +- .../org/openapitools/client/model/Pet.java | 18 ++-- .../client/model/ReadOnlyFirst.java | 6 +- .../client/model/SpecialModelName.java | 3 +- .../org/openapitools/client/model/Tag.java | 6 +- .../client/model/TypeHolderDefault.java | 15 ++-- .../client/model/TypeHolderExample.java | 15 ++-- .../org/openapitools/client/model/User.java | 24 +++-- .../openapitools/client/model/XmlItem.java | 87 ++++++++++++------- .../model/AdditionalPropertiesAnyType.java | 3 +- .../model/AdditionalPropertiesArray.java | 3 +- .../model/AdditionalPropertiesBoolean.java | 3 +- .../model/AdditionalPropertiesClass.java | 33 ++++--- .../model/AdditionalPropertiesInteger.java | 3 +- .../model/AdditionalPropertiesNumber.java | 3 +- .../model/AdditionalPropertiesObject.java | 3 +- .../model/AdditionalPropertiesString.java | 3 +- .../org/openapitools/client/model/Animal.java | 6 +- .../model/ArrayOfArrayOfNumberOnly.java | 3 +- .../client/model/ArrayOfNumberOnly.java | 3 +- .../openapitools/client/model/ArrayTest.java | 9 +- .../client/model/Capitalization.java | 18 ++-- .../org/openapitools/client/model/Cat.java | 3 +- .../openapitools/client/model/CatAllOf.java | 3 +- .../openapitools/client/model/Category.java | 6 +- .../openapitools/client/model/ClassModel.java | 3 +- .../org/openapitools/client/model/Client.java | 3 +- .../org/openapitools/client/model/Dog.java | 3 +- .../openapitools/client/model/DogAllOf.java | 3 +- .../openapitools/client/model/EnumArrays.java | 6 +- .../openapitools/client/model/EnumTest.java | 15 ++-- .../client/model/FileSchemaTestClass.java | 6 +- .../openapitools/client/model/FormatTest.java | 39 ++++++--- .../client/model/HasOnlyReadOnly.java | 6 +- .../openapitools/client/model/MapTest.java | 12 ++- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../client/model/Model200Response.java | 6 +- .../client/model/ModelApiResponse.java | 9 +- .../client/model/ModelReturn.java | 3 +- .../org/openapitools/client/model/Name.java | 12 ++- .../openapitools/client/model/NumberOnly.java | 3 +- .../org/openapitools/client/model/Order.java | 18 ++-- .../client/model/OuterComposite.java | 9 +- .../org/openapitools/client/model/Pet.java | 18 ++-- .../client/model/ReadOnlyFirst.java | 6 +- .../client/model/SpecialModelName.java | 3 +- .../org/openapitools/client/model/Tag.java | 6 +- .../client/model/TypeHolderDefault.java | 15 ++-- .../client/model/TypeHolderExample.java | 15 ++-- .../org/openapitools/client/model/User.java | 24 +++-- .../openapitools/client/model/XmlItem.java | 87 ++++++++++++------- .../model/AdditionalPropertiesAnyType.java | 3 +- .../model/AdditionalPropertiesArray.java | 3 +- .../model/AdditionalPropertiesBoolean.java | 3 +- .../model/AdditionalPropertiesClass.java | 33 ++++--- .../model/AdditionalPropertiesInteger.java | 3 +- .../model/AdditionalPropertiesNumber.java | 3 +- .../model/AdditionalPropertiesObject.java | 3 +- .../model/AdditionalPropertiesString.java | 3 +- .../org/openapitools/client/model/Animal.java | 6 +- .../model/ArrayOfArrayOfNumberOnly.java | 3 +- .../client/model/ArrayOfNumberOnly.java | 3 +- .../openapitools/client/model/ArrayTest.java | 9 +- .../client/model/Capitalization.java | 18 ++-- .../org/openapitools/client/model/Cat.java | 3 +- .../openapitools/client/model/CatAllOf.java | 3 +- .../openapitools/client/model/Category.java | 6 +- .../openapitools/client/model/ClassModel.java | 3 +- .../org/openapitools/client/model/Client.java | 3 +- .../org/openapitools/client/model/Dog.java | 3 +- .../openapitools/client/model/DogAllOf.java | 3 +- .../openapitools/client/model/EnumArrays.java | 6 +- .../openapitools/client/model/EnumTest.java | 15 ++-- .../client/model/FileSchemaTestClass.java | 6 +- .../openapitools/client/model/FormatTest.java | 39 ++++++--- .../client/model/HasOnlyReadOnly.java | 6 +- .../openapitools/client/model/MapTest.java | 12 ++- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../client/model/Model200Response.java | 6 +- .../client/model/ModelApiResponse.java | 9 +- .../client/model/ModelReturn.java | 3 +- .../org/openapitools/client/model/Name.java | 12 ++- .../openapitools/client/model/NumberOnly.java | 3 +- .../org/openapitools/client/model/Order.java | 18 ++-- .../client/model/OuterComposite.java | 9 +- .../org/openapitools/client/model/Pet.java | 18 ++-- .../client/model/ReadOnlyFirst.java | 6 +- .../client/model/SpecialModelName.java | 3 +- .../org/openapitools/client/model/Tag.java | 6 +- .../client/model/TypeHolderDefault.java | 15 ++-- .../client/model/TypeHolderExample.java | 15 ++-- .../org/openapitools/client/model/User.java | 24 +++-- .../openapitools/client/model/XmlItem.java | 87 ++++++++++++------- .../model/AdditionalPropertiesAnyType.java | 3 +- .../model/AdditionalPropertiesArray.java | 3 +- .../model/AdditionalPropertiesBoolean.java | 3 +- .../model/AdditionalPropertiesClass.java | 33 ++++--- .../model/AdditionalPropertiesInteger.java | 3 +- .../model/AdditionalPropertiesNumber.java | 3 +- .../model/AdditionalPropertiesObject.java | 3 +- .../model/AdditionalPropertiesString.java | 3 +- .../org/openapitools/client/model/Animal.java | 6 +- .../model/ArrayOfArrayOfNumberOnly.java | 3 +- .../client/model/ArrayOfNumberOnly.java | 3 +- .../openapitools/client/model/ArrayTest.java | 9 +- .../client/model/Capitalization.java | 18 ++-- .../org/openapitools/client/model/Cat.java | 3 +- .../openapitools/client/model/CatAllOf.java | 3 +- .../openapitools/client/model/Category.java | 6 +- .../openapitools/client/model/ClassModel.java | 3 +- .../org/openapitools/client/model/Client.java | 3 +- .../org/openapitools/client/model/Dog.java | 3 +- .../openapitools/client/model/DogAllOf.java | 3 +- .../openapitools/client/model/EnumArrays.java | 6 +- .../openapitools/client/model/EnumTest.java | 15 ++-- .../client/model/FileSchemaTestClass.java | 6 +- .../openapitools/client/model/FormatTest.java | 39 ++++++--- .../client/model/HasOnlyReadOnly.java | 6 +- .../openapitools/client/model/MapTest.java | 12 ++- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../client/model/Model200Response.java | 6 +- .../client/model/ModelApiResponse.java | 9 +- .../client/model/ModelReturn.java | 3 +- .../org/openapitools/client/model/Name.java | 12 ++- .../openapitools/client/model/NumberOnly.java | 3 +- .../org/openapitools/client/model/Order.java | 18 ++-- .../client/model/OuterComposite.java | 9 +- .../org/openapitools/client/model/Pet.java | 18 ++-- .../client/model/ReadOnlyFirst.java | 6 +- .../client/model/SpecialModelName.java | 3 +- .../org/openapitools/client/model/Tag.java | 6 +- .../client/model/TypeHolderDefault.java | 15 ++-- .../client/model/TypeHolderExample.java | 15 ++-- .../org/openapitools/client/model/User.java | 24 +++-- .../openapitools/client/model/XmlItem.java | 87 ++++++++++++------- .../model/AdditionalPropertiesAnyType.java | 3 +- .../model/AdditionalPropertiesArray.java | 3 +- .../model/AdditionalPropertiesBoolean.java | 3 +- .../model/AdditionalPropertiesClass.java | 33 ++++--- .../model/AdditionalPropertiesInteger.java | 3 +- .../model/AdditionalPropertiesNumber.java | 3 +- .../model/AdditionalPropertiesObject.java | 3 +- .../model/AdditionalPropertiesString.java | 3 +- .../org/openapitools/client/model/Animal.java | 6 +- .../model/ArrayOfArrayOfNumberOnly.java | 3 +- .../client/model/ArrayOfNumberOnly.java | 3 +- .../openapitools/client/model/ArrayTest.java | 9 +- .../client/model/Capitalization.java | 18 ++-- .../org/openapitools/client/model/Cat.java | 3 +- .../openapitools/client/model/CatAllOf.java | 3 +- .../openapitools/client/model/Category.java | 6 +- .../openapitools/client/model/ClassModel.java | 3 +- .../org/openapitools/client/model/Client.java | 3 +- .../org/openapitools/client/model/Dog.java | 3 +- .../openapitools/client/model/DogAllOf.java | 3 +- .../openapitools/client/model/EnumArrays.java | 6 +- .../openapitools/client/model/EnumTest.java | 15 ++-- .../client/model/FileSchemaTestClass.java | 6 +- .../openapitools/client/model/FormatTest.java | 39 ++++++--- .../client/model/HasOnlyReadOnly.java | 6 +- .../openapitools/client/model/MapTest.java | 12 ++- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../client/model/Model200Response.java | 6 +- .../client/model/ModelApiResponse.java | 9 +- .../client/model/ModelReturn.java | 3 +- .../org/openapitools/client/model/Name.java | 12 ++- .../openapitools/client/model/NumberOnly.java | 3 +- .../org/openapitools/client/model/Order.java | 18 ++-- .../client/model/OuterComposite.java | 9 +- .../org/openapitools/client/model/Pet.java | 18 ++-- .../client/model/ReadOnlyFirst.java | 6 +- .../client/model/SpecialModelName.java | 3 +- .../org/openapitools/client/model/Tag.java | 6 +- .../client/model/TypeHolderDefault.java | 15 ++-- .../client/model/TypeHolderExample.java | 15 ++-- .../org/openapitools/client/model/User.java | 24 +++-- .../openapitools/client/model/XmlItem.java | 87 ++++++++++++------- .../model/AdditionalPropertiesAnyType.java | 3 +- .../model/AdditionalPropertiesArray.java | 3 +- .../model/AdditionalPropertiesBoolean.java | 3 +- .../model/AdditionalPropertiesClass.java | 33 ++++--- .../model/AdditionalPropertiesInteger.java | 3 +- .../model/AdditionalPropertiesNumber.java | 3 +- .../model/AdditionalPropertiesObject.java | 3 +- .../model/AdditionalPropertiesString.java | 3 +- .../org/openapitools/client/model/Animal.java | 6 +- .../model/ArrayOfArrayOfNumberOnly.java | 3 +- .../client/model/ArrayOfNumberOnly.java | 3 +- .../openapitools/client/model/ArrayTest.java | 9 +- .../client/model/Capitalization.java | 18 ++-- .../org/openapitools/client/model/Cat.java | 3 +- .../openapitools/client/model/CatAllOf.java | 3 +- .../openapitools/client/model/Category.java | 6 +- .../openapitools/client/model/ClassModel.java | 3 +- .../org/openapitools/client/model/Client.java | 3 +- .../org/openapitools/client/model/Dog.java | 3 +- .../openapitools/client/model/DogAllOf.java | 3 +- .../openapitools/client/model/EnumArrays.java | 6 +- .../openapitools/client/model/EnumTest.java | 15 ++-- .../client/model/FileSchemaTestClass.java | 6 +- .../openapitools/client/model/FormatTest.java | 39 ++++++--- .../client/model/HasOnlyReadOnly.java | 6 +- .../openapitools/client/model/MapTest.java | 12 ++- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../client/model/Model200Response.java | 6 +- .../client/model/ModelApiResponse.java | 9 +- .../client/model/ModelReturn.java | 3 +- .../org/openapitools/client/model/Name.java | 12 ++- .../openapitools/client/model/NumberOnly.java | 3 +- .../org/openapitools/client/model/Order.java | 18 ++-- .../client/model/OuterComposite.java | 9 +- .../org/openapitools/client/model/Pet.java | 18 ++-- .../client/model/ReadOnlyFirst.java | 6 +- .../client/model/SpecialModelName.java | 3 +- .../org/openapitools/client/model/Tag.java | 6 +- .../client/model/TypeHolderDefault.java | 15 ++-- .../client/model/TypeHolderExample.java | 15 ++-- .../org/openapitools/client/model/User.java | 24 +++-- .../openapitools/client/model/XmlItem.java | 87 ++++++++++++------- .../model/AdditionalPropertiesAnyType.java | 3 +- .../model/AdditionalPropertiesArray.java | 3 +- .../model/AdditionalPropertiesBoolean.java | 3 +- .../model/AdditionalPropertiesClass.java | 33 ++++--- .../model/AdditionalPropertiesInteger.java | 3 +- .../model/AdditionalPropertiesNumber.java | 3 +- .../model/AdditionalPropertiesObject.java | 3 +- .../model/AdditionalPropertiesString.java | 3 +- .../org/openapitools/client/model/Animal.java | 6 +- .../model/ArrayOfArrayOfNumberOnly.java | 3 +- .../client/model/ArrayOfNumberOnly.java | 3 +- .../openapitools/client/model/ArrayTest.java | 9 +- .../client/model/Capitalization.java | 18 ++-- .../org/openapitools/client/model/Cat.java | 3 +- .../openapitools/client/model/CatAllOf.java | 3 +- .../openapitools/client/model/Category.java | 6 +- .../openapitools/client/model/ClassModel.java | 3 +- .../org/openapitools/client/model/Client.java | 3 +- .../org/openapitools/client/model/Dog.java | 3 +- .../openapitools/client/model/DogAllOf.java | 3 +- .../openapitools/client/model/EnumArrays.java | 6 +- .../openapitools/client/model/EnumTest.java | 15 ++-- .../client/model/FileSchemaTestClass.java | 6 +- .../openapitools/client/model/FormatTest.java | 39 ++++++--- .../client/model/HasOnlyReadOnly.java | 6 +- .../openapitools/client/model/MapTest.java | 12 ++- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../client/model/Model200Response.java | 6 +- .../client/model/ModelApiResponse.java | 9 +- .../client/model/ModelReturn.java | 3 +- .../org/openapitools/client/model/Name.java | 12 ++- .../openapitools/client/model/NumberOnly.java | 3 +- .../org/openapitools/client/model/Order.java | 18 ++-- .../client/model/OuterComposite.java | 9 +- .../org/openapitools/client/model/Pet.java | 18 ++-- .../client/model/ReadOnlyFirst.java | 6 +- .../client/model/SpecialModelName.java | 3 +- .../org/openapitools/client/model/Tag.java | 6 +- .../client/model/TypeHolderDefault.java | 15 ++-- .../client/model/TypeHolderExample.java | 15 ++-- .../org/openapitools/client/model/User.java | 24 +++-- .../openapitools/client/model/XmlItem.java | 87 ++++++++++++------- .../model/AdditionalPropertiesAnyType.java | 3 +- .../model/AdditionalPropertiesArray.java | 3 +- .../model/AdditionalPropertiesBoolean.java | 3 +- .../model/AdditionalPropertiesClass.java | 33 ++++--- .../model/AdditionalPropertiesInteger.java | 3 +- .../model/AdditionalPropertiesNumber.java | 3 +- .../model/AdditionalPropertiesObject.java | 3 +- .../model/AdditionalPropertiesString.java | 3 +- .../org/openapitools/client/model/Animal.java | 6 +- .../model/ArrayOfArrayOfNumberOnly.java | 3 +- .../client/model/ArrayOfNumberOnly.java | 3 +- .../openapitools/client/model/ArrayTest.java | 9 +- .../client/model/Capitalization.java | 18 ++-- .../org/openapitools/client/model/Cat.java | 3 +- .../openapitools/client/model/CatAllOf.java | 3 +- .../openapitools/client/model/Category.java | 6 +- .../openapitools/client/model/ClassModel.java | 3 +- .../org/openapitools/client/model/Client.java | 3 +- .../org/openapitools/client/model/Dog.java | 3 +- .../openapitools/client/model/DogAllOf.java | 3 +- .../openapitools/client/model/EnumArrays.java | 6 +- .../openapitools/client/model/EnumTest.java | 15 ++-- .../client/model/FileSchemaTestClass.java | 6 +- .../openapitools/client/model/FormatTest.java | 39 ++++++--- .../client/model/HasOnlyReadOnly.java | 6 +- .../openapitools/client/model/MapTest.java | 12 ++- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../client/model/Model200Response.java | 6 +- .../client/model/ModelApiResponse.java | 9 +- .../client/model/ModelReturn.java | 3 +- .../org/openapitools/client/model/Name.java | 12 ++- .../openapitools/client/model/NumberOnly.java | 3 +- .../org/openapitools/client/model/Order.java | 18 ++-- .../client/model/OuterComposite.java | 9 +- .../org/openapitools/client/model/Pet.java | 18 ++-- .../client/model/ReadOnlyFirst.java | 6 +- .../client/model/SpecialModelName.java | 3 +- .../org/openapitools/client/model/Tag.java | 6 +- .../client/model/TypeHolderDefault.java | 15 ++-- .../client/model/TypeHolderExample.java | 15 ++-- .../org/openapitools/client/model/User.java | 24 +++-- .../openapitools/client/model/XmlItem.java | 87 ++++++++++++------- .../model/AdditionalPropertiesAnyType.java | 3 +- .../model/AdditionalPropertiesArray.java | 3 +- .../model/AdditionalPropertiesBoolean.java | 3 +- .../model/AdditionalPropertiesClass.java | 33 ++++--- .../model/AdditionalPropertiesInteger.java | 3 +- .../model/AdditionalPropertiesNumber.java | 3 +- .../model/AdditionalPropertiesObject.java | 3 +- .../model/AdditionalPropertiesString.java | 3 +- .../java/org/openapitools/model/Animal.java | 6 +- .../model/ArrayOfArrayOfNumberOnly.java | 3 +- .../openapitools/model/ArrayOfNumberOnly.java | 3 +- .../org/openapitools/model/ArrayTest.java | 9 +- .../openapitools/model/Capitalization.java | 18 ++-- .../gen/java/org/openapitools/model/Cat.java | 3 +- .../java/org/openapitools/model/CatAllOf.java | 3 +- .../java/org/openapitools/model/Category.java | 6 +- .../org/openapitools/model/ClassModel.java | 3 +- .../java/org/openapitools/model/Client.java | 3 +- .../gen/java/org/openapitools/model/Dog.java | 3 +- .../java/org/openapitools/model/DogAllOf.java | 3 +- .../org/openapitools/model/EnumArrays.java | 6 +- .../java/org/openapitools/model/EnumTest.java | 15 ++-- .../model/FileSchemaTestClass.java | 6 +- .../org/openapitools/model/FormatTest.java | 39 ++++++--- .../openapitools/model/HasOnlyReadOnly.java | 6 +- .../java/org/openapitools/model/MapTest.java | 12 ++- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../openapitools/model/Model200Response.java | 6 +- .../openapitools/model/ModelApiResponse.java | 9 +- .../org/openapitools/model/ModelReturn.java | 3 +- .../gen/java/org/openapitools/model/Name.java | 12 ++- .../org/openapitools/model/NumberOnly.java | 3 +- .../java/org/openapitools/model/Order.java | 18 ++-- .../openapitools/model/OuterComposite.java | 9 +- .../gen/java/org/openapitools/model/Pet.java | 18 ++-- .../org/openapitools/model/ReadOnlyFirst.java | 6 +- .../openapitools/model/SpecialModelName.java | 3 +- .../gen/java/org/openapitools/model/Tag.java | 6 +- .../openapitools/model/TypeHolderDefault.java | 15 ++-- .../openapitools/model/TypeHolderExample.java | 15 ++-- .../gen/java/org/openapitools/model/User.java | 24 +++-- .../java/org/openapitools/model/XmlItem.java | 87 ++++++++++++------- .../model/AdditionalPropertiesClass.java | 6 +- .../java/org/openapitools/model/Animal.java | 6 +- .../model/ArrayOfArrayOfNumberOnly.java | 3 +- .../openapitools/model/ArrayOfNumberOnly.java | 3 +- .../org/openapitools/model/ArrayTest.java | 9 +- .../openapitools/model/Capitalization.java | 18 ++-- .../gen/java/org/openapitools/model/Cat.java | 3 +- .../java/org/openapitools/model/CatAllOf.java | 3 +- .../java/org/openapitools/model/Category.java | 6 +- .../org/openapitools/model/ClassModel.java | 3 +- .../java/org/openapitools/model/Client.java | 3 +- .../gen/java/org/openapitools/model/Dog.java | 3 +- .../java/org/openapitools/model/DogAllOf.java | 3 +- .../org/openapitools/model/EnumArrays.java | 6 +- .../java/org/openapitools/model/EnumTest.java | 24 +++-- .../model/FileSchemaTestClass.java | 6 +- .../gen/java/org/openapitools/model/Foo.java | 3 +- .../org/openapitools/model/FormatTest.java | 45 ++++++---- .../openapitools/model/HasOnlyReadOnly.java | 6 +- .../openapitools/model/HealthCheckResult.java | 3 +- .../org/openapitools/model/InlineObject.java | 6 +- .../org/openapitools/model/InlineObject1.java | 6 +- .../org/openapitools/model/InlineObject2.java | 6 +- .../org/openapitools/model/InlineObject3.java | 42 ++++++--- .../org/openapitools/model/InlineObject4.java | 6 +- .../org/openapitools/model/InlineObject5.java | 6 +- .../model/InlineResponseDefault.java | 3 +- .../java/org/openapitools/model/MapTest.java | 12 ++- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../openapitools/model/Model200Response.java | 6 +- .../openapitools/model/ModelApiResponse.java | 9 +- .../org/openapitools/model/ModelReturn.java | 3 +- .../gen/java/org/openapitools/model/Name.java | 12 ++- .../org/openapitools/model/NullableClass.java | 36 +++++--- .../org/openapitools/model/NumberOnly.java | 3 +- .../java/org/openapitools/model/Order.java | 18 ++-- .../openapitools/model/OuterComposite.java | 9 +- .../gen/java/org/openapitools/model/Pet.java | 18 ++-- .../org/openapitools/model/ReadOnlyFirst.java | 6 +- .../openapitools/model/SpecialModelName.java | 3 +- .../gen/java/org/openapitools/model/Tag.java | 6 +- .../gen/java/org/openapitools/model/User.java | 24 +++-- .../model/AdditionalPropertiesAnyType.java | 3 +- .../model/AdditionalPropertiesArray.java | 3 +- .../model/AdditionalPropertiesBoolean.java | 3 +- .../model/AdditionalPropertiesClass.java | 33 ++++--- .../model/AdditionalPropertiesInteger.java | 3 +- .../model/AdditionalPropertiesNumber.java | 3 +- .../model/AdditionalPropertiesObject.java | 3 +- .../model/AdditionalPropertiesString.java | 3 +- .../java/org/openapitools/model/Animal.java | 6 +- .../model/ArrayOfArrayOfNumberOnly.java | 3 +- .../openapitools/model/ArrayOfNumberOnly.java | 3 +- .../org/openapitools/model/ArrayTest.java | 9 +- .../openapitools/model/Capitalization.java | 18 ++-- .../gen/java/org/openapitools/model/Cat.java | 3 +- .../java/org/openapitools/model/CatAllOf.java | 3 +- .../java/org/openapitools/model/Category.java | 6 +- .../org/openapitools/model/ClassModel.java | 3 +- .../java/org/openapitools/model/Client.java | 3 +- .../gen/java/org/openapitools/model/Dog.java | 3 +- .../java/org/openapitools/model/DogAllOf.java | 3 +- .../org/openapitools/model/EnumArrays.java | 6 +- .../java/org/openapitools/model/EnumTest.java | 15 ++-- .../model/FileSchemaTestClass.java | 6 +- .../org/openapitools/model/FormatTest.java | 39 ++++++--- .../openapitools/model/HasOnlyReadOnly.java | 6 +- .../java/org/openapitools/model/MapTest.java | 12 ++- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../openapitools/model/Model200Response.java | 6 +- .../openapitools/model/ModelApiResponse.java | 9 +- .../org/openapitools/model/ModelReturn.java | 3 +- .../gen/java/org/openapitools/model/Name.java | 12 ++- .../org/openapitools/model/NumberOnly.java | 3 +- .../java/org/openapitools/model/Order.java | 18 ++-- .../openapitools/model/OuterComposite.java | 9 +- .../gen/java/org/openapitools/model/Pet.java | 18 ++-- .../org/openapitools/model/ReadOnlyFirst.java | 6 +- .../openapitools/model/SpecialModelName.java | 3 +- .../gen/java/org/openapitools/model/Tag.java | 6 +- .../openapitools/model/TypeHolderDefault.java | 15 ++-- .../openapitools/model/TypeHolderExample.java | 15 ++-- .../gen/java/org/openapitools/model/User.java | 24 +++-- .../java/org/openapitools/model/XmlItem.java | 87 ++++++++++++------- .../model/AdditionalPropertiesAnyType.java | 3 +- .../model/AdditionalPropertiesArray.java | 3 +- .../model/AdditionalPropertiesBoolean.java | 3 +- .../model/AdditionalPropertiesClass.java | 33 ++++--- .../model/AdditionalPropertiesInteger.java | 3 +- .../model/AdditionalPropertiesNumber.java | 3 +- .../model/AdditionalPropertiesObject.java | 3 +- .../model/AdditionalPropertiesString.java | 3 +- .../java/org/openapitools/model/Animal.java | 6 +- .../model/ArrayOfArrayOfNumberOnly.java | 3 +- .../openapitools/model/ArrayOfNumberOnly.java | 3 +- .../org/openapitools/model/ArrayTest.java | 9 +- .../openapitools/model/Capitalization.java | 18 ++-- .../gen/java/org/openapitools/model/Cat.java | 3 +- .../java/org/openapitools/model/CatAllOf.java | 3 +- .../java/org/openapitools/model/Category.java | 6 +- .../org/openapitools/model/ClassModel.java | 3 +- .../java/org/openapitools/model/Client.java | 3 +- .../gen/java/org/openapitools/model/Dog.java | 3 +- .../java/org/openapitools/model/DogAllOf.java | 3 +- .../org/openapitools/model/EnumArrays.java | 6 +- .../java/org/openapitools/model/EnumTest.java | 15 ++-- .../model/FileSchemaTestClass.java | 6 +- .../org/openapitools/model/FormatTest.java | 39 ++++++--- .../openapitools/model/HasOnlyReadOnly.java | 6 +- .../java/org/openapitools/model/MapTest.java | 12 ++- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../openapitools/model/Model200Response.java | 6 +- .../openapitools/model/ModelApiResponse.java | 9 +- .../org/openapitools/model/ModelReturn.java | 3 +- .../gen/java/org/openapitools/model/Name.java | 12 ++- .../org/openapitools/model/NumberOnly.java | 3 +- .../java/org/openapitools/model/Order.java | 18 ++-- .../openapitools/model/OuterComposite.java | 9 +- .../gen/java/org/openapitools/model/Pet.java | 18 ++-- .../org/openapitools/model/ReadOnlyFirst.java | 6 +- .../openapitools/model/SpecialModelName.java | 3 +- .../gen/java/org/openapitools/model/Tag.java | 6 +- .../openapitools/model/TypeHolderDefault.java | 15 ++-- .../openapitools/model/TypeHolderExample.java | 15 ++-- .../gen/java/org/openapitools/model/User.java | 24 +++-- .../java/org/openapitools/model/XmlItem.java | 87 ++++++++++++------- .../model/AdditionalPropertiesAnyType.java | 3 +- .../model/AdditionalPropertiesArray.java | 3 +- .../model/AdditionalPropertiesBoolean.java | 3 +- .../model/AdditionalPropertiesClass.java | 33 ++++--- .../model/AdditionalPropertiesInteger.java | 3 +- .../model/AdditionalPropertiesNumber.java | 3 +- .../model/AdditionalPropertiesObject.java | 3 +- .../model/AdditionalPropertiesString.java | 3 +- .../java/org/openapitools/model/Animal.java | 6 +- .../model/ArrayOfArrayOfNumberOnly.java | 3 +- .../openapitools/model/ArrayOfNumberOnly.java | 3 +- .../org/openapitools/model/ArrayTest.java | 9 +- .../openapitools/model/Capitalization.java | 18 ++-- .../gen/java/org/openapitools/model/Cat.java | 3 +- .../java/org/openapitools/model/CatAllOf.java | 3 +- .../java/org/openapitools/model/Category.java | 6 +- .../org/openapitools/model/ClassModel.java | 3 +- .../java/org/openapitools/model/Client.java | 3 +- .../gen/java/org/openapitools/model/Dog.java | 3 +- .../java/org/openapitools/model/DogAllOf.java | 3 +- .../org/openapitools/model/EnumArrays.java | 6 +- .../java/org/openapitools/model/EnumTest.java | 15 ++-- .../model/FileSchemaTestClass.java | 6 +- .../org/openapitools/model/FormatTest.java | 39 ++++++--- .../openapitools/model/HasOnlyReadOnly.java | 6 +- .../java/org/openapitools/model/MapTest.java | 12 ++- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../openapitools/model/Model200Response.java | 6 +- .../openapitools/model/ModelApiResponse.java | 9 +- .../org/openapitools/model/ModelReturn.java | 3 +- .../gen/java/org/openapitools/model/Name.java | 12 ++- .../org/openapitools/model/NumberOnly.java | 3 +- .../java/org/openapitools/model/Order.java | 18 ++-- .../openapitools/model/OuterComposite.java | 9 +- .../gen/java/org/openapitools/model/Pet.java | 18 ++-- .../org/openapitools/model/ReadOnlyFirst.java | 6 +- .../openapitools/model/SpecialModelName.java | 3 +- .../gen/java/org/openapitools/model/Tag.java | 6 +- .../openapitools/model/TypeHolderDefault.java | 15 ++-- .../openapitools/model/TypeHolderExample.java | 15 ++-- .../gen/java/org/openapitools/model/User.java | 24 +++-- .../java/org/openapitools/model/XmlItem.java | 87 ++++++++++++------- .../model/AdditionalPropertiesAnyType.java | 3 +- .../model/AdditionalPropertiesArray.java | 3 +- .../model/AdditionalPropertiesBoolean.java | 3 +- .../model/AdditionalPropertiesClass.java | 33 ++++--- .../model/AdditionalPropertiesInteger.java | 3 +- .../model/AdditionalPropertiesNumber.java | 3 +- .../model/AdditionalPropertiesObject.java | 3 +- .../model/AdditionalPropertiesString.java | 3 +- .../java/org/openapitools/model/Animal.java | 6 +- .../model/ArrayOfArrayOfNumberOnly.java | 3 +- .../openapitools/model/ArrayOfNumberOnly.java | 3 +- .../org/openapitools/model/ArrayTest.java | 9 +- .../openapitools/model/Capitalization.java | 18 ++-- .../gen/java/org/openapitools/model/Cat.java | 3 +- .../java/org/openapitools/model/CatAllOf.java | 3 +- .../java/org/openapitools/model/Category.java | 6 +- .../org/openapitools/model/ClassModel.java | 3 +- .../java/org/openapitools/model/Client.java | 3 +- .../gen/java/org/openapitools/model/Dog.java | 3 +- .../java/org/openapitools/model/DogAllOf.java | 3 +- .../org/openapitools/model/EnumArrays.java | 6 +- .../java/org/openapitools/model/EnumTest.java | 15 ++-- .../model/FileSchemaTestClass.java | 6 +- .../org/openapitools/model/FormatTest.java | 39 ++++++--- .../openapitools/model/HasOnlyReadOnly.java | 6 +- .../java/org/openapitools/model/MapTest.java | 12 ++- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../openapitools/model/Model200Response.java | 6 +- .../openapitools/model/ModelApiResponse.java | 9 +- .../org/openapitools/model/ModelReturn.java | 3 +- .../gen/java/org/openapitools/model/Name.java | 12 ++- .../org/openapitools/model/NumberOnly.java | 3 +- .../java/org/openapitools/model/Order.java | 18 ++-- .../openapitools/model/OuterComposite.java | 9 +- .../gen/java/org/openapitools/model/Pet.java | 18 ++-- .../org/openapitools/model/ReadOnlyFirst.java | 6 +- .../openapitools/model/SpecialModelName.java | 3 +- .../gen/java/org/openapitools/model/Tag.java | 6 +- .../openapitools/model/TypeHolderDefault.java | 15 ++-- .../openapitools/model/TypeHolderExample.java | 15 ++-- .../gen/java/org/openapitools/model/User.java | 24 +++-- .../java/org/openapitools/model/XmlItem.java | 87 ++++++++++++------- 926 files changed, 6496 insertions(+), 3248 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/pojo.mustache index afd1ebf4098..240190fa11b 100644 --- a/modules/openapi-generator/src/main/resources/Java/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pojo.mustache @@ -20,7 +20,8 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela {{/isContainer}} {{/isEnum}} {{#jackson}} - @JsonProperty("{{baseName}}") + public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; + @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}) {{#withXml}} {{^isContainer}} @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache index 18c5aa4db40..8e3abbae6a7 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache @@ -16,10 +16,12 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{/isContainer}} {{/isEnum}} {{#jackson}} - @JsonProperty("{{baseName}}") + public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; + @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}) {{/jackson}} {{#gson}} - @SerializedName("{{baseName}}") + public static final String SERIALIZED_NAME_{{nameInSnakeCase}} = "{{baseName}}"; + @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) {{/gson}} {{#isContainer}} private {{{datatypeWithEnum}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}} = null{{/required}}; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 69d6a817294..0df18c37e39 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 0147a592b7e..0d9a6b14532 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 89aa511c2a8..8e85a1f2246 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index cb955d1165a..cf0854acd00 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -30,37 +30,48 @@ import java.util.Map; */ public class AdditionalPropertiesClass { - @JsonProperty("map_string") + public static final String JSON_PROPERTY_MAP_STRING = "map_string"; + @JsonProperty(JSON_PROPERTY_MAP_STRING) private Map mapString = new HashMap(); - @JsonProperty("map_number") + public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) private Map mapNumber = new HashMap(); - @JsonProperty("map_integer") + public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) private Map mapInteger = new HashMap(); - @JsonProperty("map_boolean") + public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) private Map mapBoolean = new HashMap(); - @JsonProperty("map_array_integer") + public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) private Map> mapArrayInteger = new HashMap>(); - @JsonProperty("map_array_anytype") + public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) private Map> mapArrayAnytype = new HashMap>(); - @JsonProperty("map_map_string") + public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) private Map> mapMapString = new HashMap>(); - @JsonProperty("map_map_anytype") + public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) private Map> mapMapAnytype = new HashMap>(); - @JsonProperty("anytype_1") + public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + @JsonProperty(JSON_PROPERTY_ANYTYPE1) private Object anytype1 = null; - @JsonProperty("anytype_2") + public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; + @JsonProperty(JSON_PROPERTY_ANYTYPE2) private Object anytype2 = null; - @JsonProperty("anytype_3") + public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; + @JsonProperty(JSON_PROPERTY_ANYTYPE3) private Object anytype3 = null; public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index f27ff011de1..77388b95d86 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 479696fdcef..f0a3318bca1 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index bd569b0da3e..19d772f4522 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 27e03a2313e..09e6431c916 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesString name(String name) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java index dc16717ac32..a2d34d82f47 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java @@ -34,10 +34,12 @@ import io.swagger.annotations.ApiModelProperty; }) public class Animal { - @JsonProperty("className") + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; - @JsonProperty("color") + public static final String JSON_PROPERTY_COLOR = "color"; + @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; public Animal className(String className) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index b670ecb66e4..c3dd85a61ea 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import java.util.List; */ public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = new ArrayList>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 9d6997f88fc..2ae01f1581a 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import java.util.List; */ public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) private List arrayNumber = new ArrayList(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java index 7dc235f0a94..f5968901765 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -29,13 +29,16 @@ import org.openapitools.client.model.ReadOnlyFirst; */ public class ArrayTest { - @JsonProperty("array_of_string") + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) private List arrayOfString = new ArrayList(); - @JsonProperty("array_array_of_integer") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) private List> arrayArrayOfInteger = new ArrayList>(); - @JsonProperty("array_array_of_model") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = new ArrayList>(); public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java index 3f3df29d5da..1d4ebff1533 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Capitalization.java @@ -26,22 +26,28 @@ import io.swagger.annotations.ApiModelProperty; */ public class Capitalization { - @JsonProperty("smallCamel") + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; - @JsonProperty("CapitalCamel") + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; - @JsonProperty("small_Snake") + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; - @JsonProperty("Capital_Snake") + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java index 3f770e0791d..d43f2333bc9 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Cat.java @@ -28,7 +28,8 @@ import org.openapitools.client.model.CatAllOf; */ public class Cat extends Animal { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java index 9a258b81bff..ba49e716c4e 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class CatAllOf { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java index 3eccd2cd922..652d69552d1 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Category.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class Category { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; public Category id(Long id) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java index 2aaed27fffd..16036936e7a 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ClassModel.java @@ -27,7 +27,8 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { - @JsonProperty("_class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java index 458e8129602..a5c065a1dd0 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Client.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class Client { - @JsonProperty("client") + public static final String JSON_PROPERTY_CLIENT = "client"; + @JsonProperty(JSON_PROPERTY_CLIENT) private String client; public Client client(String client) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java index 83f5cb0e272..7ac3c33202e 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Dog.java @@ -28,7 +28,8 @@ import org.openapitools.client.model.DogAllOf; */ public class Dog extends Animal { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public Dog breed(String breed) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java index d1e1402789f..b79847a96e4 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class DogAllOf { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java index 368b481f7e5..10b3d358762 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -63,7 +63,8 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -101,7 +102,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) private List arrayEnum = new ArrayList(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java index b365a8a56fe..bde85ff2a09 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/EnumTest.java @@ -64,7 +64,8 @@ public class EnumTest { } } - @JsonProperty("enum_string") + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -104,7 +105,8 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -142,7 +144,8 @@ public class EnumTest { } } - @JsonProperty("enum_integer") + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -180,10 +183,12 @@ public class EnumTest { } } - @JsonProperty("enum_number") + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index ca73764280c..5ce9290bba2 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -28,10 +28,12 @@ import java.util.List; */ public class FileSchemaTestClass { - @JsonProperty("file") + public static final String JSON_PROPERTY_FILE = "file"; + @JsonProperty(JSON_PROPERTY_FILE) private java.io.File file = null; - @JsonProperty("files") + public static final String JSON_PROPERTY_FILES = "files"; + @JsonProperty(JSON_PROPERTY_FILES) private List files = new ArrayList(); public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java index 00d132529e4..509048cd5e9 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/FormatTest.java @@ -31,43 +31,56 @@ import org.threeten.bp.OffsetDateTime; */ public class FormatTest { - @JsonProperty("integer") + public static final String JSON_PROPERTY_INTEGER = "integer"; + @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; - @JsonProperty("int32") + public static final String JSON_PROPERTY_INT32 = "int32"; + @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; - @JsonProperty("int64") + public static final String JSON_PROPERTY_INT64 = "int64"; + @JsonProperty(JSON_PROPERTY_INT64) private Long int64; - @JsonProperty("number") + public static final String JSON_PROPERTY_NUMBER = "number"; + @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; - @JsonProperty("float") + public static final String JSON_PROPERTY_FLOAT = "float"; + @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; - @JsonProperty("double") + public static final String JSON_PROPERTY_DOUBLE = "double"; + @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; - @JsonProperty("string") + public static final String JSON_PROPERTY_STRING = "string"; + @JsonProperty(JSON_PROPERTY_STRING) private String string; - @JsonProperty("byte") + public static final String JSON_PROPERTY_BYTE = "byte"; + @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; - @JsonProperty("binary") + public static final String JSON_PROPERTY_BINARY = "binary"; + @JsonProperty(JSON_PROPERTY_BINARY) private File binary; - @JsonProperty("date") + public static final String JSON_PROPERTY_DATE = "date"; + @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index e9453bb6cce..ad6b28d9d1e 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class HasOnlyReadOnly { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("foo") + public static final String JSON_PROPERTY_FOO = "foo"; + @JsonProperty(JSON_PROPERTY_FOO) private String foo; /** diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java index 44cd694057a..0a57199a714 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MapTest.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class MapTest { - @JsonProperty("map_map_of_string") + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) private Map> mapMapOfString = new HashMap>(); /** @@ -67,13 +68,16 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) private Map mapOfEnumString = new HashMap(); - @JsonProperty("direct_map") + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) private Map directMap = new HashMap(); - @JsonProperty("indirect_map") + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) private Map indirectMap = new HashMap(); public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 19d808093c9..df68b7d4188 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -32,13 +32,16 @@ import org.threeten.bp.OffsetDateTime; */ public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") + public static final String JSON_PROPERTY_MAP = "map"; + @JsonProperty(JSON_PROPERTY_MAP) private Map map = new HashMap(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java index 39fabeeb6da..d86df5d7eab 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Model200Response.java @@ -27,10 +27,12 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model name starting with number") public class Model200Response { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java index bb334129511..4c9a7f87b5a 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -26,13 +26,16 @@ import io.swagger.annotations.ApiModelProperty; */ public class ModelApiResponse { - @JsonProperty("code") + public static final String JSON_PROPERTY_CODE = "code"; + @JsonProperty(JSON_PROPERTY_CODE) private Integer code; - @JsonProperty("type") + public static final String JSON_PROPERTY_TYPE = "type"; + @JsonProperty(JSON_PROPERTY_TYPE) private String type; - @JsonProperty("message") + public static final String JSON_PROPERTY_MESSAGE = "message"; + @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java index 9aafb13e04d..9c9ac21a3fb 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -27,7 +27,8 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing reserved words") public class ModelReturn { - @JsonProperty("return") + public static final String JSON_PROPERTY_RETURN = "return"; + @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java index 9518276dd61..47f89c54361 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Name.java @@ -27,16 +27,20 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model name same as property name") public class Name { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("snake_case") + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; - @JsonProperty("property") + public static final String JSON_PROPERTY_PROPERTY = "property"; + @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; - @JsonProperty("123Number") + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; public Name name(Integer name) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java index 0245e8e2109..f5331da226e 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -27,7 +27,8 @@ import java.math.BigDecimal; */ public class NumberOnly { - @JsonProperty("JustNumber") + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java index f72f97defc0..b0d37534e89 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Order.java @@ -27,16 +27,20 @@ import org.threeten.bp.OffsetDateTime; */ public class Order { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("petId") + public static final String JSON_PROPERTY_PET_ID = "petId"; + @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; - @JsonProperty("quantity") + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; - @JsonProperty("shipDate") + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -76,10 +80,12 @@ public class Order { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; - @JsonProperty("complete") + public static final String JSON_PROPERTY_COMPLETE = "complete"; + @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; public Order id(Long id) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java index 8fcdb3b130a..edde668a2ad 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -27,13 +27,16 @@ import java.math.BigDecimal; */ public class OuterComposite { - @JsonProperty("my_number") + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; - @JsonProperty("my_string") + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; - @JsonProperty("my_boolean") + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java index a7d92129d73..b907822ed01 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java @@ -30,19 +30,24 @@ import org.openapitools.client.model.Tag; */ public class Pet { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("category") + public static final String JSON_PROPERTY_CATEGORY = "category"; + @JsonProperty(JSON_PROPERTY_CATEGORY) private Category category = null; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; - @JsonProperty("photoUrls") + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList(); - @JsonProperty("tags") + public static final String JSON_PROPERTY_TAGS = "tags"; + @JsonProperty(JSON_PROPERTY_TAGS) private List tags = new ArrayList(); /** @@ -82,7 +87,8 @@ public class Pet { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public Pet id(Long id) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 1379ee09ea6..b0949b9e2ea 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class ReadOnlyFirst { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("baz") + public static final String JSON_PROPERTY_BAZ = "baz"; + @JsonProperty(JSON_PROPERTY_BAZ) private String baz; /** diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java index 869771afad8..a9d03234061 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class SpecialModelName { - @JsonProperty("$special[property.name]") + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java index 4bb498aff43..45f17b22cf3 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Tag.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class Tag { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public Tag id(Long id) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index c7988712ccb..75ddd671fa8 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -29,19 +29,24 @@ import java.util.List; */ public class TypeHolderDefault { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderExample.java index cca1c01efd6..79a56d1ac73 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -29,19 +29,24 @@ import java.util.List; */ public class TypeHolderExample { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java index 73164c3ee28..9ce7869e755 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/User.java @@ -26,28 +26,36 @@ import io.swagger.annotations.ApiModelProperty; */ public class User { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("username") + public static final String JSON_PROPERTY_USERNAME = "username"; + @JsonProperty(JSON_PROPERTY_USERNAME) private String username; - @JsonProperty("firstName") + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; - @JsonProperty("lastName") + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; - @JsonProperty("email") + public static final String JSON_PROPERTY_EMAIL = "email"; + @JsonProperty(JSON_PROPERTY_EMAIL) private String email; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; - @JsonProperty("phone") + public static final String JSON_PROPERTY_PHONE = "phone"; + @JsonProperty(JSON_PROPERTY_PHONE) private String phone; - @JsonProperty("userStatus") + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; public User id(Long id) { diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/XmlItem.java index 9ee6eca9080..9e83466d321 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/XmlItem.java @@ -29,91 +29,120 @@ import java.util.List; */ public class XmlItem { - @JsonProperty("attribute_string") + public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; - @JsonProperty("attribute_number") + public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; - @JsonProperty("attribute_integer") + public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; - @JsonProperty("attribute_boolean") + public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; - @JsonProperty("wrapped_array") + public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) private List wrappedArray = new ArrayList(); - @JsonProperty("name_string") + public static final String JSON_PROPERTY_NAME_STRING = "name_string"; + @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; - @JsonProperty("name_number") + public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; - @JsonProperty("name_integer") + public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; - @JsonProperty("name_boolean") + public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; - @JsonProperty("name_array") + public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) private List nameArray = new ArrayList(); - @JsonProperty("name_wrapped_array") + public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) private List nameWrappedArray = new ArrayList(); - @JsonProperty("prefix_string") + public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; - @JsonProperty("prefix_number") + public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; - @JsonProperty("prefix_integer") + public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; - @JsonProperty("prefix_boolean") + public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; - @JsonProperty("prefix_array") + public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) private List prefixArray = new ArrayList(); - @JsonProperty("prefix_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) private List prefixWrappedArray = new ArrayList(); - @JsonProperty("namespace_string") + public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; - @JsonProperty("namespace_number") + public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; - @JsonProperty("namespace_integer") + public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; - @JsonProperty("namespace_boolean") + public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; - @JsonProperty("namespace_array") + public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) private List namespaceArray = new ArrayList(); - @JsonProperty("namespace_wrapped_array") + public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) private List namespaceWrappedArray = new ArrayList(); - @JsonProperty("prefix_ns_string") + public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; - @JsonProperty("prefix_ns_number") + public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; - @JsonProperty("prefix_ns_integer") + public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; - @JsonProperty("prefix_ns_boolean") + public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; - @JsonProperty("prefix_ns_array") + public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) private List prefixNsArray = new ArrayList(); - @JsonProperty("prefix_ns_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) private List prefixNsWrappedArray = new ArrayList(); public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 69d6a817294..0df18c37e39 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 0147a592b7e..0d9a6b14532 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 89aa511c2a8..8e85a1f2246 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index cb955d1165a..cf0854acd00 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -30,37 +30,48 @@ import java.util.Map; */ public class AdditionalPropertiesClass { - @JsonProperty("map_string") + public static final String JSON_PROPERTY_MAP_STRING = "map_string"; + @JsonProperty(JSON_PROPERTY_MAP_STRING) private Map mapString = new HashMap(); - @JsonProperty("map_number") + public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) private Map mapNumber = new HashMap(); - @JsonProperty("map_integer") + public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) private Map mapInteger = new HashMap(); - @JsonProperty("map_boolean") + public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) private Map mapBoolean = new HashMap(); - @JsonProperty("map_array_integer") + public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) private Map> mapArrayInteger = new HashMap>(); - @JsonProperty("map_array_anytype") + public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) private Map> mapArrayAnytype = new HashMap>(); - @JsonProperty("map_map_string") + public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) private Map> mapMapString = new HashMap>(); - @JsonProperty("map_map_anytype") + public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) private Map> mapMapAnytype = new HashMap>(); - @JsonProperty("anytype_1") + public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + @JsonProperty(JSON_PROPERTY_ANYTYPE1) private Object anytype1 = null; - @JsonProperty("anytype_2") + public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; + @JsonProperty(JSON_PROPERTY_ANYTYPE2) private Object anytype2 = null; - @JsonProperty("anytype_3") + public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; + @JsonProperty(JSON_PROPERTY_ANYTYPE3) private Object anytype3 = null; public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index f27ff011de1..77388b95d86 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 479696fdcef..f0a3318bca1 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index bd569b0da3e..19d772f4522 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 27e03a2313e..09e6431c916 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesString name(String name) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Animal.java index dc16717ac32..a2d34d82f47 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Animal.java @@ -34,10 +34,12 @@ import io.swagger.annotations.ApiModelProperty; }) public class Animal { - @JsonProperty("className") + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; - @JsonProperty("color") + public static final String JSON_PROPERTY_COLOR = "color"; + @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; public Animal className(String className) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index b670ecb66e4..c3dd85a61ea 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import java.util.List; */ public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = new ArrayList>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 9d6997f88fc..2ae01f1581a 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import java.util.List; */ public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) private List arrayNumber = new ArrayList(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ArrayTest.java index 7dc235f0a94..f5968901765 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -29,13 +29,16 @@ import org.openapitools.client.model.ReadOnlyFirst; */ public class ArrayTest { - @JsonProperty("array_of_string") + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) private List arrayOfString = new ArrayList(); - @JsonProperty("array_array_of_integer") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) private List> arrayArrayOfInteger = new ArrayList>(); - @JsonProperty("array_array_of_model") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = new ArrayList>(); public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Capitalization.java index 3f3df29d5da..1d4ebff1533 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Capitalization.java @@ -26,22 +26,28 @@ import io.swagger.annotations.ApiModelProperty; */ public class Capitalization { - @JsonProperty("smallCamel") + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; - @JsonProperty("CapitalCamel") + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; - @JsonProperty("small_Snake") + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; - @JsonProperty("Capital_Snake") + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Cat.java index 3f770e0791d..d43f2333bc9 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Cat.java @@ -28,7 +28,8 @@ import org.openapitools.client.model.CatAllOf; */ public class Cat extends Animal { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/CatAllOf.java index 9a258b81bff..ba49e716c4e 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class CatAllOf { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Category.java index 3eccd2cd922..652d69552d1 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Category.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class Category { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; public Category id(Long id) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ClassModel.java index 2aaed27fffd..16036936e7a 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ClassModel.java @@ -27,7 +27,8 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { - @JsonProperty("_class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Client.java index 458e8129602..a5c065a1dd0 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Client.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class Client { - @JsonProperty("client") + public static final String JSON_PROPERTY_CLIENT = "client"; + @JsonProperty(JSON_PROPERTY_CLIENT) private String client; public Client client(String client) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Dog.java index 83f5cb0e272..7ac3c33202e 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Dog.java @@ -28,7 +28,8 @@ import org.openapitools.client.model.DogAllOf; */ public class Dog extends Animal { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public Dog breed(String breed) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/DogAllOf.java index d1e1402789f..b79847a96e4 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class DogAllOf { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/EnumArrays.java index 368b481f7e5..10b3d358762 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -63,7 +63,8 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -101,7 +102,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) private List arrayEnum = new ArrayList(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/EnumTest.java index b365a8a56fe..bde85ff2a09 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/EnumTest.java @@ -64,7 +64,8 @@ public class EnumTest { } } - @JsonProperty("enum_string") + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -104,7 +105,8 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -142,7 +144,8 @@ public class EnumTest { } } - @JsonProperty("enum_integer") + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -180,10 +183,12 @@ public class EnumTest { } } - @JsonProperty("enum_number") + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index ca73764280c..5ce9290bba2 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -28,10 +28,12 @@ import java.util.List; */ public class FileSchemaTestClass { - @JsonProperty("file") + public static final String JSON_PROPERTY_FILE = "file"; + @JsonProperty(JSON_PROPERTY_FILE) private java.io.File file = null; - @JsonProperty("files") + public static final String JSON_PROPERTY_FILES = "files"; + @JsonProperty(JSON_PROPERTY_FILES) private List files = new ArrayList(); public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/FormatTest.java index 00d132529e4..509048cd5e9 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/FormatTest.java @@ -31,43 +31,56 @@ import org.threeten.bp.OffsetDateTime; */ public class FormatTest { - @JsonProperty("integer") + public static final String JSON_PROPERTY_INTEGER = "integer"; + @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; - @JsonProperty("int32") + public static final String JSON_PROPERTY_INT32 = "int32"; + @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; - @JsonProperty("int64") + public static final String JSON_PROPERTY_INT64 = "int64"; + @JsonProperty(JSON_PROPERTY_INT64) private Long int64; - @JsonProperty("number") + public static final String JSON_PROPERTY_NUMBER = "number"; + @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; - @JsonProperty("float") + public static final String JSON_PROPERTY_FLOAT = "float"; + @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; - @JsonProperty("double") + public static final String JSON_PROPERTY_DOUBLE = "double"; + @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; - @JsonProperty("string") + public static final String JSON_PROPERTY_STRING = "string"; + @JsonProperty(JSON_PROPERTY_STRING) private String string; - @JsonProperty("byte") + public static final String JSON_PROPERTY_BYTE = "byte"; + @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; - @JsonProperty("binary") + public static final String JSON_PROPERTY_BINARY = "binary"; + @JsonProperty(JSON_PROPERTY_BINARY) private File binary; - @JsonProperty("date") + public static final String JSON_PROPERTY_DATE = "date"; + @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index e9453bb6cce..ad6b28d9d1e 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class HasOnlyReadOnly { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("foo") + public static final String JSON_PROPERTY_FOO = "foo"; + @JsonProperty(JSON_PROPERTY_FOO) private String foo; /** diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/MapTest.java index 44cd694057a..0a57199a714 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/MapTest.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class MapTest { - @JsonProperty("map_map_of_string") + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) private Map> mapMapOfString = new HashMap>(); /** @@ -67,13 +68,16 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) private Map mapOfEnumString = new HashMap(); - @JsonProperty("direct_map") + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) private Map directMap = new HashMap(); - @JsonProperty("indirect_map") + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) private Map indirectMap = new HashMap(); public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 19d808093c9..df68b7d4188 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -32,13 +32,16 @@ import org.threeten.bp.OffsetDateTime; */ public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") + public static final String JSON_PROPERTY_MAP = "map"; + @JsonProperty(JSON_PROPERTY_MAP) private Map map = new HashMap(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Model200Response.java index 39fabeeb6da..d86df5d7eab 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Model200Response.java @@ -27,10 +27,12 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model name starting with number") public class Model200Response { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ModelApiResponse.java index bb334129511..4c9a7f87b5a 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -26,13 +26,16 @@ import io.swagger.annotations.ApiModelProperty; */ public class ModelApiResponse { - @JsonProperty("code") + public static final String JSON_PROPERTY_CODE = "code"; + @JsonProperty(JSON_PROPERTY_CODE) private Integer code; - @JsonProperty("type") + public static final String JSON_PROPERTY_TYPE = "type"; + @JsonProperty(JSON_PROPERTY_TYPE) private String type; - @JsonProperty("message") + public static final String JSON_PROPERTY_MESSAGE = "message"; + @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ModelReturn.java index 9aafb13e04d..9c9ac21a3fb 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -27,7 +27,8 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing reserved words") public class ModelReturn { - @JsonProperty("return") + public static final String JSON_PROPERTY_RETURN = "return"; + @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Name.java index 9518276dd61..47f89c54361 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Name.java @@ -27,16 +27,20 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model name same as property name") public class Name { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("snake_case") + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; - @JsonProperty("property") + public static final String JSON_PROPERTY_PROPERTY = "property"; + @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; - @JsonProperty("123Number") + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; public Name name(Integer name) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/NumberOnly.java index 0245e8e2109..f5331da226e 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -27,7 +27,8 @@ import java.math.BigDecimal; */ public class NumberOnly { - @JsonProperty("JustNumber") + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Order.java index f72f97defc0..b0d37534e89 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Order.java @@ -27,16 +27,20 @@ import org.threeten.bp.OffsetDateTime; */ public class Order { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("petId") + public static final String JSON_PROPERTY_PET_ID = "petId"; + @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; - @JsonProperty("quantity") + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; - @JsonProperty("shipDate") + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -76,10 +80,12 @@ public class Order { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; - @JsonProperty("complete") + public static final String JSON_PROPERTY_COMPLETE = "complete"; + @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; public Order id(Long id) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/OuterComposite.java index 8fcdb3b130a..edde668a2ad 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -27,13 +27,16 @@ import java.math.BigDecimal; */ public class OuterComposite { - @JsonProperty("my_number") + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; - @JsonProperty("my_string") + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; - @JsonProperty("my_boolean") + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Pet.java index a7d92129d73..b907822ed01 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Pet.java @@ -30,19 +30,24 @@ import org.openapitools.client.model.Tag; */ public class Pet { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("category") + public static final String JSON_PROPERTY_CATEGORY = "category"; + @JsonProperty(JSON_PROPERTY_CATEGORY) private Category category = null; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; - @JsonProperty("photoUrls") + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList(); - @JsonProperty("tags") + public static final String JSON_PROPERTY_TAGS = "tags"; + @JsonProperty(JSON_PROPERTY_TAGS) private List tags = new ArrayList(); /** @@ -82,7 +87,8 @@ public class Pet { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public Pet id(Long id) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 1379ee09ea6..b0949b9e2ea 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class ReadOnlyFirst { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("baz") + public static final String JSON_PROPERTY_BAZ = "baz"; + @JsonProperty(JSON_PROPERTY_BAZ) private String baz; /** diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/SpecialModelName.java index 869771afad8..a9d03234061 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class SpecialModelName { - @JsonProperty("$special[property.name]") + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Tag.java index 4bb498aff43..45f17b22cf3 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Tag.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class Tag { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public Tag id(Long id) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index c7988712ccb..75ddd671fa8 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -29,19 +29,24 @@ import java.util.List; */ public class TypeHolderDefault { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/TypeHolderExample.java index cca1c01efd6..79a56d1ac73 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -29,19 +29,24 @@ import java.util.List; */ public class TypeHolderExample { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/User.java index 73164c3ee28..9ce7869e755 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/User.java @@ -26,28 +26,36 @@ import io.swagger.annotations.ApiModelProperty; */ public class User { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("username") + public static final String JSON_PROPERTY_USERNAME = "username"; + @JsonProperty(JSON_PROPERTY_USERNAME) private String username; - @JsonProperty("firstName") + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; - @JsonProperty("lastName") + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; - @JsonProperty("email") + public static final String JSON_PROPERTY_EMAIL = "email"; + @JsonProperty(JSON_PROPERTY_EMAIL) private String email; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; - @JsonProperty("phone") + public static final String JSON_PROPERTY_PHONE = "phone"; + @JsonProperty(JSON_PROPERTY_PHONE) private String phone; - @JsonProperty("userStatus") + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; public User id(Long id) { diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/XmlItem.java index 9ee6eca9080..9e83466d321 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/XmlItem.java @@ -29,91 +29,120 @@ import java.util.List; */ public class XmlItem { - @JsonProperty("attribute_string") + public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; - @JsonProperty("attribute_number") + public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; - @JsonProperty("attribute_integer") + public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; - @JsonProperty("attribute_boolean") + public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; - @JsonProperty("wrapped_array") + public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) private List wrappedArray = new ArrayList(); - @JsonProperty("name_string") + public static final String JSON_PROPERTY_NAME_STRING = "name_string"; + @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; - @JsonProperty("name_number") + public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; - @JsonProperty("name_integer") + public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; - @JsonProperty("name_boolean") + public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; - @JsonProperty("name_array") + public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) private List nameArray = new ArrayList(); - @JsonProperty("name_wrapped_array") + public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) private List nameWrappedArray = new ArrayList(); - @JsonProperty("prefix_string") + public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; - @JsonProperty("prefix_number") + public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; - @JsonProperty("prefix_integer") + public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; - @JsonProperty("prefix_boolean") + public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; - @JsonProperty("prefix_array") + public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) private List prefixArray = new ArrayList(); - @JsonProperty("prefix_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) private List prefixWrappedArray = new ArrayList(); - @JsonProperty("namespace_string") + public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; - @JsonProperty("namespace_number") + public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; - @JsonProperty("namespace_integer") + public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; - @JsonProperty("namespace_boolean") + public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; - @JsonProperty("namespace_array") + public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) private List namespaceArray = new ArrayList(); - @JsonProperty("namespace_wrapped_array") + public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) private List namespaceWrappedArray = new ArrayList(); - @JsonProperty("prefix_ns_string") + public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; - @JsonProperty("prefix_ns_number") + public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; - @JsonProperty("prefix_ns_integer") + public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; - @JsonProperty("prefix_ns_boolean") + public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; - @JsonProperty("prefix_ns_array") + public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) private List prefixNsArray = new ArrayList(); - @JsonProperty("prefix_ns_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) private List prefixNsWrappedArray = new ArrayList(); public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 69d6a817294..0df18c37e39 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 0147a592b7e..0d9a6b14532 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 89aa511c2a8..8e85a1f2246 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index cb955d1165a..cf0854acd00 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -30,37 +30,48 @@ import java.util.Map; */ public class AdditionalPropertiesClass { - @JsonProperty("map_string") + public static final String JSON_PROPERTY_MAP_STRING = "map_string"; + @JsonProperty(JSON_PROPERTY_MAP_STRING) private Map mapString = new HashMap(); - @JsonProperty("map_number") + public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) private Map mapNumber = new HashMap(); - @JsonProperty("map_integer") + public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) private Map mapInteger = new HashMap(); - @JsonProperty("map_boolean") + public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) private Map mapBoolean = new HashMap(); - @JsonProperty("map_array_integer") + public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) private Map> mapArrayInteger = new HashMap>(); - @JsonProperty("map_array_anytype") + public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) private Map> mapArrayAnytype = new HashMap>(); - @JsonProperty("map_map_string") + public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) private Map> mapMapString = new HashMap>(); - @JsonProperty("map_map_anytype") + public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) private Map> mapMapAnytype = new HashMap>(); - @JsonProperty("anytype_1") + public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + @JsonProperty(JSON_PROPERTY_ANYTYPE1) private Object anytype1 = null; - @JsonProperty("anytype_2") + public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; + @JsonProperty(JSON_PROPERTY_ANYTYPE2) private Object anytype2 = null; - @JsonProperty("anytype_3") + public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; + @JsonProperty(JSON_PROPERTY_ANYTYPE3) private Object anytype3 = null; public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index f27ff011de1..77388b95d86 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 479696fdcef..f0a3318bca1 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index bd569b0da3e..19d772f4522 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 27e03a2313e..09e6431c916 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesString name(String name) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java index dc16717ac32..a2d34d82f47 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java @@ -34,10 +34,12 @@ import io.swagger.annotations.ApiModelProperty; }) public class Animal { - @JsonProperty("className") + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; - @JsonProperty("color") + public static final String JSON_PROPERTY_COLOR = "color"; + @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; public Animal className(String className) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index b670ecb66e4..c3dd85a61ea 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import java.util.List; */ public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = new ArrayList>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 9d6997f88fc..2ae01f1581a 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import java.util.List; */ public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) private List arrayNumber = new ArrayList(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java index 7dc235f0a94..f5968901765 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -29,13 +29,16 @@ import org.openapitools.client.model.ReadOnlyFirst; */ public class ArrayTest { - @JsonProperty("array_of_string") + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) private List arrayOfString = new ArrayList(); - @JsonProperty("array_array_of_integer") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) private List> arrayArrayOfInteger = new ArrayList>(); - @JsonProperty("array_array_of_model") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = new ArrayList>(); public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java index 3f3df29d5da..1d4ebff1533 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Capitalization.java @@ -26,22 +26,28 @@ import io.swagger.annotations.ApiModelProperty; */ public class Capitalization { - @JsonProperty("smallCamel") + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; - @JsonProperty("CapitalCamel") + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; - @JsonProperty("small_Snake") + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; - @JsonProperty("Capital_Snake") + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java index a8108d6f151..11ffa39d982 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Cat.java @@ -28,7 +28,8 @@ import org.openapitools.client.model.CatAllOf; */ public class Cat extends Animal { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java index 42e96146107..1c12b1972cf 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class CatAllOf { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java index 3eccd2cd922..652d69552d1 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Category.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class Category { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; public Category id(Long id) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java index 2aaed27fffd..16036936e7a 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ClassModel.java @@ -27,7 +27,8 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { - @JsonProperty("_class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java index 458e8129602..a5c065a1dd0 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Client.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class Client { - @JsonProperty("client") + public static final String JSON_PROPERTY_CLIENT = "client"; + @JsonProperty(JSON_PROPERTY_CLIENT) private String client; public Client client(String client) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java index 83f5cb0e272..7ac3c33202e 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Dog.java @@ -28,7 +28,8 @@ import org.openapitools.client.model.DogAllOf; */ public class Dog extends Animal { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public Dog breed(String breed) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java index d1e1402789f..b79847a96e4 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class DogAllOf { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java index 368b481f7e5..10b3d358762 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -63,7 +63,8 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -101,7 +102,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) private List arrayEnum = new ArrayList(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java index b365a8a56fe..bde85ff2a09 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/EnumTest.java @@ -64,7 +64,8 @@ public class EnumTest { } } - @JsonProperty("enum_string") + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -104,7 +105,8 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -142,7 +144,8 @@ public class EnumTest { } } - @JsonProperty("enum_integer") + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -180,10 +183,12 @@ public class EnumTest { } } - @JsonProperty("enum_number") + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index ca73764280c..5ce9290bba2 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -28,10 +28,12 @@ import java.util.List; */ public class FileSchemaTestClass { - @JsonProperty("file") + public static final String JSON_PROPERTY_FILE = "file"; + @JsonProperty(JSON_PROPERTY_FILE) private java.io.File file = null; - @JsonProperty("files") + public static final String JSON_PROPERTY_FILES = "files"; + @JsonProperty(JSON_PROPERTY_FILES) private List files = new ArrayList(); public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java index 00d132529e4..509048cd5e9 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/FormatTest.java @@ -31,43 +31,56 @@ import org.threeten.bp.OffsetDateTime; */ public class FormatTest { - @JsonProperty("integer") + public static final String JSON_PROPERTY_INTEGER = "integer"; + @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; - @JsonProperty("int32") + public static final String JSON_PROPERTY_INT32 = "int32"; + @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; - @JsonProperty("int64") + public static final String JSON_PROPERTY_INT64 = "int64"; + @JsonProperty(JSON_PROPERTY_INT64) private Long int64; - @JsonProperty("number") + public static final String JSON_PROPERTY_NUMBER = "number"; + @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; - @JsonProperty("float") + public static final String JSON_PROPERTY_FLOAT = "float"; + @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; - @JsonProperty("double") + public static final String JSON_PROPERTY_DOUBLE = "double"; + @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; - @JsonProperty("string") + public static final String JSON_PROPERTY_STRING = "string"; + @JsonProperty(JSON_PROPERTY_STRING) private String string; - @JsonProperty("byte") + public static final String JSON_PROPERTY_BYTE = "byte"; + @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; - @JsonProperty("binary") + public static final String JSON_PROPERTY_BINARY = "binary"; + @JsonProperty(JSON_PROPERTY_BINARY) private File binary; - @JsonProperty("date") + public static final String JSON_PROPERTY_DATE = "date"; + @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index e9453bb6cce..ad6b28d9d1e 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class HasOnlyReadOnly { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("foo") + public static final String JSON_PROPERTY_FOO = "foo"; + @JsonProperty(JSON_PROPERTY_FOO) private String foo; /** diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java index 44cd694057a..0a57199a714 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MapTest.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class MapTest { - @JsonProperty("map_map_of_string") + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) private Map> mapMapOfString = new HashMap>(); /** @@ -67,13 +68,16 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) private Map mapOfEnumString = new HashMap(); - @JsonProperty("direct_map") + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) private Map directMap = new HashMap(); - @JsonProperty("indirect_map") + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) private Map indirectMap = new HashMap(); public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 19d808093c9..df68b7d4188 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -32,13 +32,16 @@ import org.threeten.bp.OffsetDateTime; */ public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") + public static final String JSON_PROPERTY_MAP = "map"; + @JsonProperty(JSON_PROPERTY_MAP) private Map map = new HashMap(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java index 39fabeeb6da..d86df5d7eab 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Model200Response.java @@ -27,10 +27,12 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model name starting with number") public class Model200Response { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java index bb334129511..4c9a7f87b5a 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -26,13 +26,16 @@ import io.swagger.annotations.ApiModelProperty; */ public class ModelApiResponse { - @JsonProperty("code") + public static final String JSON_PROPERTY_CODE = "code"; + @JsonProperty(JSON_PROPERTY_CODE) private Integer code; - @JsonProperty("type") + public static final String JSON_PROPERTY_TYPE = "type"; + @JsonProperty(JSON_PROPERTY_TYPE) private String type; - @JsonProperty("message") + public static final String JSON_PROPERTY_MESSAGE = "message"; + @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java index 9aafb13e04d..9c9ac21a3fb 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -27,7 +27,8 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing reserved words") public class ModelReturn { - @JsonProperty("return") + public static final String JSON_PROPERTY_RETURN = "return"; + @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java index 9518276dd61..47f89c54361 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Name.java @@ -27,16 +27,20 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model name same as property name") public class Name { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("snake_case") + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; - @JsonProperty("property") + public static final String JSON_PROPERTY_PROPERTY = "property"; + @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; - @JsonProperty("123Number") + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; public Name name(Integer name) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java index 0245e8e2109..f5331da226e 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -27,7 +27,8 @@ import java.math.BigDecimal; */ public class NumberOnly { - @JsonProperty("JustNumber") + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java index a9e2986a2fe..0d6bc154e46 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Order.java @@ -27,16 +27,20 @@ import org.threeten.bp.OffsetDateTime; */ public class Order { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("petId") + public static final String JSON_PROPERTY_PET_ID = "petId"; + @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; - @JsonProperty("quantity") + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; - @JsonProperty("shipDate") + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -76,10 +80,12 @@ public class Order { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; - @JsonProperty("complete") + public static final String JSON_PROPERTY_COMPLETE = "complete"; + @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; public Order id(Long id) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java index c8bd99011c0..7193ba2a0c9 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -27,13 +27,16 @@ import java.math.BigDecimal; */ public class OuterComposite { - @JsonProperty("my_number") + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; - @JsonProperty("my_string") + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; - @JsonProperty("my_boolean") + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java index a7d92129d73..b907822ed01 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java @@ -30,19 +30,24 @@ import org.openapitools.client.model.Tag; */ public class Pet { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("category") + public static final String JSON_PROPERTY_CATEGORY = "category"; + @JsonProperty(JSON_PROPERTY_CATEGORY) private Category category = null; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; - @JsonProperty("photoUrls") + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList(); - @JsonProperty("tags") + public static final String JSON_PROPERTY_TAGS = "tags"; + @JsonProperty(JSON_PROPERTY_TAGS) private List tags = new ArrayList(); /** @@ -82,7 +87,8 @@ public class Pet { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public Pet id(Long id) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 1379ee09ea6..b0949b9e2ea 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class ReadOnlyFirst { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("baz") + public static final String JSON_PROPERTY_BAZ = "baz"; + @JsonProperty(JSON_PROPERTY_BAZ) private String baz; /** diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java index 869771afad8..a9d03234061 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class SpecialModelName { - @JsonProperty("$special[property.name]") + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java index 4bb498aff43..45f17b22cf3 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Tag.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class Tag { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public Tag id(Long id) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 9d0f5b2fbea..0961f776fb0 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -29,19 +29,24 @@ import java.util.List; */ public class TypeHolderDefault { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 94d3c57b6f2..3617c5c16b2 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -29,19 +29,24 @@ import java.util.List; */ public class TypeHolderExample { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java index 73164c3ee28..9ce7869e755 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/User.java @@ -26,28 +26,36 @@ import io.swagger.annotations.ApiModelProperty; */ public class User { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("username") + public static final String JSON_PROPERTY_USERNAME = "username"; + @JsonProperty(JSON_PROPERTY_USERNAME) private String username; - @JsonProperty("firstName") + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; - @JsonProperty("lastName") + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; - @JsonProperty("email") + public static final String JSON_PROPERTY_EMAIL = "email"; + @JsonProperty(JSON_PROPERTY_EMAIL) private String email; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; - @JsonProperty("phone") + public static final String JSON_PROPERTY_PHONE = "phone"; + @JsonProperty(JSON_PROPERTY_PHONE) private String phone; - @JsonProperty("userStatus") + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; public User id(Long id) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java index 9032c234249..151939d6054 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/XmlItem.java @@ -29,91 +29,120 @@ import java.util.List; */ public class XmlItem { - @JsonProperty("attribute_string") + public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; - @JsonProperty("attribute_number") + public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; - @JsonProperty("attribute_integer") + public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; - @JsonProperty("attribute_boolean") + public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; - @JsonProperty("wrapped_array") + public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) private List wrappedArray = new ArrayList(); - @JsonProperty("name_string") + public static final String JSON_PROPERTY_NAME_STRING = "name_string"; + @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; - @JsonProperty("name_number") + public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; - @JsonProperty("name_integer") + public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; - @JsonProperty("name_boolean") + public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; - @JsonProperty("name_array") + public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) private List nameArray = new ArrayList(); - @JsonProperty("name_wrapped_array") + public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) private List nameWrappedArray = new ArrayList(); - @JsonProperty("prefix_string") + public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; - @JsonProperty("prefix_number") + public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; - @JsonProperty("prefix_integer") + public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; - @JsonProperty("prefix_boolean") + public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; - @JsonProperty("prefix_array") + public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) private List prefixArray = new ArrayList(); - @JsonProperty("prefix_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) private List prefixWrappedArray = new ArrayList(); - @JsonProperty("namespace_string") + public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; - @JsonProperty("namespace_number") + public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; - @JsonProperty("namespace_integer") + public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; - @JsonProperty("namespace_boolean") + public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; - @JsonProperty("namespace_array") + public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) private List namespaceArray = new ArrayList(); - @JsonProperty("namespace_wrapped_array") + public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) private List namespaceWrappedArray = new ArrayList(); - @JsonProperty("prefix_ns_string") + public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; - @JsonProperty("prefix_ns_number") + public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; - @JsonProperty("prefix_ns_integer") + public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; - @JsonProperty("prefix_ns_boolean") + public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; - @JsonProperty("prefix_ns_array") + public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) private List prefixNsArray = new ArrayList(); - @JsonProperty("prefix_ns_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) private List prefixNsWrappedArray = new ArrayList(); public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 69d6a817294..0df18c37e39 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 0147a592b7e..0d9a6b14532 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 89aa511c2a8..8e85a1f2246 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index cb955d1165a..cf0854acd00 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -30,37 +30,48 @@ import java.util.Map; */ public class AdditionalPropertiesClass { - @JsonProperty("map_string") + public static final String JSON_PROPERTY_MAP_STRING = "map_string"; + @JsonProperty(JSON_PROPERTY_MAP_STRING) private Map mapString = new HashMap(); - @JsonProperty("map_number") + public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) private Map mapNumber = new HashMap(); - @JsonProperty("map_integer") + public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) private Map mapInteger = new HashMap(); - @JsonProperty("map_boolean") + public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) private Map mapBoolean = new HashMap(); - @JsonProperty("map_array_integer") + public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) private Map> mapArrayInteger = new HashMap>(); - @JsonProperty("map_array_anytype") + public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) private Map> mapArrayAnytype = new HashMap>(); - @JsonProperty("map_map_string") + public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) private Map> mapMapString = new HashMap>(); - @JsonProperty("map_map_anytype") + public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) private Map> mapMapAnytype = new HashMap>(); - @JsonProperty("anytype_1") + public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + @JsonProperty(JSON_PROPERTY_ANYTYPE1) private Object anytype1 = null; - @JsonProperty("anytype_2") + public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; + @JsonProperty(JSON_PROPERTY_ANYTYPE2) private Object anytype2 = null; - @JsonProperty("anytype_3") + public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; + @JsonProperty(JSON_PROPERTY_ANYTYPE3) private Object anytype3 = null; public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index f27ff011de1..77388b95d86 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 479696fdcef..f0a3318bca1 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index bd569b0da3e..19d772f4522 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 27e03a2313e..09e6431c916 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesString name(String name) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java index dc16717ac32..a2d34d82f47 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java @@ -34,10 +34,12 @@ import io.swagger.annotations.ApiModelProperty; }) public class Animal { - @JsonProperty("className") + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; - @JsonProperty("color") + public static final String JSON_PROPERTY_COLOR = "color"; + @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; public Animal className(String className) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index b670ecb66e4..c3dd85a61ea 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import java.util.List; */ public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = new ArrayList>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 9d6997f88fc..2ae01f1581a 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import java.util.List; */ public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) private List arrayNumber = new ArrayList(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java index 7dc235f0a94..f5968901765 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -29,13 +29,16 @@ import org.openapitools.client.model.ReadOnlyFirst; */ public class ArrayTest { - @JsonProperty("array_of_string") + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) private List arrayOfString = new ArrayList(); - @JsonProperty("array_array_of_integer") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) private List> arrayArrayOfInteger = new ArrayList>(); - @JsonProperty("array_array_of_model") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = new ArrayList>(); public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java index 3f3df29d5da..1d4ebff1533 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Capitalization.java @@ -26,22 +26,28 @@ import io.swagger.annotations.ApiModelProperty; */ public class Capitalization { - @JsonProperty("smallCamel") + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; - @JsonProperty("CapitalCamel") + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; - @JsonProperty("small_Snake") + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; - @JsonProperty("Capital_Snake") + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java index a8108d6f151..11ffa39d982 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Cat.java @@ -28,7 +28,8 @@ import org.openapitools.client.model.CatAllOf; */ public class Cat extends Animal { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java index 42e96146107..1c12b1972cf 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class CatAllOf { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java index 3eccd2cd922..652d69552d1 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Category.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class Category { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; public Category id(Long id) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java index 2aaed27fffd..16036936e7a 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ClassModel.java @@ -27,7 +27,8 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { - @JsonProperty("_class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java index 458e8129602..a5c065a1dd0 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Client.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class Client { - @JsonProperty("client") + public static final String JSON_PROPERTY_CLIENT = "client"; + @JsonProperty(JSON_PROPERTY_CLIENT) private String client; public Client client(String client) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java index 83f5cb0e272..7ac3c33202e 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Dog.java @@ -28,7 +28,8 @@ import org.openapitools.client.model.DogAllOf; */ public class Dog extends Animal { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public Dog breed(String breed) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java index d1e1402789f..b79847a96e4 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class DogAllOf { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java index 368b481f7e5..10b3d358762 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -63,7 +63,8 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -101,7 +102,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) private List arrayEnum = new ArrayList(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java index b365a8a56fe..bde85ff2a09 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/EnumTest.java @@ -64,7 +64,8 @@ public class EnumTest { } } - @JsonProperty("enum_string") + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -104,7 +105,8 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -142,7 +144,8 @@ public class EnumTest { } } - @JsonProperty("enum_integer") + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -180,10 +183,12 @@ public class EnumTest { } } - @JsonProperty("enum_number") + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index ca73764280c..5ce9290bba2 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -28,10 +28,12 @@ import java.util.List; */ public class FileSchemaTestClass { - @JsonProperty("file") + public static final String JSON_PROPERTY_FILE = "file"; + @JsonProperty(JSON_PROPERTY_FILE) private java.io.File file = null; - @JsonProperty("files") + public static final String JSON_PROPERTY_FILES = "files"; + @JsonProperty(JSON_PROPERTY_FILES) private List files = new ArrayList(); public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java index 00d132529e4..509048cd5e9 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/FormatTest.java @@ -31,43 +31,56 @@ import org.threeten.bp.OffsetDateTime; */ public class FormatTest { - @JsonProperty("integer") + public static final String JSON_PROPERTY_INTEGER = "integer"; + @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; - @JsonProperty("int32") + public static final String JSON_PROPERTY_INT32 = "int32"; + @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; - @JsonProperty("int64") + public static final String JSON_PROPERTY_INT64 = "int64"; + @JsonProperty(JSON_PROPERTY_INT64) private Long int64; - @JsonProperty("number") + public static final String JSON_PROPERTY_NUMBER = "number"; + @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; - @JsonProperty("float") + public static final String JSON_PROPERTY_FLOAT = "float"; + @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; - @JsonProperty("double") + public static final String JSON_PROPERTY_DOUBLE = "double"; + @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; - @JsonProperty("string") + public static final String JSON_PROPERTY_STRING = "string"; + @JsonProperty(JSON_PROPERTY_STRING) private String string; - @JsonProperty("byte") + public static final String JSON_PROPERTY_BYTE = "byte"; + @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; - @JsonProperty("binary") + public static final String JSON_PROPERTY_BINARY = "binary"; + @JsonProperty(JSON_PROPERTY_BINARY) private File binary; - @JsonProperty("date") + public static final String JSON_PROPERTY_DATE = "date"; + @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index e9453bb6cce..ad6b28d9d1e 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class HasOnlyReadOnly { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("foo") + public static final String JSON_PROPERTY_FOO = "foo"; + @JsonProperty(JSON_PROPERTY_FOO) private String foo; /** diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java index 44cd694057a..0a57199a714 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MapTest.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class MapTest { - @JsonProperty("map_map_of_string") + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) private Map> mapMapOfString = new HashMap>(); /** @@ -67,13 +68,16 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) private Map mapOfEnumString = new HashMap(); - @JsonProperty("direct_map") + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) private Map directMap = new HashMap(); - @JsonProperty("indirect_map") + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) private Map indirectMap = new HashMap(); public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 19d808093c9..df68b7d4188 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -32,13 +32,16 @@ import org.threeten.bp.OffsetDateTime; */ public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") + public static final String JSON_PROPERTY_MAP = "map"; + @JsonProperty(JSON_PROPERTY_MAP) private Map map = new HashMap(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java index 39fabeeb6da..d86df5d7eab 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Model200Response.java @@ -27,10 +27,12 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model name starting with number") public class Model200Response { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java index bb334129511..4c9a7f87b5a 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -26,13 +26,16 @@ import io.swagger.annotations.ApiModelProperty; */ public class ModelApiResponse { - @JsonProperty("code") + public static final String JSON_PROPERTY_CODE = "code"; + @JsonProperty(JSON_PROPERTY_CODE) private Integer code; - @JsonProperty("type") + public static final String JSON_PROPERTY_TYPE = "type"; + @JsonProperty(JSON_PROPERTY_TYPE) private String type; - @JsonProperty("message") + public static final String JSON_PROPERTY_MESSAGE = "message"; + @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java index 9aafb13e04d..9c9ac21a3fb 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -27,7 +27,8 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing reserved words") public class ModelReturn { - @JsonProperty("return") + public static final String JSON_PROPERTY_RETURN = "return"; + @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java index 9518276dd61..47f89c54361 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Name.java @@ -27,16 +27,20 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model name same as property name") public class Name { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("snake_case") + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; - @JsonProperty("property") + public static final String JSON_PROPERTY_PROPERTY = "property"; + @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; - @JsonProperty("123Number") + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; public Name name(Integer name) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java index 0245e8e2109..f5331da226e 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -27,7 +27,8 @@ import java.math.BigDecimal; */ public class NumberOnly { - @JsonProperty("JustNumber") + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java index a9e2986a2fe..0d6bc154e46 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Order.java @@ -27,16 +27,20 @@ import org.threeten.bp.OffsetDateTime; */ public class Order { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("petId") + public static final String JSON_PROPERTY_PET_ID = "petId"; + @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; - @JsonProperty("quantity") + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; - @JsonProperty("shipDate") + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -76,10 +80,12 @@ public class Order { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; - @JsonProperty("complete") + public static final String JSON_PROPERTY_COMPLETE = "complete"; + @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; public Order id(Long id) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java index c8bd99011c0..7193ba2a0c9 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -27,13 +27,16 @@ import java.math.BigDecimal; */ public class OuterComposite { - @JsonProperty("my_number") + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; - @JsonProperty("my_string") + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; - @JsonProperty("my_boolean") + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java index a7d92129d73..b907822ed01 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java @@ -30,19 +30,24 @@ import org.openapitools.client.model.Tag; */ public class Pet { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("category") + public static final String JSON_PROPERTY_CATEGORY = "category"; + @JsonProperty(JSON_PROPERTY_CATEGORY) private Category category = null; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; - @JsonProperty("photoUrls") + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList(); - @JsonProperty("tags") + public static final String JSON_PROPERTY_TAGS = "tags"; + @JsonProperty(JSON_PROPERTY_TAGS) private List tags = new ArrayList(); /** @@ -82,7 +87,8 @@ public class Pet { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public Pet id(Long id) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 1379ee09ea6..b0949b9e2ea 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class ReadOnlyFirst { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("baz") + public static final String JSON_PROPERTY_BAZ = "baz"; + @JsonProperty(JSON_PROPERTY_BAZ) private String baz; /** diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java index 869771afad8..a9d03234061 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class SpecialModelName { - @JsonProperty("$special[property.name]") + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java index 4bb498aff43..45f17b22cf3 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Tag.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class Tag { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public Tag id(Long id) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 9d0f5b2fbea..0961f776fb0 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -29,19 +29,24 @@ import java.util.List; */ public class TypeHolderDefault { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 94d3c57b6f2..3617c5c16b2 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -29,19 +29,24 @@ import java.util.List; */ public class TypeHolderExample { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java index 73164c3ee28..9ce7869e755 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/User.java @@ -26,28 +26,36 @@ import io.swagger.annotations.ApiModelProperty; */ public class User { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("username") + public static final String JSON_PROPERTY_USERNAME = "username"; + @JsonProperty(JSON_PROPERTY_USERNAME) private String username; - @JsonProperty("firstName") + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; - @JsonProperty("lastName") + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; - @JsonProperty("email") + public static final String JSON_PROPERTY_EMAIL = "email"; + @JsonProperty(JSON_PROPERTY_EMAIL) private String email; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; - @JsonProperty("phone") + public static final String JSON_PROPERTY_PHONE = "phone"; + @JsonProperty(JSON_PROPERTY_PHONE) private String phone; - @JsonProperty("userStatus") + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; public User id(Long id) { diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java index 9032c234249..151939d6054 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/XmlItem.java @@ -29,91 +29,120 @@ import java.util.List; */ public class XmlItem { - @JsonProperty("attribute_string") + public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; - @JsonProperty("attribute_number") + public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; - @JsonProperty("attribute_integer") + public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; - @JsonProperty("attribute_boolean") + public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; - @JsonProperty("wrapped_array") + public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) private List wrappedArray = new ArrayList(); - @JsonProperty("name_string") + public static final String JSON_PROPERTY_NAME_STRING = "name_string"; + @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; - @JsonProperty("name_number") + public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; - @JsonProperty("name_integer") + public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; - @JsonProperty("name_boolean") + public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; - @JsonProperty("name_array") + public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) private List nameArray = new ArrayList(); - @JsonProperty("name_wrapped_array") + public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) private List nameWrappedArray = new ArrayList(); - @JsonProperty("prefix_string") + public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; - @JsonProperty("prefix_number") + public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; - @JsonProperty("prefix_integer") + public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; - @JsonProperty("prefix_boolean") + public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; - @JsonProperty("prefix_array") + public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) private List prefixArray = new ArrayList(); - @JsonProperty("prefix_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) private List prefixWrappedArray = new ArrayList(); - @JsonProperty("namespace_string") + public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; - @JsonProperty("namespace_number") + public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; - @JsonProperty("namespace_integer") + public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; - @JsonProperty("namespace_boolean") + public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; - @JsonProperty("namespace_array") + public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) private List namespaceArray = new ArrayList(); - @JsonProperty("namespace_wrapped_array") + public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) private List namespaceWrappedArray = new ArrayList(); - @JsonProperty("prefix_ns_string") + public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; - @JsonProperty("prefix_ns_number") + public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; - @JsonProperty("prefix_ns_integer") + public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; - @JsonProperty("prefix_ns_boolean") + public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; - @JsonProperty("prefix_ns_array") + public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) private List prefixNsArray = new ArrayList(); - @JsonProperty("prefix_ns_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) private List prefixNsWrappedArray = new ArrayList(); public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 81251713a1b..0bfee143bd0 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -27,7 +27,8 @@ import java.util.Map; */ public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index bdf5c625dd5..f51b8f38d8c 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index eccc9e9d3ca..53ebe2970a8 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -27,7 +27,8 @@ import java.util.Map; */ public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 9209ce67b6a..b7c42f156b0 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -29,37 +29,48 @@ import java.util.Map; */ public class AdditionalPropertiesClass { - @JsonProperty("map_string") + public static final String JSON_PROPERTY_MAP_STRING = "map_string"; + @JsonProperty(JSON_PROPERTY_MAP_STRING) private Map mapString = new HashMap(); - @JsonProperty("map_number") + public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) private Map mapNumber = new HashMap(); - @JsonProperty("map_integer") + public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) private Map mapInteger = new HashMap(); - @JsonProperty("map_boolean") + public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) private Map mapBoolean = new HashMap(); - @JsonProperty("map_array_integer") + public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) private Map> mapArrayInteger = new HashMap>(); - @JsonProperty("map_array_anytype") + public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) private Map> mapArrayAnytype = new HashMap>(); - @JsonProperty("map_map_string") + public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) private Map> mapMapString = new HashMap>(); - @JsonProperty("map_map_anytype") + public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) private Map> mapMapAnytype = new HashMap>(); - @JsonProperty("anytype_1") + public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + @JsonProperty(JSON_PROPERTY_ANYTYPE1) private Object anytype1 = null; - @JsonProperty("anytype_2") + public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; + @JsonProperty(JSON_PROPERTY_ANYTYPE2) private Object anytype2 = null; - @JsonProperty("anytype_3") + public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; + @JsonProperty(JSON_PROPERTY_ANYTYPE3) private Object anytype3 = null; public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index da252b12fa4..ccac73ddc49 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -27,7 +27,8 @@ import java.util.Map; */ public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 25e752c5881..4dd532b0cbe 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index b5a5fed844c..d195a95e58a 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -27,7 +27,8 @@ import java.util.Map; */ public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 247d3242dd3..018ad67c0c0 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -27,7 +27,8 @@ import java.util.Map; */ public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesString name(String name) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java index e7f76c2f91c..71f7e8f78b7 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java @@ -33,10 +33,12 @@ import io.swagger.annotations.ApiModelProperty; }) public class Animal { - @JsonProperty("className") + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; - @JsonProperty("color") + public static final String JSON_PROPERTY_COLOR = "color"; + @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; public Animal className(String className) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index dbf11f2b6d4..176df67c408 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -28,7 +28,8 @@ import java.util.List; */ public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = new ArrayList>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index d35a9d27441..22639d70847 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -28,7 +28,8 @@ import java.util.List; */ public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) private List arrayNumber = new ArrayList(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ArrayTest.java index 0a28291d775..27812394026 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -28,13 +28,16 @@ import org.openapitools.client.model.ReadOnlyFirst; */ public class ArrayTest { - @JsonProperty("array_of_string") + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) private List arrayOfString = new ArrayList(); - @JsonProperty("array_array_of_integer") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) private List> arrayArrayOfInteger = new ArrayList>(); - @JsonProperty("array_array_of_model") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = new ArrayList>(); public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Capitalization.java index b8a614a204a..6aa53f91bd3 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Capitalization.java @@ -25,22 +25,28 @@ import io.swagger.annotations.ApiModelProperty; */ public class Capitalization { - @JsonProperty("smallCamel") + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; - @JsonProperty("CapitalCamel") + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; - @JsonProperty("small_Snake") + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; - @JsonProperty("Capital_Snake") + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Cat.java index 6cc1276b4e2..2569c2291e7 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Cat.java @@ -27,7 +27,8 @@ import org.openapitools.client.model.CatAllOf; */ public class Cat extends Animal { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/CatAllOf.java index a791dc55f92..756bf15de7a 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -25,7 +25,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class CatAllOf { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Category.java index 6fefcefbe47..f03394e6706 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Category.java @@ -25,10 +25,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class Category { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; public Category id(Long id) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ClassModel.java index a6bfab63ee3..44306019f16 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ClassModel.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { - @JsonProperty("_class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Client.java index 68d7f4fb553..7458e3c2e09 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Client.java @@ -25,7 +25,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class Client { - @JsonProperty("client") + public static final String JSON_PROPERTY_CLIENT = "client"; + @JsonProperty(JSON_PROPERTY_CLIENT) private String client; public Client client(String client) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Dog.java index 1cbee958a06..4c285963ab5 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Dog.java @@ -27,7 +27,8 @@ import org.openapitools.client.model.DogAllOf; */ public class Dog extends Animal { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public Dog breed(String breed) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/DogAllOf.java index ad09ae505a2..455ed741f88 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -25,7 +25,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class DogAllOf { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/EnumArrays.java index 0b8fc89b056..28a1f53dfe6 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -62,7 +62,8 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -100,7 +101,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) private List arrayEnum = new ArrayList(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/EnumTest.java index 00045150929..5269ae8dc17 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/EnumTest.java @@ -63,7 +63,8 @@ public class EnumTest { } } - @JsonProperty("enum_string") + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -103,7 +104,8 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -141,7 +143,8 @@ public class EnumTest { } } - @JsonProperty("enum_integer") + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -179,10 +182,12 @@ public class EnumTest { } } - @JsonProperty("enum_number") + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 5f2b12d45ca..3d72f256606 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -27,10 +27,12 @@ import java.util.List; */ public class FileSchemaTestClass { - @JsonProperty("file") + public static final String JSON_PROPERTY_FILE = "file"; + @JsonProperty(JSON_PROPERTY_FILE) private java.io.File file = null; - @JsonProperty("files") + public static final String JSON_PROPERTY_FILES = "files"; + @JsonProperty(JSON_PROPERTY_FILES) private List files = new ArrayList(); public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/FormatTest.java index fee5939f4f0..d8de4d3ee26 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/FormatTest.java @@ -30,43 +30,56 @@ import org.threeten.bp.OffsetDateTime; */ public class FormatTest { - @JsonProperty("integer") + public static final String JSON_PROPERTY_INTEGER = "integer"; + @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; - @JsonProperty("int32") + public static final String JSON_PROPERTY_INT32 = "int32"; + @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; - @JsonProperty("int64") + public static final String JSON_PROPERTY_INT64 = "int64"; + @JsonProperty(JSON_PROPERTY_INT64) private Long int64; - @JsonProperty("number") + public static final String JSON_PROPERTY_NUMBER = "number"; + @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; - @JsonProperty("float") + public static final String JSON_PROPERTY_FLOAT = "float"; + @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; - @JsonProperty("double") + public static final String JSON_PROPERTY_DOUBLE = "double"; + @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; - @JsonProperty("string") + public static final String JSON_PROPERTY_STRING = "string"; + @JsonProperty(JSON_PROPERTY_STRING) private String string; - @JsonProperty("byte") + public static final String JSON_PROPERTY_BYTE = "byte"; + @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; - @JsonProperty("binary") + public static final String JSON_PROPERTY_BINARY = "binary"; + @JsonProperty(JSON_PROPERTY_BINARY) private File binary; - @JsonProperty("date") + public static final String JSON_PROPERTY_DATE = "date"; + @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 7581f7ba566..fb81f00f744 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -25,10 +25,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class HasOnlyReadOnly { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("foo") + public static final String JSON_PROPERTY_FOO = "foo"; + @JsonProperty(JSON_PROPERTY_FOO) private String foo; /** diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/MapTest.java index da931e47944..3571c0ba8fb 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/MapTest.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class MapTest { - @JsonProperty("map_map_of_string") + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) private Map> mapMapOfString = new HashMap>(); /** @@ -66,13 +67,16 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) private Map mapOfEnumString = new HashMap(); - @JsonProperty("direct_map") + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) private Map directMap = new HashMap(); - @JsonProperty("indirect_map") + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) private Map indirectMap = new HashMap(); public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index bb7fce83834..0d072045430 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -31,13 +31,16 @@ import org.threeten.bp.OffsetDateTime; */ public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") + public static final String JSON_PROPERTY_MAP = "map"; + @JsonProperty(JSON_PROPERTY_MAP) private Map map = new HashMap(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Model200Response.java index 2d258ffec39..7164ae194c2 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Model200Response.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model name starting with number") public class Model200Response { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 63ccaa32f20..470ca0c2017 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -25,13 +25,16 @@ import io.swagger.annotations.ApiModelProperty; */ public class ModelApiResponse { - @JsonProperty("code") + public static final String JSON_PROPERTY_CODE = "code"; + @JsonProperty(JSON_PROPERTY_CODE) private Integer code; - @JsonProperty("type") + public static final String JSON_PROPERTY_TYPE = "type"; + @JsonProperty(JSON_PROPERTY_TYPE) private String type; - @JsonProperty("message") + public static final String JSON_PROPERTY_MESSAGE = "message"; + @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ModelReturn.java index ab17739908c..fe8184f4b8e 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing reserved words") public class ModelReturn { - @JsonProperty("return") + public static final String JSON_PROPERTY_RETURN = "return"; + @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Name.java index 0774790c958..1eeadbba273 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Name.java @@ -26,16 +26,20 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model name same as property name") public class Name { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("snake_case") + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; - @JsonProperty("property") + public static final String JSON_PROPERTY_PROPERTY = "property"; + @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; - @JsonProperty("123Number") + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; public Name name(Integer name) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/NumberOnly.java index 85268b9b7cb..c6540f9f4db 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -26,7 +26,8 @@ import java.math.BigDecimal; */ public class NumberOnly { - @JsonProperty("JustNumber") + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Order.java index 8be8f68b6c4..d8976f540b1 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Order.java @@ -26,16 +26,20 @@ import org.threeten.bp.OffsetDateTime; */ public class Order { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("petId") + public static final String JSON_PROPERTY_PET_ID = "petId"; + @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; - @JsonProperty("quantity") + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; - @JsonProperty("shipDate") + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -75,10 +79,12 @@ public class Order { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; - @JsonProperty("complete") + public static final String JSON_PROPERTY_COMPLETE = "complete"; + @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; public Order id(Long id) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/OuterComposite.java index a8dc2ee33d5..34bb1dd5d25 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -26,13 +26,16 @@ import java.math.BigDecimal; */ public class OuterComposite { - @JsonProperty("my_number") + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; - @JsonProperty("my_string") + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; - @JsonProperty("my_boolean") + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Pet.java index 914b9b14437..bd7afd3acdf 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Pet.java @@ -29,19 +29,24 @@ import org.openapitools.client.model.Tag; */ public class Pet { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("category") + public static final String JSON_PROPERTY_CATEGORY = "category"; + @JsonProperty(JSON_PROPERTY_CATEGORY) private Category category = null; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; - @JsonProperty("photoUrls") + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList(); - @JsonProperty("tags") + public static final String JSON_PROPERTY_TAGS = "tags"; + @JsonProperty(JSON_PROPERTY_TAGS) private List tags = new ArrayList(); /** @@ -81,7 +86,8 @@ public class Pet { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public Pet id(Long id) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 81e19eda7c1..24177a70be5 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -25,10 +25,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class ReadOnlyFirst { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("baz") + public static final String JSON_PROPERTY_BAZ = "baz"; + @JsonProperty(JSON_PROPERTY_BAZ) private String baz; /** diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/SpecialModelName.java index e3b9f1a1870..30d01ba0b89 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -25,7 +25,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class SpecialModelName { - @JsonProperty("$special[property.name]") + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Tag.java index 8eaa60d84e6..2fe5dce3585 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Tag.java @@ -25,10 +25,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class Tag { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public Tag id(Long id) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 113b0da0aef..4160934f735 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -28,19 +28,24 @@ import java.util.List; */ public class TypeHolderDefault { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 8c48c33c63e..4b517c141b0 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -28,19 +28,24 @@ import java.util.List; */ public class TypeHolderExample { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/User.java index f4745a2b17c..e97f002a2ff 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/User.java @@ -25,28 +25,36 @@ import io.swagger.annotations.ApiModelProperty; */ public class User { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("username") + public static final String JSON_PROPERTY_USERNAME = "username"; + @JsonProperty(JSON_PROPERTY_USERNAME) private String username; - @JsonProperty("firstName") + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; - @JsonProperty("lastName") + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; - @JsonProperty("email") + public static final String JSON_PROPERTY_EMAIL = "email"; + @JsonProperty(JSON_PROPERTY_EMAIL) private String email; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; - @JsonProperty("phone") + public static final String JSON_PROPERTY_PHONE = "phone"; + @JsonProperty(JSON_PROPERTY_PHONE) private String phone; - @JsonProperty("userStatus") + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; public User id(Long id) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/XmlItem.java index 730742019f3..3b81f60d6d2 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/XmlItem.java @@ -28,91 +28,120 @@ import java.util.List; */ public class XmlItem { - @JsonProperty("attribute_string") + public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; - @JsonProperty("attribute_number") + public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; - @JsonProperty("attribute_integer") + public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; - @JsonProperty("attribute_boolean") + public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; - @JsonProperty("wrapped_array") + public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) private List wrappedArray = new ArrayList(); - @JsonProperty("name_string") + public static final String JSON_PROPERTY_NAME_STRING = "name_string"; + @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; - @JsonProperty("name_number") + public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; - @JsonProperty("name_integer") + public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; - @JsonProperty("name_boolean") + public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; - @JsonProperty("name_array") + public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) private List nameArray = new ArrayList(); - @JsonProperty("name_wrapped_array") + public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) private List nameWrappedArray = new ArrayList(); - @JsonProperty("prefix_string") + public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; - @JsonProperty("prefix_number") + public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; - @JsonProperty("prefix_integer") + public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; - @JsonProperty("prefix_boolean") + public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; - @JsonProperty("prefix_array") + public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) private List prefixArray = new ArrayList(); - @JsonProperty("prefix_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) private List prefixWrappedArray = new ArrayList(); - @JsonProperty("namespace_string") + public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; - @JsonProperty("namespace_number") + public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; - @JsonProperty("namespace_integer") + public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; - @JsonProperty("namespace_boolean") + public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; - @JsonProperty("namespace_array") + public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) private List namespaceArray = new ArrayList(); - @JsonProperty("namespace_wrapped_array") + public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) private List namespaceWrappedArray = new ArrayList(); - @JsonProperty("prefix_ns_string") + public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; - @JsonProperty("prefix_ns_number") + public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; - @JsonProperty("prefix_ns_integer") + public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; - @JsonProperty("prefix_ns_boolean") + public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; - @JsonProperty("prefix_ns_array") + public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) private List prefixNsArray = new ArrayList(); - @JsonProperty("prefix_ns_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) private List prefixNsWrappedArray = new ArrayList(); public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 69d6a817294..0df18c37e39 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 0147a592b7e..0d9a6b14532 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 89aa511c2a8..8e85a1f2246 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index ecb4e102ea2..dc8ea1e9ec3 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -30,37 +30,48 @@ import java.util.Map; */ public class AdditionalPropertiesClass { - @JsonProperty("map_string") + public static final String JSON_PROPERTY_MAP_STRING = "map_string"; + @JsonProperty(JSON_PROPERTY_MAP_STRING) private Map mapString = new HashMap<>(); - @JsonProperty("map_number") + public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) private Map mapNumber = new HashMap<>(); - @JsonProperty("map_integer") + public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) private Map mapInteger = new HashMap<>(); - @JsonProperty("map_boolean") + public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) private Map mapBoolean = new HashMap<>(); - @JsonProperty("map_array_integer") + public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) private Map> mapArrayInteger = new HashMap<>(); - @JsonProperty("map_array_anytype") + public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) private Map> mapArrayAnytype = new HashMap<>(); - @JsonProperty("map_map_string") + public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) private Map> mapMapString = new HashMap<>(); - @JsonProperty("map_map_anytype") + public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) private Map> mapMapAnytype = new HashMap<>(); - @JsonProperty("anytype_1") + public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + @JsonProperty(JSON_PROPERTY_ANYTYPE1) private Object anytype1 = null; - @JsonProperty("anytype_2") + public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; + @JsonProperty(JSON_PROPERTY_ANYTYPE2) private Object anytype2 = null; - @JsonProperty("anytype_3") + public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; + @JsonProperty(JSON_PROPERTY_ANYTYPE3) private Object anytype3 = null; public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index f27ff011de1..77388b95d86 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 479696fdcef..f0a3318bca1 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index bd569b0da3e..19d772f4522 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 27e03a2313e..09e6431c916 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesString name(String name) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java index dc16717ac32..a2d34d82f47 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java @@ -34,10 +34,12 @@ import io.swagger.annotations.ApiModelProperty; }) public class Animal { - @JsonProperty("className") + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; - @JsonProperty("color") + public static final String JSON_PROPERTY_COLOR = "color"; + @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; public Animal className(String className) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 66e9fba5d75..ce83908187a 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import java.util.List; */ public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 9f5b467a314..ad502738c10 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import java.util.List; */ public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java index 7ac67880894..d0c2fc409c5 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -29,13 +29,16 @@ import org.openapitools.client.model.ReadOnlyFirst; */ public class ArrayTest { - @JsonProperty("array_of_string") + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) private List arrayOfString = new ArrayList<>(); - @JsonProperty("array_array_of_integer") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) private List> arrayArrayOfInteger = new ArrayList<>(); - @JsonProperty("array_array_of_model") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java index 3f3df29d5da..1d4ebff1533 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Capitalization.java @@ -26,22 +26,28 @@ import io.swagger.annotations.ApiModelProperty; */ public class Capitalization { - @JsonProperty("smallCamel") + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; - @JsonProperty("CapitalCamel") + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; - @JsonProperty("small_Snake") + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; - @JsonProperty("Capital_Snake") + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java index a8108d6f151..11ffa39d982 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Cat.java @@ -28,7 +28,8 @@ import org.openapitools.client.model.CatAllOf; */ public class Cat extends Animal { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java index 42e96146107..1c12b1972cf 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class CatAllOf { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java index 3eccd2cd922..652d69552d1 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Category.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class Category { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; public Category id(Long id) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java index 2aaed27fffd..16036936e7a 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ClassModel.java @@ -27,7 +27,8 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { - @JsonProperty("_class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java index 458e8129602..a5c065a1dd0 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Client.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class Client { - @JsonProperty("client") + public static final String JSON_PROPERTY_CLIENT = "client"; + @JsonProperty(JSON_PROPERTY_CLIENT) private String client; public Client client(String client) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java index 83f5cb0e272..7ac3c33202e 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Dog.java @@ -28,7 +28,8 @@ import org.openapitools.client.model.DogAllOf; */ public class Dog extends Animal { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public Dog breed(String breed) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java index d1e1402789f..b79847a96e4 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class DogAllOf { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java index a3bd1af4725..2db426ab8bf 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -63,7 +63,8 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -101,7 +102,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java index b365a8a56fe..bde85ff2a09 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java @@ -64,7 +64,8 @@ public class EnumTest { } } - @JsonProperty("enum_string") + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -104,7 +105,8 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -142,7 +144,8 @@ public class EnumTest { } } - @JsonProperty("enum_integer") + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -180,10 +183,12 @@ public class EnumTest { } } - @JsonProperty("enum_number") + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index ad8cf751e11..2c247d819ce 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -28,10 +28,12 @@ import java.util.List; */ public class FileSchemaTestClass { - @JsonProperty("file") + public static final String JSON_PROPERTY_FILE = "file"; + @JsonProperty(JSON_PROPERTY_FILE) private java.io.File file = null; - @JsonProperty("files") + public static final String JSON_PROPERTY_FILES = "files"; + @JsonProperty(JSON_PROPERTY_FILES) private List files = new ArrayList<>(); public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java index 8d075e26bad..1b9426d9ab6 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java @@ -31,43 +31,56 @@ import java.util.UUID; */ public class FormatTest { - @JsonProperty("integer") + public static final String JSON_PROPERTY_INTEGER = "integer"; + @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; - @JsonProperty("int32") + public static final String JSON_PROPERTY_INT32 = "int32"; + @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; - @JsonProperty("int64") + public static final String JSON_PROPERTY_INT64 = "int64"; + @JsonProperty(JSON_PROPERTY_INT64) private Long int64; - @JsonProperty("number") + public static final String JSON_PROPERTY_NUMBER = "number"; + @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; - @JsonProperty("float") + public static final String JSON_PROPERTY_FLOAT = "float"; + @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; - @JsonProperty("double") + public static final String JSON_PROPERTY_DOUBLE = "double"; + @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; - @JsonProperty("string") + public static final String JSON_PROPERTY_STRING = "string"; + @JsonProperty(JSON_PROPERTY_STRING) private String string; - @JsonProperty("byte") + public static final String JSON_PROPERTY_BYTE = "byte"; + @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; - @JsonProperty("binary") + public static final String JSON_PROPERTY_BINARY = "binary"; + @JsonProperty(JSON_PROPERTY_BINARY) private File binary; - @JsonProperty("date") + public static final String JSON_PROPERTY_DATE = "date"; + @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index e9453bb6cce..ad6b28d9d1e 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class HasOnlyReadOnly { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("foo") + public static final String JSON_PROPERTY_FOO = "foo"; + @JsonProperty(JSON_PROPERTY_FOO) private String foo; /** diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java index b0d3e04bb63..021d59d2570 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class MapTest { - @JsonProperty("map_map_of_string") + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) private Map> mapMapOfString = new HashMap<>(); /** @@ -67,13 +68,16 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) private Map mapOfEnumString = new HashMap<>(); - @JsonProperty("direct_map") + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) private Map directMap = new HashMap<>(); - @JsonProperty("indirect_map") + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index fed78a2162f..ad173f004a1 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -32,13 +32,16 @@ import org.openapitools.client.model.Animal; */ public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") + public static final String JSON_PROPERTY_MAP = "map"; + @JsonProperty(JSON_PROPERTY_MAP) private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java index 39fabeeb6da..d86df5d7eab 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java @@ -27,10 +27,12 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model name starting with number") public class Model200Response { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java index bb334129511..4c9a7f87b5a 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -26,13 +26,16 @@ import io.swagger.annotations.ApiModelProperty; */ public class ModelApiResponse { - @JsonProperty("code") + public static final String JSON_PROPERTY_CODE = "code"; + @JsonProperty(JSON_PROPERTY_CODE) private Integer code; - @JsonProperty("type") + public static final String JSON_PROPERTY_TYPE = "type"; + @JsonProperty(JSON_PROPERTY_TYPE) private String type; - @JsonProperty("message") + public static final String JSON_PROPERTY_MESSAGE = "message"; + @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java index 9aafb13e04d..9c9ac21a3fb 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -27,7 +27,8 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing reserved words") public class ModelReturn { - @JsonProperty("return") + public static final String JSON_PROPERTY_RETURN = "return"; + @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java index 9518276dd61..47f89c54361 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java @@ -27,16 +27,20 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model name same as property name") public class Name { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("snake_case") + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; - @JsonProperty("property") + public static final String JSON_PROPERTY_PROPERTY = "property"; + @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; - @JsonProperty("123Number") + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; public Name name(Integer name) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java index 0245e8e2109..f5331da226e 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -27,7 +27,8 @@ import java.math.BigDecimal; */ public class NumberOnly { - @JsonProperty("JustNumber") + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java index 594c76e484d..0730133f9cb 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java @@ -27,16 +27,20 @@ import java.time.OffsetDateTime; */ public class Order { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("petId") + public static final String JSON_PROPERTY_PET_ID = "petId"; + @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; - @JsonProperty("quantity") + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; - @JsonProperty("shipDate") + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -76,10 +80,12 @@ public class Order { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; - @JsonProperty("complete") + public static final String JSON_PROPERTY_COMPLETE = "complete"; + @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; public Order id(Long id) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java index c8bd99011c0..7193ba2a0c9 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -27,13 +27,16 @@ import java.math.BigDecimal; */ public class OuterComposite { - @JsonProperty("my_number") + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; - @JsonProperty("my_string") + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; - @JsonProperty("my_boolean") + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java index 08f37737561..b8e18631bf1 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java @@ -30,19 +30,24 @@ import org.openapitools.client.model.Tag; */ public class Pet { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("category") + public static final String JSON_PROPERTY_CATEGORY = "category"; + @JsonProperty(JSON_PROPERTY_CATEGORY) private Category category = null; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; - @JsonProperty("photoUrls") + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList<>(); - @JsonProperty("tags") + public static final String JSON_PROPERTY_TAGS = "tags"; + @JsonProperty(JSON_PROPERTY_TAGS) private List tags = new ArrayList<>(); /** @@ -82,7 +87,8 @@ public class Pet { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public Pet id(Long id) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 1379ee09ea6..b0949b9e2ea 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class ReadOnlyFirst { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("baz") + public static final String JSON_PROPERTY_BAZ = "baz"; + @JsonProperty(JSON_PROPERTY_BAZ) private String baz; /** diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java index 869771afad8..a9d03234061 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class SpecialModelName { - @JsonProperty("$special[property.name]") + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java index 4bb498aff43..45f17b22cf3 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class Tag { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public Tag id(Long id) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 3c6488d270a..3f3030998f1 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -29,19 +29,24 @@ import java.util.List; */ public class TypeHolderDefault { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 812b5839aa5..99ddaa8d2eb 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -29,19 +29,24 @@ import java.util.List; */ public class TypeHolderExample { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java index 73164c3ee28..9ce7869e755 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java @@ -26,28 +26,36 @@ import io.swagger.annotations.ApiModelProperty; */ public class User { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("username") + public static final String JSON_PROPERTY_USERNAME = "username"; + @JsonProperty(JSON_PROPERTY_USERNAME) private String username; - @JsonProperty("firstName") + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; - @JsonProperty("lastName") + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; - @JsonProperty("email") + public static final String JSON_PROPERTY_EMAIL = "email"; + @JsonProperty(JSON_PROPERTY_EMAIL) private String email; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; - @JsonProperty("phone") + public static final String JSON_PROPERTY_PHONE = "phone"; + @JsonProperty(JSON_PROPERTY_PHONE) private String phone; - @JsonProperty("userStatus") + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; public User id(Long id) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java index aa7ff22ccde..66404193208 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/XmlItem.java @@ -29,91 +29,120 @@ import java.util.List; */ public class XmlItem { - @JsonProperty("attribute_string") + public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; - @JsonProperty("attribute_number") + public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; - @JsonProperty("attribute_integer") + public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; - @JsonProperty("attribute_boolean") + public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; - @JsonProperty("wrapped_array") + public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) private List wrappedArray = new ArrayList<>(); - @JsonProperty("name_string") + public static final String JSON_PROPERTY_NAME_STRING = "name_string"; + @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; - @JsonProperty("name_number") + public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; - @JsonProperty("name_integer") + public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; - @JsonProperty("name_boolean") + public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; - @JsonProperty("name_array") + public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) private List nameArray = new ArrayList<>(); - @JsonProperty("name_wrapped_array") + public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) private List nameWrappedArray = new ArrayList<>(); - @JsonProperty("prefix_string") + public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; - @JsonProperty("prefix_number") + public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; - @JsonProperty("prefix_integer") + public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; - @JsonProperty("prefix_boolean") + public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; - @JsonProperty("prefix_array") + public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) private List prefixArray = new ArrayList<>(); - @JsonProperty("prefix_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) private List prefixWrappedArray = new ArrayList<>(); - @JsonProperty("namespace_string") + public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; - @JsonProperty("namespace_number") + public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; - @JsonProperty("namespace_integer") + public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; - @JsonProperty("namespace_boolean") + public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; - @JsonProperty("namespace_array") + public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) private List namespaceArray = new ArrayList<>(); - @JsonProperty("namespace_wrapped_array") + public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) private List namespaceWrappedArray = new ArrayList<>(); - @JsonProperty("prefix_ns_string") + public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; - @JsonProperty("prefix_ns_number") + public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; - @JsonProperty("prefix_ns_integer") + public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; - @JsonProperty("prefix_ns_boolean") + public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; - @JsonProperty("prefix_ns_array") + public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) private List prefixNsArray = new ArrayList<>(); - @JsonProperty("prefix_ns_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 69d6a817294..0df18c37e39 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 0147a592b7e..0d9a6b14532 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 89aa511c2a8..8e85a1f2246 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index cb955d1165a..cf0854acd00 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -30,37 +30,48 @@ import java.util.Map; */ public class AdditionalPropertiesClass { - @JsonProperty("map_string") + public static final String JSON_PROPERTY_MAP_STRING = "map_string"; + @JsonProperty(JSON_PROPERTY_MAP_STRING) private Map mapString = new HashMap(); - @JsonProperty("map_number") + public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) private Map mapNumber = new HashMap(); - @JsonProperty("map_integer") + public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) private Map mapInteger = new HashMap(); - @JsonProperty("map_boolean") + public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) private Map mapBoolean = new HashMap(); - @JsonProperty("map_array_integer") + public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) private Map> mapArrayInteger = new HashMap>(); - @JsonProperty("map_array_anytype") + public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) private Map> mapArrayAnytype = new HashMap>(); - @JsonProperty("map_map_string") + public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) private Map> mapMapString = new HashMap>(); - @JsonProperty("map_map_anytype") + public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) private Map> mapMapAnytype = new HashMap>(); - @JsonProperty("anytype_1") + public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + @JsonProperty(JSON_PROPERTY_ANYTYPE1) private Object anytype1 = null; - @JsonProperty("anytype_2") + public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; + @JsonProperty(JSON_PROPERTY_ANYTYPE2) private Object anytype2 = null; - @JsonProperty("anytype_3") + public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; + @JsonProperty(JSON_PROPERTY_ANYTYPE3) private Object anytype3 = null; public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index f27ff011de1..77388b95d86 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 479696fdcef..f0a3318bca1 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index bd569b0da3e..19d772f4522 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 27e03a2313e..09e6431c916 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesString name(String name) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java index dc16717ac32..a2d34d82f47 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java @@ -34,10 +34,12 @@ import io.swagger.annotations.ApiModelProperty; }) public class Animal { - @JsonProperty("className") + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; - @JsonProperty("color") + public static final String JSON_PROPERTY_COLOR = "color"; + @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; public Animal className(String className) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index b670ecb66e4..c3dd85a61ea 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import java.util.List; */ public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = new ArrayList>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 9d6997f88fc..2ae01f1581a 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import java.util.List; */ public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) private List arrayNumber = new ArrayList(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ArrayTest.java index 7dc235f0a94..f5968901765 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -29,13 +29,16 @@ import org.openapitools.client.model.ReadOnlyFirst; */ public class ArrayTest { - @JsonProperty("array_of_string") + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) private List arrayOfString = new ArrayList(); - @JsonProperty("array_array_of_integer") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) private List> arrayArrayOfInteger = new ArrayList>(); - @JsonProperty("array_array_of_model") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = new ArrayList>(); public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Capitalization.java index 3f3df29d5da..1d4ebff1533 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Capitalization.java @@ -26,22 +26,28 @@ import io.swagger.annotations.ApiModelProperty; */ public class Capitalization { - @JsonProperty("smallCamel") + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; - @JsonProperty("CapitalCamel") + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; - @JsonProperty("small_Snake") + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; - @JsonProperty("Capital_Snake") + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Cat.java index a8108d6f151..11ffa39d982 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Cat.java @@ -28,7 +28,8 @@ import org.openapitools.client.model.CatAllOf; */ public class Cat extends Animal { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/CatAllOf.java index 42e96146107..1c12b1972cf 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class CatAllOf { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Category.java index 3eccd2cd922..652d69552d1 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Category.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class Category { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; public Category id(Long id) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ClassModel.java index 2aaed27fffd..16036936e7a 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ClassModel.java @@ -27,7 +27,8 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { - @JsonProperty("_class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Client.java index 458e8129602..a5c065a1dd0 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Client.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class Client { - @JsonProperty("client") + public static final String JSON_PROPERTY_CLIENT = "client"; + @JsonProperty(JSON_PROPERTY_CLIENT) private String client; public Client client(String client) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Dog.java index 83f5cb0e272..7ac3c33202e 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Dog.java @@ -28,7 +28,8 @@ import org.openapitools.client.model.DogAllOf; */ public class Dog extends Animal { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public Dog breed(String breed) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/DogAllOf.java index d1e1402789f..b79847a96e4 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class DogAllOf { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/EnumArrays.java index 368b481f7e5..10b3d358762 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -63,7 +63,8 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -101,7 +102,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) private List arrayEnum = new ArrayList(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/EnumTest.java index b365a8a56fe..bde85ff2a09 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/EnumTest.java @@ -64,7 +64,8 @@ public class EnumTest { } } - @JsonProperty("enum_string") + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -104,7 +105,8 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -142,7 +144,8 @@ public class EnumTest { } } - @JsonProperty("enum_integer") + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -180,10 +183,12 @@ public class EnumTest { } } - @JsonProperty("enum_number") + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index ca73764280c..5ce9290bba2 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -28,10 +28,12 @@ import java.util.List; */ public class FileSchemaTestClass { - @JsonProperty("file") + public static final String JSON_PROPERTY_FILE = "file"; + @JsonProperty(JSON_PROPERTY_FILE) private java.io.File file = null; - @JsonProperty("files") + public static final String JSON_PROPERTY_FILES = "files"; + @JsonProperty(JSON_PROPERTY_FILES) private List files = new ArrayList(); public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/FormatTest.java index 00d132529e4..509048cd5e9 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/FormatTest.java @@ -31,43 +31,56 @@ import org.threeten.bp.OffsetDateTime; */ public class FormatTest { - @JsonProperty("integer") + public static final String JSON_PROPERTY_INTEGER = "integer"; + @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; - @JsonProperty("int32") + public static final String JSON_PROPERTY_INT32 = "int32"; + @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; - @JsonProperty("int64") + public static final String JSON_PROPERTY_INT64 = "int64"; + @JsonProperty(JSON_PROPERTY_INT64) private Long int64; - @JsonProperty("number") + public static final String JSON_PROPERTY_NUMBER = "number"; + @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; - @JsonProperty("float") + public static final String JSON_PROPERTY_FLOAT = "float"; + @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; - @JsonProperty("double") + public static final String JSON_PROPERTY_DOUBLE = "double"; + @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; - @JsonProperty("string") + public static final String JSON_PROPERTY_STRING = "string"; + @JsonProperty(JSON_PROPERTY_STRING) private String string; - @JsonProperty("byte") + public static final String JSON_PROPERTY_BYTE = "byte"; + @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; - @JsonProperty("binary") + public static final String JSON_PROPERTY_BINARY = "binary"; + @JsonProperty(JSON_PROPERTY_BINARY) private File binary; - @JsonProperty("date") + public static final String JSON_PROPERTY_DATE = "date"; + @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index e9453bb6cce..ad6b28d9d1e 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class HasOnlyReadOnly { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("foo") + public static final String JSON_PROPERTY_FOO = "foo"; + @JsonProperty(JSON_PROPERTY_FOO) private String foo; /** diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/MapTest.java index 44cd694057a..0a57199a714 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/MapTest.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class MapTest { - @JsonProperty("map_map_of_string") + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) private Map> mapMapOfString = new HashMap>(); /** @@ -67,13 +68,16 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) private Map mapOfEnumString = new HashMap(); - @JsonProperty("direct_map") + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) private Map directMap = new HashMap(); - @JsonProperty("indirect_map") + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) private Map indirectMap = new HashMap(); public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 19d808093c9..df68b7d4188 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -32,13 +32,16 @@ import org.threeten.bp.OffsetDateTime; */ public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") + public static final String JSON_PROPERTY_MAP = "map"; + @JsonProperty(JSON_PROPERTY_MAP) private Map map = new HashMap(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Model200Response.java index 39fabeeb6da..d86df5d7eab 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Model200Response.java @@ -27,10 +27,12 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model name starting with number") public class Model200Response { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ModelApiResponse.java index bb334129511..4c9a7f87b5a 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -26,13 +26,16 @@ import io.swagger.annotations.ApiModelProperty; */ public class ModelApiResponse { - @JsonProperty("code") + public static final String JSON_PROPERTY_CODE = "code"; + @JsonProperty(JSON_PROPERTY_CODE) private Integer code; - @JsonProperty("type") + public static final String JSON_PROPERTY_TYPE = "type"; + @JsonProperty(JSON_PROPERTY_TYPE) private String type; - @JsonProperty("message") + public static final String JSON_PROPERTY_MESSAGE = "message"; + @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ModelReturn.java index 9aafb13e04d..9c9ac21a3fb 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -27,7 +27,8 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing reserved words") public class ModelReturn { - @JsonProperty("return") + public static final String JSON_PROPERTY_RETURN = "return"; + @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Name.java index 9518276dd61..47f89c54361 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Name.java @@ -27,16 +27,20 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model name same as property name") public class Name { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("snake_case") + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; - @JsonProperty("property") + public static final String JSON_PROPERTY_PROPERTY = "property"; + @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; - @JsonProperty("123Number") + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; public Name name(Integer name) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/NumberOnly.java index 0245e8e2109..f5331da226e 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -27,7 +27,8 @@ import java.math.BigDecimal; */ public class NumberOnly { - @JsonProperty("JustNumber") + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Order.java index a9e2986a2fe..0d6bc154e46 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Order.java @@ -27,16 +27,20 @@ import org.threeten.bp.OffsetDateTime; */ public class Order { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("petId") + public static final String JSON_PROPERTY_PET_ID = "petId"; + @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; - @JsonProperty("quantity") + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; - @JsonProperty("shipDate") + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -76,10 +80,12 @@ public class Order { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; - @JsonProperty("complete") + public static final String JSON_PROPERTY_COMPLETE = "complete"; + @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; public Order id(Long id) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/OuterComposite.java index c8bd99011c0..7193ba2a0c9 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -27,13 +27,16 @@ import java.math.BigDecimal; */ public class OuterComposite { - @JsonProperty("my_number") + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; - @JsonProperty("my_string") + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; - @JsonProperty("my_boolean") + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Pet.java index a7d92129d73..b907822ed01 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Pet.java @@ -30,19 +30,24 @@ import org.openapitools.client.model.Tag; */ public class Pet { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("category") + public static final String JSON_PROPERTY_CATEGORY = "category"; + @JsonProperty(JSON_PROPERTY_CATEGORY) private Category category = null; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; - @JsonProperty("photoUrls") + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList(); - @JsonProperty("tags") + public static final String JSON_PROPERTY_TAGS = "tags"; + @JsonProperty(JSON_PROPERTY_TAGS) private List tags = new ArrayList(); /** @@ -82,7 +87,8 @@ public class Pet { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public Pet id(Long id) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 1379ee09ea6..b0949b9e2ea 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class ReadOnlyFirst { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("baz") + public static final String JSON_PROPERTY_BAZ = "baz"; + @JsonProperty(JSON_PROPERTY_BAZ) private String baz; /** diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/SpecialModelName.java index 869771afad8..a9d03234061 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class SpecialModelName { - @JsonProperty("$special[property.name]") + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Tag.java index 4bb498aff43..45f17b22cf3 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Tag.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class Tag { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public Tag id(Long id) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 9d0f5b2fbea..0961f776fb0 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -29,19 +29,24 @@ import java.util.List; */ public class TypeHolderDefault { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 94d3c57b6f2..3617c5c16b2 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -29,19 +29,24 @@ import java.util.List; */ public class TypeHolderExample { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/User.java index 73164c3ee28..9ce7869e755 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/User.java @@ -26,28 +26,36 @@ import io.swagger.annotations.ApiModelProperty; */ public class User { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("username") + public static final String JSON_PROPERTY_USERNAME = "username"; + @JsonProperty(JSON_PROPERTY_USERNAME) private String username; - @JsonProperty("firstName") + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; - @JsonProperty("lastName") + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; - @JsonProperty("email") + public static final String JSON_PROPERTY_EMAIL = "email"; + @JsonProperty(JSON_PROPERTY_EMAIL) private String email; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; - @JsonProperty("phone") + public static final String JSON_PROPERTY_PHONE = "phone"; + @JsonProperty(JSON_PROPERTY_PHONE) private String phone; - @JsonProperty("userStatus") + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; public User id(Long id) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/XmlItem.java index 9032c234249..151939d6054 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/XmlItem.java @@ -29,91 +29,120 @@ import java.util.List; */ public class XmlItem { - @JsonProperty("attribute_string") + public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; - @JsonProperty("attribute_number") + public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; - @JsonProperty("attribute_integer") + public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; - @JsonProperty("attribute_boolean") + public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; - @JsonProperty("wrapped_array") + public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) private List wrappedArray = new ArrayList(); - @JsonProperty("name_string") + public static final String JSON_PROPERTY_NAME_STRING = "name_string"; + @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; - @JsonProperty("name_number") + public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; - @JsonProperty("name_integer") + public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; - @JsonProperty("name_boolean") + public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; - @JsonProperty("name_array") + public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) private List nameArray = new ArrayList(); - @JsonProperty("name_wrapped_array") + public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) private List nameWrappedArray = new ArrayList(); - @JsonProperty("prefix_string") + public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; - @JsonProperty("prefix_number") + public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; - @JsonProperty("prefix_integer") + public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; - @JsonProperty("prefix_boolean") + public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; - @JsonProperty("prefix_array") + public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) private List prefixArray = new ArrayList(); - @JsonProperty("prefix_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) private List prefixWrappedArray = new ArrayList(); - @JsonProperty("namespace_string") + public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; - @JsonProperty("namespace_number") + public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; - @JsonProperty("namespace_integer") + public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; - @JsonProperty("namespace_boolean") + public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; - @JsonProperty("namespace_array") + public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) private List namespaceArray = new ArrayList(); - @JsonProperty("namespace_wrapped_array") + public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) private List namespaceWrappedArray = new ArrayList(); - @JsonProperty("prefix_ns_string") + public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; - @JsonProperty("prefix_ns_number") + public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; - @JsonProperty("prefix_ns_integer") + public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; - @JsonProperty("prefix_ns_boolean") + public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; - @JsonProperty("prefix_ns_array") + public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) private List prefixNsArray = new ArrayList(); - @JsonProperty("prefix_ns_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) private List prefixNsWrappedArray = new ArrayList(); public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 69d6a817294..0df18c37e39 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 0147a592b7e..0d9a6b14532 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 89aa511c2a8..8e85a1f2246 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index ecb4e102ea2..dc8ea1e9ec3 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -30,37 +30,48 @@ import java.util.Map; */ public class AdditionalPropertiesClass { - @JsonProperty("map_string") + public static final String JSON_PROPERTY_MAP_STRING = "map_string"; + @JsonProperty(JSON_PROPERTY_MAP_STRING) private Map mapString = new HashMap<>(); - @JsonProperty("map_number") + public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) private Map mapNumber = new HashMap<>(); - @JsonProperty("map_integer") + public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) private Map mapInteger = new HashMap<>(); - @JsonProperty("map_boolean") + public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) private Map mapBoolean = new HashMap<>(); - @JsonProperty("map_array_integer") + public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) private Map> mapArrayInteger = new HashMap<>(); - @JsonProperty("map_array_anytype") + public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) private Map> mapArrayAnytype = new HashMap<>(); - @JsonProperty("map_map_string") + public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) private Map> mapMapString = new HashMap<>(); - @JsonProperty("map_map_anytype") + public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) private Map> mapMapAnytype = new HashMap<>(); - @JsonProperty("anytype_1") + public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + @JsonProperty(JSON_PROPERTY_ANYTYPE1) private Object anytype1 = null; - @JsonProperty("anytype_2") + public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; + @JsonProperty(JSON_PROPERTY_ANYTYPE2) private Object anytype2 = null; - @JsonProperty("anytype_3") + public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; + @JsonProperty(JSON_PROPERTY_ANYTYPE3) private Object anytype3 = null; public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index f27ff011de1..77388b95d86 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 479696fdcef..f0a3318bca1 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index bd569b0da3e..19d772f4522 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 27e03a2313e..09e6431c916 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesString name(String name) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java index dc16717ac32..a2d34d82f47 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java @@ -34,10 +34,12 @@ import io.swagger.annotations.ApiModelProperty; }) public class Animal { - @JsonProperty("className") + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; - @JsonProperty("color") + public static final String JSON_PROPERTY_COLOR = "color"; + @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; public Animal className(String className) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 66e9fba5d75..ce83908187a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import java.util.List; */ public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 9f5b467a314..ad502738c10 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import java.util.List; */ public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java index 7ac67880894..d0c2fc409c5 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -29,13 +29,16 @@ import org.openapitools.client.model.ReadOnlyFirst; */ public class ArrayTest { - @JsonProperty("array_of_string") + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) private List arrayOfString = new ArrayList<>(); - @JsonProperty("array_array_of_integer") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) private List> arrayArrayOfInteger = new ArrayList<>(); - @JsonProperty("array_array_of_model") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java index 3f3df29d5da..1d4ebff1533 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java @@ -26,22 +26,28 @@ import io.swagger.annotations.ApiModelProperty; */ public class Capitalization { - @JsonProperty("smallCamel") + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; - @JsonProperty("CapitalCamel") + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; - @JsonProperty("small_Snake") + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; - @JsonProperty("Capital_Snake") + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java index a8108d6f151..11ffa39d982 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java @@ -28,7 +28,8 @@ import org.openapitools.client.model.CatAllOf; */ public class Cat extends Animal { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/CatAllOf.java index 42e96146107..1c12b1972cf 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class CatAllOf { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java index 3eccd2cd922..652d69552d1 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class Category { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; public Category id(Long id) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java index 2aaed27fffd..16036936e7a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java @@ -27,7 +27,8 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { - @JsonProperty("_class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java index 458e8129602..a5c065a1dd0 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class Client { - @JsonProperty("client") + public static final String JSON_PROPERTY_CLIENT = "client"; + @JsonProperty(JSON_PROPERTY_CLIENT) private String client; public Client client(String client) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java index 83f5cb0e272..7ac3c33202e 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java @@ -28,7 +28,8 @@ import org.openapitools.client.model.DogAllOf; */ public class Dog extends Animal { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public Dog breed(String breed) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DogAllOf.java index d1e1402789f..b79847a96e4 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class DogAllOf { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java index a3bd1af4725..2db426ab8bf 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -63,7 +63,8 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -101,7 +102,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java index b365a8a56fe..bde85ff2a09 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java @@ -64,7 +64,8 @@ public class EnumTest { } } - @JsonProperty("enum_string") + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -104,7 +105,8 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -142,7 +144,8 @@ public class EnumTest { } } - @JsonProperty("enum_integer") + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -180,10 +183,12 @@ public class EnumTest { } } - @JsonProperty("enum_number") + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index ad8cf751e11..2c247d819ce 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -28,10 +28,12 @@ import java.util.List; */ public class FileSchemaTestClass { - @JsonProperty("file") + public static final String JSON_PROPERTY_FILE = "file"; + @JsonProperty(JSON_PROPERTY_FILE) private java.io.File file = null; - @JsonProperty("files") + public static final String JSON_PROPERTY_FILES = "files"; + @JsonProperty(JSON_PROPERTY_FILES) private List files = new ArrayList<>(); public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java index 8d075e26bad..1b9426d9ab6 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java @@ -31,43 +31,56 @@ import java.util.UUID; */ public class FormatTest { - @JsonProperty("integer") + public static final String JSON_PROPERTY_INTEGER = "integer"; + @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; - @JsonProperty("int32") + public static final String JSON_PROPERTY_INT32 = "int32"; + @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; - @JsonProperty("int64") + public static final String JSON_PROPERTY_INT64 = "int64"; + @JsonProperty(JSON_PROPERTY_INT64) private Long int64; - @JsonProperty("number") + public static final String JSON_PROPERTY_NUMBER = "number"; + @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; - @JsonProperty("float") + public static final String JSON_PROPERTY_FLOAT = "float"; + @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; - @JsonProperty("double") + public static final String JSON_PROPERTY_DOUBLE = "double"; + @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; - @JsonProperty("string") + public static final String JSON_PROPERTY_STRING = "string"; + @JsonProperty(JSON_PROPERTY_STRING) private String string; - @JsonProperty("byte") + public static final String JSON_PROPERTY_BYTE = "byte"; + @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; - @JsonProperty("binary") + public static final String JSON_PROPERTY_BINARY = "binary"; + @JsonProperty(JSON_PROPERTY_BINARY) private File binary; - @JsonProperty("date") + public static final String JSON_PROPERTY_DATE = "date"; + @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index e9453bb6cce..ad6b28d9d1e 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class HasOnlyReadOnly { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("foo") + public static final String JSON_PROPERTY_FOO = "foo"; + @JsonProperty(JSON_PROPERTY_FOO) private String foo; /** diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java index b0d3e04bb63..021d59d2570 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class MapTest { - @JsonProperty("map_map_of_string") + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) private Map> mapMapOfString = new HashMap<>(); /** @@ -67,13 +68,16 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) private Map mapOfEnumString = new HashMap<>(); - @JsonProperty("direct_map") + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) private Map directMap = new HashMap<>(); - @JsonProperty("indirect_map") + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index fed78a2162f..ad173f004a1 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -32,13 +32,16 @@ import org.openapitools.client.model.Animal; */ public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") + public static final String JSON_PROPERTY_MAP = "map"; + @JsonProperty(JSON_PROPERTY_MAP) private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java index 39fabeeb6da..d86df5d7eab 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java @@ -27,10 +27,12 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model name starting with number") public class Model200Response { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java index bb334129511..4c9a7f87b5a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -26,13 +26,16 @@ import io.swagger.annotations.ApiModelProperty; */ public class ModelApiResponse { - @JsonProperty("code") + public static final String JSON_PROPERTY_CODE = "code"; + @JsonProperty(JSON_PROPERTY_CODE) private Integer code; - @JsonProperty("type") + public static final String JSON_PROPERTY_TYPE = "type"; + @JsonProperty(JSON_PROPERTY_TYPE) private String type; - @JsonProperty("message") + public static final String JSON_PROPERTY_MESSAGE = "message"; + @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java index 9aafb13e04d..9c9ac21a3fb 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -27,7 +27,8 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing reserved words") public class ModelReturn { - @JsonProperty("return") + public static final String JSON_PROPERTY_RETURN = "return"; + @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java index 9518276dd61..47f89c54361 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java @@ -27,16 +27,20 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model name same as property name") public class Name { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("snake_case") + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; - @JsonProperty("property") + public static final String JSON_PROPERTY_PROPERTY = "property"; + @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; - @JsonProperty("123Number") + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; public Name name(Integer name) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java index 0245e8e2109..f5331da226e 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -27,7 +27,8 @@ import java.math.BigDecimal; */ public class NumberOnly { - @JsonProperty("JustNumber") + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java index 594c76e484d..0730133f9cb 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java @@ -27,16 +27,20 @@ import java.time.OffsetDateTime; */ public class Order { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("petId") + public static final String JSON_PROPERTY_PET_ID = "petId"; + @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; - @JsonProperty("quantity") + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; - @JsonProperty("shipDate") + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -76,10 +80,12 @@ public class Order { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; - @JsonProperty("complete") + public static final String JSON_PROPERTY_COMPLETE = "complete"; + @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; public Order id(Long id) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java index c8bd99011c0..7193ba2a0c9 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -27,13 +27,16 @@ import java.math.BigDecimal; */ public class OuterComposite { - @JsonProperty("my_number") + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; - @JsonProperty("my_string") + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; - @JsonProperty("my_boolean") + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java index 08f37737561..b8e18631bf1 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java @@ -30,19 +30,24 @@ import org.openapitools.client.model.Tag; */ public class Pet { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("category") + public static final String JSON_PROPERTY_CATEGORY = "category"; + @JsonProperty(JSON_PROPERTY_CATEGORY) private Category category = null; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; - @JsonProperty("photoUrls") + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList<>(); - @JsonProperty("tags") + public static final String JSON_PROPERTY_TAGS = "tags"; + @JsonProperty(JSON_PROPERTY_TAGS) private List tags = new ArrayList<>(); /** @@ -82,7 +87,8 @@ public class Pet { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public Pet id(Long id) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 1379ee09ea6..b0949b9e2ea 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class ReadOnlyFirst { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("baz") + public static final String JSON_PROPERTY_BAZ = "baz"; + @JsonProperty(JSON_PROPERTY_BAZ) private String baz; /** diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java index 869771afad8..a9d03234061 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class SpecialModelName { - @JsonProperty("$special[property.name]") + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java index 4bb498aff43..45f17b22cf3 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class Tag { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public Tag id(Long id) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 3c6488d270a..3f3030998f1 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -29,19 +29,24 @@ import java.util.List; */ public class TypeHolderDefault { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 812b5839aa5..99ddaa8d2eb 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -29,19 +29,24 @@ import java.util.List; */ public class TypeHolderExample { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/User.java index 73164c3ee28..9ce7869e755 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/User.java @@ -26,28 +26,36 @@ import io.swagger.annotations.ApiModelProperty; */ public class User { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("username") + public static final String JSON_PROPERTY_USERNAME = "username"; + @JsonProperty(JSON_PROPERTY_USERNAME) private String username; - @JsonProperty("firstName") + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; - @JsonProperty("lastName") + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; - @JsonProperty("email") + public static final String JSON_PROPERTY_EMAIL = "email"; + @JsonProperty(JSON_PROPERTY_EMAIL) private String email; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; - @JsonProperty("phone") + public static final String JSON_PROPERTY_PHONE = "phone"; + @JsonProperty(JSON_PROPERTY_PHONE) private String phone; - @JsonProperty("userStatus") + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; public User id(Long id) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/XmlItem.java index aa7ff22ccde..66404193208 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/XmlItem.java @@ -29,91 +29,120 @@ import java.util.List; */ public class XmlItem { - @JsonProperty("attribute_string") + public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; - @JsonProperty("attribute_number") + public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; - @JsonProperty("attribute_integer") + public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; - @JsonProperty("attribute_boolean") + public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; - @JsonProperty("wrapped_array") + public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) private List wrappedArray = new ArrayList<>(); - @JsonProperty("name_string") + public static final String JSON_PROPERTY_NAME_STRING = "name_string"; + @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; - @JsonProperty("name_number") + public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; - @JsonProperty("name_integer") + public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; - @JsonProperty("name_boolean") + public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; - @JsonProperty("name_array") + public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) private List nameArray = new ArrayList<>(); - @JsonProperty("name_wrapped_array") + public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) private List nameWrappedArray = new ArrayList<>(); - @JsonProperty("prefix_string") + public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; - @JsonProperty("prefix_number") + public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; - @JsonProperty("prefix_integer") + public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; - @JsonProperty("prefix_boolean") + public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; - @JsonProperty("prefix_array") + public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) private List prefixArray = new ArrayList<>(); - @JsonProperty("prefix_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) private List prefixWrappedArray = new ArrayList<>(); - @JsonProperty("namespace_string") + public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; - @JsonProperty("namespace_number") + public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; - @JsonProperty("namespace_integer") + public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; - @JsonProperty("namespace_boolean") + public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; - @JsonProperty("namespace_array") + public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) private List namespaceArray = new ArrayList<>(); - @JsonProperty("namespace_wrapped_array") + public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) private List namespaceWrappedArray = new ArrayList<>(); - @JsonProperty("prefix_ns_string") + public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; - @JsonProperty("prefix_ns_number") + public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; - @JsonProperty("prefix_ns_integer") + public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; - @JsonProperty("prefix_ns_boolean") + public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; - @JsonProperty("prefix_ns_array") + public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) private List prefixNsArray = new ArrayList<>(); - @JsonProperty("prefix_ns_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 69d6a817294..0df18c37e39 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 0147a592b7e..0d9a6b14532 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 89aa511c2a8..8e85a1f2246 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index cb955d1165a..cf0854acd00 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -30,37 +30,48 @@ import java.util.Map; */ public class AdditionalPropertiesClass { - @JsonProperty("map_string") + public static final String JSON_PROPERTY_MAP_STRING = "map_string"; + @JsonProperty(JSON_PROPERTY_MAP_STRING) private Map mapString = new HashMap(); - @JsonProperty("map_number") + public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) private Map mapNumber = new HashMap(); - @JsonProperty("map_integer") + public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) private Map mapInteger = new HashMap(); - @JsonProperty("map_boolean") + public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) private Map mapBoolean = new HashMap(); - @JsonProperty("map_array_integer") + public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) private Map> mapArrayInteger = new HashMap>(); - @JsonProperty("map_array_anytype") + public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) private Map> mapArrayAnytype = new HashMap>(); - @JsonProperty("map_map_string") + public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) private Map> mapMapString = new HashMap>(); - @JsonProperty("map_map_anytype") + public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) private Map> mapMapAnytype = new HashMap>(); - @JsonProperty("anytype_1") + public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + @JsonProperty(JSON_PROPERTY_ANYTYPE1) private Object anytype1 = null; - @JsonProperty("anytype_2") + public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; + @JsonProperty(JSON_PROPERTY_ANYTYPE2) private Object anytype2 = null; - @JsonProperty("anytype_3") + public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; + @JsonProperty(JSON_PROPERTY_ANYTYPE3) private Object anytype3 = null; public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index f27ff011de1..77388b95d86 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 479696fdcef..f0a3318bca1 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index bd569b0da3e..19d772f4522 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 27e03a2313e..09e6431c916 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesString name(String name) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java index dc16717ac32..a2d34d82f47 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java @@ -34,10 +34,12 @@ import io.swagger.annotations.ApiModelProperty; }) public class Animal { - @JsonProperty("className") + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; - @JsonProperty("color") + public static final String JSON_PROPERTY_COLOR = "color"; + @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; public Animal className(String className) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index b670ecb66e4..c3dd85a61ea 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import java.util.List; */ public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = new ArrayList>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 9d6997f88fc..2ae01f1581a 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import java.util.List; */ public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) private List arrayNumber = new ArrayList(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java index 7dc235f0a94..f5968901765 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -29,13 +29,16 @@ import org.openapitools.client.model.ReadOnlyFirst; */ public class ArrayTest { - @JsonProperty("array_of_string") + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) private List arrayOfString = new ArrayList(); - @JsonProperty("array_array_of_integer") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) private List> arrayArrayOfInteger = new ArrayList>(); - @JsonProperty("array_array_of_model") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = new ArrayList>(); public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java index 3f3df29d5da..1d4ebff1533 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Capitalization.java @@ -26,22 +26,28 @@ import io.swagger.annotations.ApiModelProperty; */ public class Capitalization { - @JsonProperty("smallCamel") + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; - @JsonProperty("CapitalCamel") + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; - @JsonProperty("small_Snake") + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; - @JsonProperty("Capital_Snake") + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java index a8108d6f151..11ffa39d982 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Cat.java @@ -28,7 +28,8 @@ import org.openapitools.client.model.CatAllOf; */ public class Cat extends Animal { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java index 42e96146107..1c12b1972cf 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class CatAllOf { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java index 3eccd2cd922..652d69552d1 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Category.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class Category { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; public Category id(Long id) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java index 2aaed27fffd..16036936e7a 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ClassModel.java @@ -27,7 +27,8 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { - @JsonProperty("_class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java index 458e8129602..a5c065a1dd0 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Client.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class Client { - @JsonProperty("client") + public static final String JSON_PROPERTY_CLIENT = "client"; + @JsonProperty(JSON_PROPERTY_CLIENT) private String client; public Client client(String client) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java index 83f5cb0e272..7ac3c33202e 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Dog.java @@ -28,7 +28,8 @@ import org.openapitools.client.model.DogAllOf; */ public class Dog extends Animal { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public Dog breed(String breed) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java index d1e1402789f..b79847a96e4 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class DogAllOf { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java index 368b481f7e5..10b3d358762 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -63,7 +63,8 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -101,7 +102,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) private List arrayEnum = new ArrayList(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java index b365a8a56fe..bde85ff2a09 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/EnumTest.java @@ -64,7 +64,8 @@ public class EnumTest { } } - @JsonProperty("enum_string") + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -104,7 +105,8 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -142,7 +144,8 @@ public class EnumTest { } } - @JsonProperty("enum_integer") + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -180,10 +183,12 @@ public class EnumTest { } } - @JsonProperty("enum_number") + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index ca73764280c..5ce9290bba2 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -28,10 +28,12 @@ import java.util.List; */ public class FileSchemaTestClass { - @JsonProperty("file") + public static final String JSON_PROPERTY_FILE = "file"; + @JsonProperty(JSON_PROPERTY_FILE) private java.io.File file = null; - @JsonProperty("files") + public static final String JSON_PROPERTY_FILES = "files"; + @JsonProperty(JSON_PROPERTY_FILES) private List files = new ArrayList(); public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java index 00d132529e4..509048cd5e9 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/FormatTest.java @@ -31,43 +31,56 @@ import org.threeten.bp.OffsetDateTime; */ public class FormatTest { - @JsonProperty("integer") + public static final String JSON_PROPERTY_INTEGER = "integer"; + @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; - @JsonProperty("int32") + public static final String JSON_PROPERTY_INT32 = "int32"; + @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; - @JsonProperty("int64") + public static final String JSON_PROPERTY_INT64 = "int64"; + @JsonProperty(JSON_PROPERTY_INT64) private Long int64; - @JsonProperty("number") + public static final String JSON_PROPERTY_NUMBER = "number"; + @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; - @JsonProperty("float") + public static final String JSON_PROPERTY_FLOAT = "float"; + @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; - @JsonProperty("double") + public static final String JSON_PROPERTY_DOUBLE = "double"; + @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; - @JsonProperty("string") + public static final String JSON_PROPERTY_STRING = "string"; + @JsonProperty(JSON_PROPERTY_STRING) private String string; - @JsonProperty("byte") + public static final String JSON_PROPERTY_BYTE = "byte"; + @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; - @JsonProperty("binary") + public static final String JSON_PROPERTY_BINARY = "binary"; + @JsonProperty(JSON_PROPERTY_BINARY) private File binary; - @JsonProperty("date") + public static final String JSON_PROPERTY_DATE = "date"; + @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index e9453bb6cce..ad6b28d9d1e 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class HasOnlyReadOnly { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("foo") + public static final String JSON_PROPERTY_FOO = "foo"; + @JsonProperty(JSON_PROPERTY_FOO) private String foo; /** diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java index 44cd694057a..0a57199a714 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MapTest.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class MapTest { - @JsonProperty("map_map_of_string") + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) private Map> mapMapOfString = new HashMap>(); /** @@ -67,13 +68,16 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) private Map mapOfEnumString = new HashMap(); - @JsonProperty("direct_map") + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) private Map directMap = new HashMap(); - @JsonProperty("indirect_map") + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) private Map indirectMap = new HashMap(); public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 19d808093c9..df68b7d4188 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -32,13 +32,16 @@ import org.threeten.bp.OffsetDateTime; */ public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") + public static final String JSON_PROPERTY_MAP = "map"; + @JsonProperty(JSON_PROPERTY_MAP) private Map map = new HashMap(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java index 39fabeeb6da..d86df5d7eab 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Model200Response.java @@ -27,10 +27,12 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model name starting with number") public class Model200Response { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java index bb334129511..4c9a7f87b5a 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -26,13 +26,16 @@ import io.swagger.annotations.ApiModelProperty; */ public class ModelApiResponse { - @JsonProperty("code") + public static final String JSON_PROPERTY_CODE = "code"; + @JsonProperty(JSON_PROPERTY_CODE) private Integer code; - @JsonProperty("type") + public static final String JSON_PROPERTY_TYPE = "type"; + @JsonProperty(JSON_PROPERTY_TYPE) private String type; - @JsonProperty("message") + public static final String JSON_PROPERTY_MESSAGE = "message"; + @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java index 9aafb13e04d..9c9ac21a3fb 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -27,7 +27,8 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing reserved words") public class ModelReturn { - @JsonProperty("return") + public static final String JSON_PROPERTY_RETURN = "return"; + @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java index 9518276dd61..47f89c54361 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Name.java @@ -27,16 +27,20 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model name same as property name") public class Name { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("snake_case") + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; - @JsonProperty("property") + public static final String JSON_PROPERTY_PROPERTY = "property"; + @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; - @JsonProperty("123Number") + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; public Name name(Integer name) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java index 0245e8e2109..f5331da226e 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -27,7 +27,8 @@ import java.math.BigDecimal; */ public class NumberOnly { - @JsonProperty("JustNumber") + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java index a9e2986a2fe..0d6bc154e46 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Order.java @@ -27,16 +27,20 @@ import org.threeten.bp.OffsetDateTime; */ public class Order { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("petId") + public static final String JSON_PROPERTY_PET_ID = "petId"; + @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; - @JsonProperty("quantity") + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; - @JsonProperty("shipDate") + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -76,10 +80,12 @@ public class Order { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; - @JsonProperty("complete") + public static final String JSON_PROPERTY_COMPLETE = "complete"; + @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; public Order id(Long id) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java index c8bd99011c0..7193ba2a0c9 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -27,13 +27,16 @@ import java.math.BigDecimal; */ public class OuterComposite { - @JsonProperty("my_number") + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; - @JsonProperty("my_string") + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; - @JsonProperty("my_boolean") + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java index a7d92129d73..b907822ed01 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java @@ -30,19 +30,24 @@ import org.openapitools.client.model.Tag; */ public class Pet { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("category") + public static final String JSON_PROPERTY_CATEGORY = "category"; + @JsonProperty(JSON_PROPERTY_CATEGORY) private Category category = null; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; - @JsonProperty("photoUrls") + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList(); - @JsonProperty("tags") + public static final String JSON_PROPERTY_TAGS = "tags"; + @JsonProperty(JSON_PROPERTY_TAGS) private List tags = new ArrayList(); /** @@ -82,7 +87,8 @@ public class Pet { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public Pet id(Long id) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 1379ee09ea6..b0949b9e2ea 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class ReadOnlyFirst { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("baz") + public static final String JSON_PROPERTY_BAZ = "baz"; + @JsonProperty(JSON_PROPERTY_BAZ) private String baz; /** diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java index 869771afad8..a9d03234061 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class SpecialModelName { - @JsonProperty("$special[property.name]") + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java index 4bb498aff43..45f17b22cf3 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Tag.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class Tag { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public Tag id(Long id) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 9d0f5b2fbea..0961f776fb0 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -29,19 +29,24 @@ import java.util.List; */ public class TypeHolderDefault { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 94d3c57b6f2..3617c5c16b2 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -29,19 +29,24 @@ import java.util.List; */ public class TypeHolderExample { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java index 73164c3ee28..9ce7869e755 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/User.java @@ -26,28 +26,36 @@ import io.swagger.annotations.ApiModelProperty; */ public class User { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("username") + public static final String JSON_PROPERTY_USERNAME = "username"; + @JsonProperty(JSON_PROPERTY_USERNAME) private String username; - @JsonProperty("firstName") + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; - @JsonProperty("lastName") + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; - @JsonProperty("email") + public static final String JSON_PROPERTY_EMAIL = "email"; + @JsonProperty(JSON_PROPERTY_EMAIL) private String email; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; - @JsonProperty("phone") + public static final String JSON_PROPERTY_PHONE = "phone"; + @JsonProperty(JSON_PROPERTY_PHONE) private String phone; - @JsonProperty("userStatus") + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; public User id(Long id) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java index 9032c234249..151939d6054 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/XmlItem.java @@ -29,91 +29,120 @@ import java.util.List; */ public class XmlItem { - @JsonProperty("attribute_string") + public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; - @JsonProperty("attribute_number") + public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; - @JsonProperty("attribute_integer") + public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; - @JsonProperty("attribute_boolean") + public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; - @JsonProperty("wrapped_array") + public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) private List wrappedArray = new ArrayList(); - @JsonProperty("name_string") + public static final String JSON_PROPERTY_NAME_STRING = "name_string"; + @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; - @JsonProperty("name_number") + public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; - @JsonProperty("name_integer") + public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; - @JsonProperty("name_boolean") + public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; - @JsonProperty("name_array") + public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) private List nameArray = new ArrayList(); - @JsonProperty("name_wrapped_array") + public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) private List nameWrappedArray = new ArrayList(); - @JsonProperty("prefix_string") + public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; - @JsonProperty("prefix_number") + public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; - @JsonProperty("prefix_integer") + public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; - @JsonProperty("prefix_boolean") + public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; - @JsonProperty("prefix_array") + public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) private List prefixArray = new ArrayList(); - @JsonProperty("prefix_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) private List prefixWrappedArray = new ArrayList(); - @JsonProperty("namespace_string") + public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; - @JsonProperty("namespace_number") + public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; - @JsonProperty("namespace_integer") + public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; - @JsonProperty("namespace_boolean") + public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; - @JsonProperty("namespace_array") + public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) private List namespaceArray = new ArrayList(); - @JsonProperty("namespace_wrapped_array") + public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) private List namespaceWrappedArray = new ArrayList(); - @JsonProperty("prefix_ns_string") + public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; - @JsonProperty("prefix_ns_number") + public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; - @JsonProperty("prefix_ns_integer") + public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; - @JsonProperty("prefix_ns_boolean") + public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; - @JsonProperty("prefix_ns_array") + public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) private List prefixNsArray = new ArrayList(); - @JsonProperty("prefix_ns_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) private List prefixNsWrappedArray = new ArrayList(); public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 35778f5f20d..f84a1d2fdc6 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -33,7 +33,8 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "AdditionalPropertiesAnyType") public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) @JacksonXmlProperty(localName = "name") @XmlElement(name = "name") private String name; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index f12a0e3eea8..af9a2679f91 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -34,7 +34,8 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "AdditionalPropertiesArray") public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) @JacksonXmlProperty(localName = "name") @XmlElement(name = "name") private String name; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 0724522b6c5..02df03199f9 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -33,7 +33,8 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "AdditionalPropertiesBoolean") public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) @JacksonXmlProperty(localName = "name") @XmlElement(name = "name") private String name; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 0476d2af63b..82a2de80c1f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -35,73 +35,84 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "AdditionalPropertiesClass") public class AdditionalPropertiesClass { - @JsonProperty("map_string") + public static final String JSON_PROPERTY_MAP_STRING = "map_string"; + @JsonProperty(JSON_PROPERTY_MAP_STRING) // Is a container wrapped=false // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= // items.example= items.type=String @XmlElement(name = "inner") private Map mapString = new HashMap(); - @JsonProperty("map_number") + public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) // Is a container wrapped=false // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= // items.example= items.type=BigDecimal @XmlElement(name = "inner") private Map mapNumber = new HashMap(); - @JsonProperty("map_integer") + public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) // Is a container wrapped=false // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= // items.example= items.type=Integer @XmlElement(name = "inner") private Map mapInteger = new HashMap(); - @JsonProperty("map_boolean") + public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) // Is a container wrapped=false // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= // items.example= items.type=Boolean @XmlElement(name = "inner") private Map mapBoolean = new HashMap(); - @JsonProperty("map_array_integer") + public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) // Is a container wrapped=false // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= // items.example= items.type=List<Integer> @XmlElement(name = "inner") private Map> mapArrayInteger = new HashMap>(); - @JsonProperty("map_array_anytype") + public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) // Is a container wrapped=false // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= // items.example= items.type=List<Object> @XmlElement(name = "inner") private Map> mapArrayAnytype = new HashMap>(); - @JsonProperty("map_map_string") + public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) // Is a container wrapped=false // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= // items.example= items.type=Map<String, String> @XmlElement(name = "inner") private Map> mapMapString = new HashMap>(); - @JsonProperty("map_map_anytype") + public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) // Is a container wrapped=false // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= // items.example= items.type=Map<String, Object> @XmlElement(name = "inner") private Map> mapMapAnytype = new HashMap>(); - @JsonProperty("anytype_1") + public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + @JsonProperty(JSON_PROPERTY_ANYTYPE1) @JacksonXmlProperty(localName = "anytype_1") @XmlElement(name = "anytype_1") private Object anytype1 = null; - @JsonProperty("anytype_2") + public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; + @JsonProperty(JSON_PROPERTY_ANYTYPE2) @JacksonXmlProperty(localName = "anytype_2") @XmlElement(name = "anytype_2") private Object anytype2 = null; - @JsonProperty("anytype_3") + public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; + @JsonProperty(JSON_PROPERTY_ANYTYPE3) @JacksonXmlProperty(localName = "anytype_3") @XmlElement(name = "anytype_3") private Object anytype3 = null; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index f31a8c8b802..ed7a57eb1eb 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -33,7 +33,8 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "AdditionalPropertiesInteger") public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) @JacksonXmlProperty(localName = "name") @XmlElement(name = "name") private String name; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 54e58d5690d..fe1af38c34b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -34,7 +34,8 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "AdditionalPropertiesNumber") public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) @JacksonXmlProperty(localName = "name") @XmlElement(name = "name") private String name; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index e89246c37c7..23a4f6750ab 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -33,7 +33,8 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "AdditionalPropertiesObject") public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) @JacksonXmlProperty(localName = "name") @XmlElement(name = "name") private String name; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index a859ad4c7b1..234743f50e0 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -33,7 +33,8 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "AdditionalPropertiesString") public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) @JacksonXmlProperty(localName = "name") @XmlElement(name = "name") private String name; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java index ac608044d3d..cfa45cacb63 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java @@ -39,12 +39,14 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Animal") public class Animal { - @JsonProperty("className") + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JacksonXmlProperty(localName = "className") @XmlElement(name = "className") private String className; - @JsonProperty("color") + public static final String JSON_PROPERTY_COLOR = "color"; + @JsonProperty(JSON_PROPERTY_COLOR) @JacksonXmlProperty(localName = "color") @XmlElement(name = "color") private String color = "red"; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index c3a1a1343e7..9738cfc15f1 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -34,7 +34,8 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "ArrayOfArrayOfNumberOnly") public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) // Is a container wrapped=false // items.name=arrayArrayNumber items.baseName=arrayArrayNumber items.xmlName= items.xmlNamespace= // items.example= items.type=List<BigDecimal> diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 56d8c18f8fd..020c8b1ff7e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -34,7 +34,8 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "ArrayOfNumberOnly") public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) // Is a container wrapped=false // items.name=arrayNumber items.baseName=arrayNumber items.xmlName= items.xmlNamespace= // items.example= items.type=BigDecimal diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java index c14f12e7453..8f0d753556a 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -34,21 +34,24 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "ArrayTest") public class ArrayTest { - @JsonProperty("array_of_string") + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) // Is a container wrapped=false // items.name=arrayOfString items.baseName=arrayOfString items.xmlName= items.xmlNamespace= // items.example= items.type=String @XmlElement(name = "arrayOfString") private List arrayOfString = new ArrayList(); - @JsonProperty("array_array_of_integer") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) // Is a container wrapped=false // items.name=arrayArrayOfInteger items.baseName=arrayArrayOfInteger items.xmlName= items.xmlNamespace= // items.example= items.type=List<Long> @XmlElement(name = "arrayArrayOfInteger") private List> arrayArrayOfInteger = new ArrayList>(); - @JsonProperty("array_array_of_model") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) // Is a container wrapped=false // items.name=arrayArrayOfModel items.baseName=arrayArrayOfModel items.xmlName= items.xmlNamespace= // items.example= items.type=List<ReadOnlyFirst> diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java index c8e25b928a7..520e7400d74 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java @@ -31,32 +31,38 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Capitalization") public class Capitalization { - @JsonProperty("smallCamel") + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) @JacksonXmlProperty(localName = "smallCamel") @XmlElement(name = "smallCamel") private String smallCamel; - @JsonProperty("CapitalCamel") + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) @JacksonXmlProperty(localName = "CapitalCamel") @XmlElement(name = "CapitalCamel") private String capitalCamel; - @JsonProperty("small_Snake") + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) @JacksonXmlProperty(localName = "small_Snake") @XmlElement(name = "small_Snake") private String smallSnake; - @JsonProperty("Capital_Snake") + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) @JacksonXmlProperty(localName = "Capital_Snake") @XmlElement(name = "Capital_Snake") private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) @JacksonXmlProperty(localName = "SCA_ETH_Flow_Points") @XmlElement(name = "SCA_ETH_Flow_Points") private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) @JacksonXmlProperty(localName = "ATT_NAME") @XmlElement(name = "ATT_NAME") private String ATT_NAME; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java index cf49fd3e046..a26c42f8d43 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java @@ -33,7 +33,8 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Cat") public class Cat extends Animal { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) @JacksonXmlProperty(localName = "declawed") @XmlElement(name = "declawed") private Boolean declawed; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java index 7d37c97b42f..9f105804527 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -31,7 +31,8 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "CatAllOf") public class CatAllOf { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) @JacksonXmlProperty(localName = "declawed") @XmlElement(name = "declawed") private Boolean declawed; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java index abb54619dc4..9278904f691 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java @@ -31,12 +31,14 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Category") public class Category { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) @JacksonXmlProperty(localName = "id") @XmlElement(name = "id") private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) @JacksonXmlProperty(localName = "name") @XmlElement(name = "name") private String name = "default-name"; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java index e72245b091d..0c74063d681 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java @@ -32,7 +32,8 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "ClassModel") public class ClassModel { - @JsonProperty("_class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JacksonXmlProperty(localName = "_class") @XmlElement(name = "_class") private String propertyClass; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java index 1f649f68552..3b7ce5c17ce 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java @@ -31,7 +31,8 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Client") public class Client { - @JsonProperty("client") + public static final String JSON_PROPERTY_CLIENT = "client"; + @JsonProperty(JSON_PROPERTY_CLIENT) @JacksonXmlProperty(localName = "client") @XmlElement(name = "client") private String client; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java index 81bc53f3915..b95d3f385bc 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java @@ -33,7 +33,8 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Dog") public class Dog extends Animal { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) @JacksonXmlProperty(localName = "breed") @XmlElement(name = "breed") private String breed; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java index 0d6418d5e9e..10cecedd80b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -31,7 +31,8 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "DogAllOf") public class DogAllOf { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) @JacksonXmlProperty(localName = "breed") @XmlElement(name = "breed") private String breed; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java index af06ee391bf..8262fb046ec 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -68,7 +68,8 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) @JacksonXmlProperty(localName = "just_symbol") @XmlElement(name = "just_symbol") private JustSymbolEnum justSymbol; @@ -108,7 +109,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) // Is a container wrapped=false // items.name=arrayEnum items.baseName=arrayEnum items.xmlName= items.xmlNamespace= // items.example= items.type=String diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java index d073d1c207f..3813bb861f4 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java @@ -69,7 +69,8 @@ public class EnumTest { } } - @JsonProperty("enum_string") + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING) @JacksonXmlProperty(localName = "enum_string") @XmlElement(name = "enum_string") private EnumStringEnum enumString; @@ -111,7 +112,8 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) @JacksonXmlProperty(localName = "enum_string_required") @XmlElement(name = "enum_string_required") private EnumStringRequiredEnum enumStringRequired; @@ -151,7 +153,8 @@ public class EnumTest { } } - @JsonProperty("enum_integer") + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) @JacksonXmlProperty(localName = "enum_integer") @XmlElement(name = "enum_integer") private EnumIntegerEnum enumInteger; @@ -191,12 +194,14 @@ public class EnumTest { } } - @JsonProperty("enum_number") + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) @JacksonXmlProperty(localName = "enum_number") @XmlElement(name = "enum_number") private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) @JacksonXmlProperty(localName = "outerEnum") @XmlElement(name = "outerEnum") private OuterEnum outerEnum; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 9ed3ee36498..e3207ecd97d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -33,12 +33,14 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "FileSchemaTestClass") public class FileSchemaTestClass { - @JsonProperty("file") + public static final String JSON_PROPERTY_FILE = "file"; + @JsonProperty(JSON_PROPERTY_FILE) @JacksonXmlProperty(localName = "file") @XmlElement(name = "file") private java.io.File file = null; - @JsonProperty("files") + public static final String JSON_PROPERTY_FILES = "files"; + @JsonProperty(JSON_PROPERTY_FILES) // Is a container wrapped=false // items.name=files items.baseName=files items.xmlName= items.xmlNamespace= // items.example= items.type=java.io.File diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java index b65f3d8d14c..e0328c647e8 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java @@ -36,67 +36,80 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "FormatTest") public class FormatTest { - @JsonProperty("integer") + public static final String JSON_PROPERTY_INTEGER = "integer"; + @JsonProperty(JSON_PROPERTY_INTEGER) @JacksonXmlProperty(localName = "integer") @XmlElement(name = "integer") private Integer integer; - @JsonProperty("int32") + public static final String JSON_PROPERTY_INT32 = "int32"; + @JsonProperty(JSON_PROPERTY_INT32) @JacksonXmlProperty(localName = "int32") @XmlElement(name = "int32") private Integer int32; - @JsonProperty("int64") + public static final String JSON_PROPERTY_INT64 = "int64"; + @JsonProperty(JSON_PROPERTY_INT64) @JacksonXmlProperty(localName = "int64") @XmlElement(name = "int64") private Long int64; - @JsonProperty("number") + public static final String JSON_PROPERTY_NUMBER = "number"; + @JsonProperty(JSON_PROPERTY_NUMBER) @JacksonXmlProperty(localName = "number") @XmlElement(name = "number") private BigDecimal number; - @JsonProperty("float") + public static final String JSON_PROPERTY_FLOAT = "float"; + @JsonProperty(JSON_PROPERTY_FLOAT) @JacksonXmlProperty(localName = "float") @XmlElement(name = "float") private Float _float; - @JsonProperty("double") + public static final String JSON_PROPERTY_DOUBLE = "double"; + @JsonProperty(JSON_PROPERTY_DOUBLE) @JacksonXmlProperty(localName = "double") @XmlElement(name = "double") private Double _double; - @JsonProperty("string") + public static final String JSON_PROPERTY_STRING = "string"; + @JsonProperty(JSON_PROPERTY_STRING) @JacksonXmlProperty(localName = "string") @XmlElement(name = "string") private String string; - @JsonProperty("byte") + public static final String JSON_PROPERTY_BYTE = "byte"; + @JsonProperty(JSON_PROPERTY_BYTE) @JacksonXmlProperty(localName = "byte") @XmlElement(name = "byte") private byte[] _byte; - @JsonProperty("binary") + public static final String JSON_PROPERTY_BINARY = "binary"; + @JsonProperty(JSON_PROPERTY_BINARY) @JacksonXmlProperty(localName = "binary") @XmlElement(name = "binary") private File binary; - @JsonProperty("date") + public static final String JSON_PROPERTY_DATE = "date"; + @JsonProperty(JSON_PROPERTY_DATE) @JacksonXmlProperty(localName = "date") @XmlElement(name = "date") private LocalDate date; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) @JacksonXmlProperty(localName = "dateTime") @XmlElement(name = "dateTime") private OffsetDateTime dateTime; - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) @JacksonXmlProperty(localName = "uuid") @XmlElement(name = "uuid") private UUID uuid; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) @JacksonXmlProperty(localName = "password") @XmlElement(name = "password") private String password; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 78ebe25cb27..c02be2c3ddc 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -31,12 +31,14 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "HasOnlyReadOnly") public class HasOnlyReadOnly { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) @JacksonXmlProperty(localName = "bar") @XmlElement(name = "bar") private String bar; - @JsonProperty("foo") + public static final String JSON_PROPERTY_FOO = "foo"; + @JsonProperty(JSON_PROPERTY_FOO) @JacksonXmlProperty(localName = "foo") @XmlElement(name = "foo") private String foo; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java index 1121f9769c1..44b51846ea5 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java @@ -34,7 +34,8 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "MapTest") public class MapTest { - @JsonProperty("map_map_of_string") + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) // Is a container wrapped=false // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= // items.example= items.type=Map<String, String> @@ -76,21 +77,24 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) // Is a container wrapped=false // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= // items.example= items.type=String @XmlElement(name = "inner") private Map mapOfEnumString = new HashMap(); - @JsonProperty("direct_map") + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) // Is a container wrapped=false // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= // items.example= items.type=Boolean @XmlElement(name = "inner") private Map directMap = new HashMap(); - @JsonProperty("indirect_map") + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) // Is a container wrapped=false // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= // items.example= items.type=Boolean diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index cda964b8c43..ff16a8c62bb 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -37,17 +37,20 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "MixedPropertiesAndAdditionalPropertiesClass") public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) @JacksonXmlProperty(localName = "uuid") @XmlElement(name = "uuid") private UUID uuid; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) @JacksonXmlProperty(localName = "dateTime") @XmlElement(name = "dateTime") private OffsetDateTime dateTime; - @JsonProperty("map") + public static final String JSON_PROPERTY_MAP = "map"; + @JsonProperty(JSON_PROPERTY_MAP) // Is a container wrapped=false // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= // items.example= items.type=Animal diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java index 09d309eb0dd..88715980d82 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java @@ -32,12 +32,14 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Name") public class Model200Response { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) @JacksonXmlProperty(localName = "name") @XmlElement(name = "name") private Integer name; - @JsonProperty("class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JacksonXmlProperty(localName = "class") @XmlElement(name = "class") private String propertyClass; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 352fc17d5f8..a2997af04dc 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -31,17 +31,20 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "ModelApiResponse") public class ModelApiResponse { - @JsonProperty("code") + public static final String JSON_PROPERTY_CODE = "code"; + @JsonProperty(JSON_PROPERTY_CODE) @JacksonXmlProperty(localName = "code") @XmlElement(name = "code") private Integer code; - @JsonProperty("type") + public static final String JSON_PROPERTY_TYPE = "type"; + @JsonProperty(JSON_PROPERTY_TYPE) @JacksonXmlProperty(localName = "type") @XmlElement(name = "type") private String type; - @JsonProperty("message") + public static final String JSON_PROPERTY_MESSAGE = "message"; + @JsonProperty(JSON_PROPERTY_MESSAGE) @JacksonXmlProperty(localName = "message") @XmlElement(name = "message") private String message; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java index 752ed979279..a56ca84199a 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -32,7 +32,8 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Return") public class ModelReturn { - @JsonProperty("return") + public static final String JSON_PROPERTY_RETURN = "return"; + @JsonProperty(JSON_PROPERTY_RETURN) @JacksonXmlProperty(localName = "return") @XmlElement(name = "return") private Integer _return; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java index 28d4559809e..aacb62b4d59 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java @@ -32,22 +32,26 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Name") public class Name { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) @JacksonXmlProperty(localName = "name") @XmlElement(name = "name") private Integer name; - @JsonProperty("snake_case") + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) @JacksonXmlProperty(localName = "snake_case") @XmlElement(name = "snake_case") private Integer snakeCase; - @JsonProperty("property") + public static final String JSON_PROPERTY_PROPERTY = "property"; + @JsonProperty(JSON_PROPERTY_PROPERTY) @JacksonXmlProperty(localName = "property") @XmlElement(name = "property") private String property; - @JsonProperty("123Number") + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + @JsonProperty(JSON_PROPERTY_123NUMBER) @JacksonXmlProperty(localName = "123Number") @XmlElement(name = "123Number") private Integer _123number; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java index 63de10209d5..c2a3752b5d8 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -32,7 +32,8 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "NumberOnly") public class NumberOnly { - @JsonProperty("JustNumber") + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) @JacksonXmlProperty(localName = "JustNumber") @XmlElement(name = "JustNumber") private BigDecimal justNumber; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java index ca5db6e8876..4a9e562d00c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java @@ -32,22 +32,26 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Order") public class Order { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) @JacksonXmlProperty(localName = "id") @XmlElement(name = "id") private Long id; - @JsonProperty("petId") + public static final String JSON_PROPERTY_PET_ID = "petId"; + @JsonProperty(JSON_PROPERTY_PET_ID) @JacksonXmlProperty(localName = "petId") @XmlElement(name = "petId") private Long petId; - @JsonProperty("quantity") + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + @JsonProperty(JSON_PROPERTY_QUANTITY) @JacksonXmlProperty(localName = "quantity") @XmlElement(name = "quantity") private Integer quantity; - @JsonProperty("shipDate") + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JacksonXmlProperty(localName = "shipDate") @XmlElement(name = "shipDate") private OffsetDateTime shipDate; @@ -89,12 +93,14 @@ public class Order { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) @JacksonXmlProperty(localName = "status") @XmlElement(name = "status") private StatusEnum status; - @JsonProperty("complete") + public static final String JSON_PROPERTY_COMPLETE = "complete"; + @JsonProperty(JSON_PROPERTY_COMPLETE) @JacksonXmlProperty(localName = "complete") @XmlElement(name = "complete") private Boolean complete = false; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java index a131baa5f84..1ee7b435736 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -32,17 +32,20 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "OuterComposite") public class OuterComposite { - @JsonProperty("my_number") + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + @JsonProperty(JSON_PROPERTY_MY_NUMBER) @JacksonXmlProperty(localName = "my_number") @XmlElement(name = "my_number") private BigDecimal myNumber; - @JsonProperty("my_string") + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + @JsonProperty(JSON_PROPERTY_MY_STRING) @JacksonXmlProperty(localName = "my_string") @XmlElement(name = "my_string") private String myString; - @JsonProperty("my_boolean") + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) @JacksonXmlProperty(localName = "my_boolean") @XmlElement(name = "my_boolean") private Boolean myBoolean; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java index 6bd167b2f15..de4747b1128 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java @@ -35,22 +35,26 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Pet") public class Pet { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) @JacksonXmlProperty(localName = "id") @XmlElement(name = "id") private Long id; - @JsonProperty("category") + public static final String JSON_PROPERTY_CATEGORY = "category"; + @JsonProperty(JSON_PROPERTY_CATEGORY) @JacksonXmlProperty(localName = "category") @XmlElement(name = "category") private Category category = null; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) @JacksonXmlProperty(localName = "name") @XmlElement(name = "name") private String name; - @JsonProperty("photoUrls") + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) // items.xmlName= @JacksonXmlElementWrapper(useWrapping = true, localName = "photoUrls") // Is a container wrapped=true @@ -60,7 +64,8 @@ public class Pet { @XmlElementWrapper(name = "photoUrl") private List photoUrls = new ArrayList(); - @JsonProperty("tags") + public static final String JSON_PROPERTY_TAGS = "tags"; + @JsonProperty(JSON_PROPERTY_TAGS) // items.xmlName= @JacksonXmlElementWrapper(useWrapping = true, localName = "tags") // Is a container wrapped=true @@ -107,7 +112,8 @@ public class Pet { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) @JacksonXmlProperty(localName = "status") @XmlElement(name = "status") private StatusEnum status; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index ea1177f44cb..95c3b1a6022 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -31,12 +31,14 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "ReadOnlyFirst") public class ReadOnlyFirst { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) @JacksonXmlProperty(localName = "bar") @XmlElement(name = "bar") private String bar; - @JsonProperty("baz") + public static final String JSON_PROPERTY_BAZ = "baz"; + @JsonProperty(JSON_PROPERTY_BAZ) @JacksonXmlProperty(localName = "baz") @XmlElement(name = "baz") private String baz; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java index 598db84f6bb..02bf80764c9 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -31,7 +31,8 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "$special[model.name]") public class SpecialModelName { - @JsonProperty("$special[property.name]") + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) @JacksonXmlProperty(localName = "$special[property.name]") @XmlElement(name = "$special[property.name]") private Long $specialPropertyName; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java index ce217a2c9a8..6942e79d6f1 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java @@ -31,12 +31,14 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Tag") public class Tag { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) @JacksonXmlProperty(localName = "id") @XmlElement(name = "id") private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) @JacksonXmlProperty(localName = "name") @XmlElement(name = "name") private String name; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 6a1a1c4600d..9012547ae0f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -34,27 +34,32 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "TypeHolderDefault") public class TypeHolderDefault { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) @JacksonXmlProperty(localName = "string_item") @XmlElement(name = "string_item") private String stringItem = "what"; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) @JacksonXmlProperty(localName = "number_item") @XmlElement(name = "number_item") private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) @JacksonXmlProperty(localName = "integer_item") @XmlElement(name = "integer_item") private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) @JacksonXmlProperty(localName = "bool_item") @XmlElement(name = "bool_item") private Boolean boolItem = true; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) // Is a container wrapped=false // items.name=arrayItem items.baseName=arrayItem items.xmlName= items.xmlNamespace= // items.example= items.type=Integer diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 290f1d2d47d..86b51dbe04c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -34,27 +34,32 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "TypeHolderExample") public class TypeHolderExample { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) @JacksonXmlProperty(localName = "string_item") @XmlElement(name = "string_item") private String stringItem; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) @JacksonXmlProperty(localName = "number_item") @XmlElement(name = "number_item") private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) @JacksonXmlProperty(localName = "integer_item") @XmlElement(name = "integer_item") private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) @JacksonXmlProperty(localName = "bool_item") @XmlElement(name = "bool_item") private Boolean boolItem; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) // Is a container wrapped=false // items.name=arrayItem items.baseName=arrayItem items.xmlName= items.xmlNamespace= // items.example= items.type=Integer diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java index fa805deb3e2..cabbb31fe80 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java @@ -31,42 +31,50 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "User") public class User { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) @JacksonXmlProperty(localName = "id") @XmlElement(name = "id") private Long id; - @JsonProperty("username") + public static final String JSON_PROPERTY_USERNAME = "username"; + @JsonProperty(JSON_PROPERTY_USERNAME) @JacksonXmlProperty(localName = "username") @XmlElement(name = "username") private String username; - @JsonProperty("firstName") + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + @JsonProperty(JSON_PROPERTY_FIRST_NAME) @JacksonXmlProperty(localName = "firstName") @XmlElement(name = "firstName") private String firstName; - @JsonProperty("lastName") + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + @JsonProperty(JSON_PROPERTY_LAST_NAME) @JacksonXmlProperty(localName = "lastName") @XmlElement(name = "lastName") private String lastName; - @JsonProperty("email") + public static final String JSON_PROPERTY_EMAIL = "email"; + @JsonProperty(JSON_PROPERTY_EMAIL) @JacksonXmlProperty(localName = "email") @XmlElement(name = "email") private String email; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) @JacksonXmlProperty(localName = "password") @XmlElement(name = "password") private String password; - @JsonProperty("phone") + public static final String JSON_PROPERTY_PHONE = "phone"; + @JsonProperty(JSON_PROPERTY_PHONE) @JacksonXmlProperty(localName = "phone") @XmlElement(name = "phone") private String phone; - @JsonProperty("userStatus") + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + @JsonProperty(JSON_PROPERTY_USER_STATUS) @JacksonXmlProperty(localName = "userStatus") @XmlElement(name = "userStatus") private Integer userStatus; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java index 3acfd5ce8fd..1276bde5287 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/XmlItem.java @@ -34,27 +34,32 @@ import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(namespace="http://a.com/schema", localName = "XmlItem") public class XmlItem { - @JsonProperty("attribute_string") + public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) @JacksonXmlProperty(isAttribute = true, localName = "attribute_string") @XmlAttribute(name = "attribute_string") private String attributeString; - @JsonProperty("attribute_number") + public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) @JacksonXmlProperty(isAttribute = true, localName = "attribute_number") @XmlAttribute(name = "attribute_number") private BigDecimal attributeNumber; - @JsonProperty("attribute_integer") + public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) @JacksonXmlProperty(isAttribute = true, localName = "attribute_integer") @XmlAttribute(name = "attribute_integer") private Integer attributeInteger; - @JsonProperty("attribute_boolean") + public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) @JacksonXmlProperty(isAttribute = true, localName = "attribute_boolean") @XmlAttribute(name = "attribute_boolean") private Boolean attributeBoolean; - @JsonProperty("wrapped_array") + public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) // items.xmlName= @JacksonXmlElementWrapper(useWrapping = true, localName = "wrappedArray") // Is a container wrapped=true @@ -64,34 +69,40 @@ public class XmlItem { @XmlElementWrapper(name = "wrapped_array") private List wrappedArray = new ArrayList(); - @JsonProperty("name_string") + public static final String JSON_PROPERTY_NAME_STRING = "name_string"; + @JsonProperty(JSON_PROPERTY_NAME_STRING) @JacksonXmlProperty(localName = "xml_name_string") @XmlElement(name = "xml_name_string") private String nameString; - @JsonProperty("name_number") + public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) @JacksonXmlProperty(localName = "xml_name_number") @XmlElement(name = "xml_name_number") private BigDecimal nameNumber; - @JsonProperty("name_integer") + public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) @JacksonXmlProperty(localName = "xml_name_integer") @XmlElement(name = "xml_name_integer") private Integer nameInteger; - @JsonProperty("name_boolean") + public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) @JacksonXmlProperty(localName = "xml_name_boolean") @XmlElement(name = "xml_name_boolean") private Boolean nameBoolean; - @JsonProperty("name_array") + public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) // Is a container wrapped=false // items.name=nameArray items.baseName=nameArray items.xmlName=xml_name_array_item items.xmlNamespace= // items.example= items.type=Integer @XmlElement(name = "xml_name_array_item") private List nameArray = new ArrayList(); - @JsonProperty("name_wrapped_array") + public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) // items.xmlName=xml_name_wrapped_array_item @JacksonXmlElementWrapper(useWrapping = true, localName = "xml_name_wrapped_array_item") // Is a container wrapped=true @@ -101,34 +112,40 @@ public class XmlItem { @XmlElementWrapper(name = "xml_name_wrapped_array") private List nameWrappedArray = new ArrayList(); - @JsonProperty("prefix_string") + public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) @JacksonXmlProperty(localName = "prefix_string") @XmlElement(name = "prefix_string") private String prefixString; - @JsonProperty("prefix_number") + public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) @JacksonXmlProperty(localName = "prefix_number") @XmlElement(name = "prefix_number") private BigDecimal prefixNumber; - @JsonProperty("prefix_integer") + public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) @JacksonXmlProperty(localName = "prefix_integer") @XmlElement(name = "prefix_integer") private Integer prefixInteger; - @JsonProperty("prefix_boolean") + public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) @JacksonXmlProperty(localName = "prefix_boolean") @XmlElement(name = "prefix_boolean") private Boolean prefixBoolean; - @JsonProperty("prefix_array") + public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) // Is a container wrapped=false // items.name=prefixArray items.baseName=prefixArray items.xmlName= items.xmlNamespace= // items.example= items.type=Integer @XmlElement(name = "prefixArray") private List prefixArray = new ArrayList(); - @JsonProperty("prefix_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) // items.xmlName= @JacksonXmlElementWrapper(useWrapping = true, localName = "prefixWrappedArray") // Is a container wrapped=true @@ -138,34 +155,40 @@ public class XmlItem { @XmlElementWrapper(name = "prefix_wrapped_array") private List prefixWrappedArray = new ArrayList(); - @JsonProperty("namespace_string") + public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) @JacksonXmlProperty(namespace="http://a.com/schema", localName = "namespace_string") @XmlElement(namespace="http://a.com/schema", name = "namespace_string") private String namespaceString; - @JsonProperty("namespace_number") + public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) @JacksonXmlProperty(namespace="http://b.com/schema", localName = "namespace_number") @XmlElement(namespace="http://b.com/schema", name = "namespace_number") private BigDecimal namespaceNumber; - @JsonProperty("namespace_integer") + public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) @JacksonXmlProperty(namespace="http://c.com/schema", localName = "namespace_integer") @XmlElement(namespace="http://c.com/schema", name = "namespace_integer") private Integer namespaceInteger; - @JsonProperty("namespace_boolean") + public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) @JacksonXmlProperty(namespace="http://d.com/schema", localName = "namespace_boolean") @XmlElement(namespace="http://d.com/schema", name = "namespace_boolean") private Boolean namespaceBoolean; - @JsonProperty("namespace_array") + public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) // Is a container wrapped=false // items.name=namespaceArray items.baseName=namespaceArray items.xmlName= items.xmlNamespace=http://e.com/schema // items.example= items.type=Integer @XmlElement(namespace="http://e.com/schema", name = "namespaceArray") private List namespaceArray = new ArrayList(); - @JsonProperty("namespace_wrapped_array") + public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) // items.xmlName= @JacksonXmlElementWrapper(useWrapping = true, namespace="http://f.com/schema", localName = "namespaceWrappedArray") // Is a container wrapped=true @@ -175,34 +198,40 @@ public class XmlItem { @XmlElementWrapper(namespace="http://f.com/schema", name = "namespace_wrapped_array") private List namespaceWrappedArray = new ArrayList(); - @JsonProperty("prefix_ns_string") + public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) @JacksonXmlProperty(namespace="http://a.com/schema", localName = "prefix_ns_string") @XmlElement(namespace="http://a.com/schema", name = "prefix_ns_string") private String prefixNsString; - @JsonProperty("prefix_ns_number") + public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) @JacksonXmlProperty(namespace="http://b.com/schema", localName = "prefix_ns_number") @XmlElement(namespace="http://b.com/schema", name = "prefix_ns_number") private BigDecimal prefixNsNumber; - @JsonProperty("prefix_ns_integer") + public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) @JacksonXmlProperty(namespace="http://c.com/schema", localName = "prefix_ns_integer") @XmlElement(namespace="http://c.com/schema", name = "prefix_ns_integer") private Integer prefixNsInteger; - @JsonProperty("prefix_ns_boolean") + public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) @JacksonXmlProperty(namespace="http://d.com/schema", localName = "prefix_ns_boolean") @XmlElement(namespace="http://d.com/schema", name = "prefix_ns_boolean") private Boolean prefixNsBoolean; - @JsonProperty("prefix_ns_array") + public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) // Is a container wrapped=false // items.name=prefixNsArray items.baseName=prefixNsArray items.xmlName= items.xmlNamespace=http://e.com/schema // items.example= items.type=Integer @XmlElement(namespace="http://e.com/schema", name = "prefixNsArray") private List prefixNsArray = new ArrayList(); - @JsonProperty("prefix_ns_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) // items.xmlName= @JacksonXmlElementWrapper(useWrapping = true, namespace="http://f.com/schema", localName = "prefixNsWrappedArray") // Is a container wrapped=true diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 69d6a817294..0df18c37e39 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 0147a592b7e..0d9a6b14532 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 89aa511c2a8..8e85a1f2246 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index cb955d1165a..cf0854acd00 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -30,37 +30,48 @@ import java.util.Map; */ public class AdditionalPropertiesClass { - @JsonProperty("map_string") + public static final String JSON_PROPERTY_MAP_STRING = "map_string"; + @JsonProperty(JSON_PROPERTY_MAP_STRING) private Map mapString = new HashMap(); - @JsonProperty("map_number") + public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) private Map mapNumber = new HashMap(); - @JsonProperty("map_integer") + public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) private Map mapInteger = new HashMap(); - @JsonProperty("map_boolean") + public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) private Map mapBoolean = new HashMap(); - @JsonProperty("map_array_integer") + public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) private Map> mapArrayInteger = new HashMap>(); - @JsonProperty("map_array_anytype") + public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) private Map> mapArrayAnytype = new HashMap>(); - @JsonProperty("map_map_string") + public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) private Map> mapMapString = new HashMap>(); - @JsonProperty("map_map_anytype") + public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) private Map> mapMapAnytype = new HashMap>(); - @JsonProperty("anytype_1") + public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + @JsonProperty(JSON_PROPERTY_ANYTYPE1) private Object anytype1 = null; - @JsonProperty("anytype_2") + public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; + @JsonProperty(JSON_PROPERTY_ANYTYPE2) private Object anytype2 = null; - @JsonProperty("anytype_3") + public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; + @JsonProperty(JSON_PROPERTY_ANYTYPE3) private Object anytype3 = null; public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index f27ff011de1..77388b95d86 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 479696fdcef..f0a3318bca1 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index bd569b0da3e..19d772f4522 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 27e03a2313e..09e6431c916 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesString name(String name) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java index dc16717ac32..a2d34d82f47 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java @@ -34,10 +34,12 @@ import io.swagger.annotations.ApiModelProperty; }) public class Animal { - @JsonProperty("className") + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; - @JsonProperty("color") + public static final String JSON_PROPERTY_COLOR = "color"; + @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; public Animal className(String className) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index b670ecb66e4..c3dd85a61ea 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import java.util.List; */ public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = new ArrayList>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 9d6997f88fc..2ae01f1581a 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import java.util.List; */ public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) private List arrayNumber = new ArrayList(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java index 7dc235f0a94..f5968901765 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -29,13 +29,16 @@ import org.openapitools.client.model.ReadOnlyFirst; */ public class ArrayTest { - @JsonProperty("array_of_string") + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) private List arrayOfString = new ArrayList(); - @JsonProperty("array_array_of_integer") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) private List> arrayArrayOfInteger = new ArrayList>(); - @JsonProperty("array_array_of_model") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = new ArrayList>(); public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java index 3f3df29d5da..1d4ebff1533 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java @@ -26,22 +26,28 @@ import io.swagger.annotations.ApiModelProperty; */ public class Capitalization { - @JsonProperty("smallCamel") + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; - @JsonProperty("CapitalCamel") + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; - @JsonProperty("small_Snake") + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; - @JsonProperty("Capital_Snake") + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java index a8108d6f151..11ffa39d982 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java @@ -28,7 +28,8 @@ import org.openapitools.client.model.CatAllOf; */ public class Cat extends Animal { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java index 42e96146107..1c12b1972cf 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class CatAllOf { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java index 3eccd2cd922..652d69552d1 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class Category { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; public Category id(Long id) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java index 2aaed27fffd..16036936e7a 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java @@ -27,7 +27,8 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { - @JsonProperty("_class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java index 458e8129602..a5c065a1dd0 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class Client { - @JsonProperty("client") + public static final String JSON_PROPERTY_CLIENT = "client"; + @JsonProperty(JSON_PROPERTY_CLIENT) private String client; public Client client(String client) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java index 83f5cb0e272..7ac3c33202e 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java @@ -28,7 +28,8 @@ import org.openapitools.client.model.DogAllOf; */ public class Dog extends Animal { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public Dog breed(String breed) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java index d1e1402789f..b79847a96e4 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class DogAllOf { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java index 368b481f7e5..10b3d358762 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -63,7 +63,8 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -101,7 +102,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) private List arrayEnum = new ArrayList(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java index b365a8a56fe..bde85ff2a09 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java @@ -64,7 +64,8 @@ public class EnumTest { } } - @JsonProperty("enum_string") + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -104,7 +105,8 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -142,7 +144,8 @@ public class EnumTest { } } - @JsonProperty("enum_integer") + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -180,10 +183,12 @@ public class EnumTest { } } - @JsonProperty("enum_number") + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index ca73764280c..5ce9290bba2 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -28,10 +28,12 @@ import java.util.List; */ public class FileSchemaTestClass { - @JsonProperty("file") + public static final String JSON_PROPERTY_FILE = "file"; + @JsonProperty(JSON_PROPERTY_FILE) private java.io.File file = null; - @JsonProperty("files") + public static final String JSON_PROPERTY_FILES = "files"; + @JsonProperty(JSON_PROPERTY_FILES) private List files = new ArrayList(); public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java index 00d132529e4..509048cd5e9 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java @@ -31,43 +31,56 @@ import org.threeten.bp.OffsetDateTime; */ public class FormatTest { - @JsonProperty("integer") + public static final String JSON_PROPERTY_INTEGER = "integer"; + @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; - @JsonProperty("int32") + public static final String JSON_PROPERTY_INT32 = "int32"; + @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; - @JsonProperty("int64") + public static final String JSON_PROPERTY_INT64 = "int64"; + @JsonProperty(JSON_PROPERTY_INT64) private Long int64; - @JsonProperty("number") + public static final String JSON_PROPERTY_NUMBER = "number"; + @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; - @JsonProperty("float") + public static final String JSON_PROPERTY_FLOAT = "float"; + @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; - @JsonProperty("double") + public static final String JSON_PROPERTY_DOUBLE = "double"; + @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; - @JsonProperty("string") + public static final String JSON_PROPERTY_STRING = "string"; + @JsonProperty(JSON_PROPERTY_STRING) private String string; - @JsonProperty("byte") + public static final String JSON_PROPERTY_BYTE = "byte"; + @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; - @JsonProperty("binary") + public static final String JSON_PROPERTY_BINARY = "binary"; + @JsonProperty(JSON_PROPERTY_BINARY) private File binary; - @JsonProperty("date") + public static final String JSON_PROPERTY_DATE = "date"; + @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index e9453bb6cce..ad6b28d9d1e 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class HasOnlyReadOnly { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("foo") + public static final String JSON_PROPERTY_FOO = "foo"; + @JsonProperty(JSON_PROPERTY_FOO) private String foo; /** diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java index 44cd694057a..0a57199a714 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class MapTest { - @JsonProperty("map_map_of_string") + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) private Map> mapMapOfString = new HashMap>(); /** @@ -67,13 +68,16 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) private Map mapOfEnumString = new HashMap(); - @JsonProperty("direct_map") + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) private Map directMap = new HashMap(); - @JsonProperty("indirect_map") + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) private Map indirectMap = new HashMap(); public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 19d808093c9..df68b7d4188 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -32,13 +32,16 @@ import org.threeten.bp.OffsetDateTime; */ public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") + public static final String JSON_PROPERTY_MAP = "map"; + @JsonProperty(JSON_PROPERTY_MAP) private Map map = new HashMap(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java index 39fabeeb6da..d86df5d7eab 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java @@ -27,10 +27,12 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model name starting with number") public class Model200Response { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java index bb334129511..4c9a7f87b5a 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -26,13 +26,16 @@ import io.swagger.annotations.ApiModelProperty; */ public class ModelApiResponse { - @JsonProperty("code") + public static final String JSON_PROPERTY_CODE = "code"; + @JsonProperty(JSON_PROPERTY_CODE) private Integer code; - @JsonProperty("type") + public static final String JSON_PROPERTY_TYPE = "type"; + @JsonProperty(JSON_PROPERTY_TYPE) private String type; - @JsonProperty("message") + public static final String JSON_PROPERTY_MESSAGE = "message"; + @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java index 9aafb13e04d..9c9ac21a3fb 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -27,7 +27,8 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing reserved words") public class ModelReturn { - @JsonProperty("return") + public static final String JSON_PROPERTY_RETURN = "return"; + @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java index 9518276dd61..47f89c54361 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java @@ -27,16 +27,20 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model name same as property name") public class Name { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("snake_case") + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; - @JsonProperty("property") + public static final String JSON_PROPERTY_PROPERTY = "property"; + @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; - @JsonProperty("123Number") + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; public Name name(Integer name) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java index 0245e8e2109..f5331da226e 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -27,7 +27,8 @@ import java.math.BigDecimal; */ public class NumberOnly { - @JsonProperty("JustNumber") + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java index a9e2986a2fe..0d6bc154e46 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java @@ -27,16 +27,20 @@ import org.threeten.bp.OffsetDateTime; */ public class Order { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("petId") + public static final String JSON_PROPERTY_PET_ID = "petId"; + @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; - @JsonProperty("quantity") + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; - @JsonProperty("shipDate") + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -76,10 +80,12 @@ public class Order { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; - @JsonProperty("complete") + public static final String JSON_PROPERTY_COMPLETE = "complete"; + @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; public Order id(Long id) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java index c8bd99011c0..7193ba2a0c9 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -27,13 +27,16 @@ import java.math.BigDecimal; */ public class OuterComposite { - @JsonProperty("my_number") + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; - @JsonProperty("my_string") + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; - @JsonProperty("my_boolean") + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java index a7d92129d73..b907822ed01 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java @@ -30,19 +30,24 @@ import org.openapitools.client.model.Tag; */ public class Pet { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("category") + public static final String JSON_PROPERTY_CATEGORY = "category"; + @JsonProperty(JSON_PROPERTY_CATEGORY) private Category category = null; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; - @JsonProperty("photoUrls") + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList(); - @JsonProperty("tags") + public static final String JSON_PROPERTY_TAGS = "tags"; + @JsonProperty(JSON_PROPERTY_TAGS) private List tags = new ArrayList(); /** @@ -82,7 +87,8 @@ public class Pet { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public Pet id(Long id) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 1379ee09ea6..b0949b9e2ea 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class ReadOnlyFirst { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("baz") + public static final String JSON_PROPERTY_BAZ = "baz"; + @JsonProperty(JSON_PROPERTY_BAZ) private String baz; /** diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java index 869771afad8..a9d03234061 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class SpecialModelName { - @JsonProperty("$special[property.name]") + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java index 4bb498aff43..45f17b22cf3 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class Tag { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public Tag id(Long id) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 9d0f5b2fbea..0961f776fb0 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -29,19 +29,24 @@ import java.util.List; */ public class TypeHolderDefault { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 94d3c57b6f2..3617c5c16b2 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -29,19 +29,24 @@ import java.util.List; */ public class TypeHolderExample { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java index 73164c3ee28..9ce7869e755 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java @@ -26,28 +26,36 @@ import io.swagger.annotations.ApiModelProperty; */ public class User { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("username") + public static final String JSON_PROPERTY_USERNAME = "username"; + @JsonProperty(JSON_PROPERTY_USERNAME) private String username; - @JsonProperty("firstName") + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; - @JsonProperty("lastName") + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; - @JsonProperty("email") + public static final String JSON_PROPERTY_EMAIL = "email"; + @JsonProperty(JSON_PROPERTY_EMAIL) private String email; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; - @JsonProperty("phone") + public static final String JSON_PROPERTY_PHONE = "phone"; + @JsonProperty(JSON_PROPERTY_PHONE) private String phone; - @JsonProperty("userStatus") + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; public User id(Long id) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java index 9032c234249..151939d6054 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/XmlItem.java @@ -29,91 +29,120 @@ import java.util.List; */ public class XmlItem { - @JsonProperty("attribute_string") + public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; - @JsonProperty("attribute_number") + public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; - @JsonProperty("attribute_integer") + public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; - @JsonProperty("attribute_boolean") + public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; - @JsonProperty("wrapped_array") + public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) private List wrappedArray = new ArrayList(); - @JsonProperty("name_string") + public static final String JSON_PROPERTY_NAME_STRING = "name_string"; + @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; - @JsonProperty("name_number") + public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; - @JsonProperty("name_integer") + public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; - @JsonProperty("name_boolean") + public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; - @JsonProperty("name_array") + public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) private List nameArray = new ArrayList(); - @JsonProperty("name_wrapped_array") + public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) private List nameWrappedArray = new ArrayList(); - @JsonProperty("prefix_string") + public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; - @JsonProperty("prefix_number") + public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; - @JsonProperty("prefix_integer") + public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; - @JsonProperty("prefix_boolean") + public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; - @JsonProperty("prefix_array") + public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) private List prefixArray = new ArrayList(); - @JsonProperty("prefix_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) private List prefixWrappedArray = new ArrayList(); - @JsonProperty("namespace_string") + public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; - @JsonProperty("namespace_number") + public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; - @JsonProperty("namespace_integer") + public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; - @JsonProperty("namespace_boolean") + public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; - @JsonProperty("namespace_array") + public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) private List namespaceArray = new ArrayList(); - @JsonProperty("namespace_wrapped_array") + public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) private List namespaceWrappedArray = new ArrayList(); - @JsonProperty("prefix_ns_string") + public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; - @JsonProperty("prefix_ns_number") + public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; - @JsonProperty("prefix_ns_integer") + public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; - @JsonProperty("prefix_ns_boolean") + public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; - @JsonProperty("prefix_ns_array") + public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) private List prefixNsArray = new ArrayList(); - @JsonProperty("prefix_ns_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) private List prefixNsWrappedArray = new ArrayList(); public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 3957e297c7b..fccdfd9063b 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 2c04404bbc6..ca93793eb92 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -31,7 +31,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index b8a58226319..bcc0c1468af 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 5587bce61c2..8c80863eaa5 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -32,37 +32,48 @@ import javax.validation.Valid; */ public class AdditionalPropertiesClass { - @JsonProperty("map_string") + public static final String JSON_PROPERTY_MAP_STRING = "map_string"; + @JsonProperty(JSON_PROPERTY_MAP_STRING) private Map mapString = new HashMap<>(); - @JsonProperty("map_number") + public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) private Map mapNumber = new HashMap<>(); - @JsonProperty("map_integer") + public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) private Map mapInteger = new HashMap<>(); - @JsonProperty("map_boolean") + public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) private Map mapBoolean = new HashMap<>(); - @JsonProperty("map_array_integer") + public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) private Map> mapArrayInteger = new HashMap<>(); - @JsonProperty("map_array_anytype") + public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) private Map> mapArrayAnytype = new HashMap<>(); - @JsonProperty("map_map_string") + public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) private Map> mapMapString = new HashMap<>(); - @JsonProperty("map_map_anytype") + public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) private Map> mapMapAnytype = new HashMap<>(); - @JsonProperty("anytype_1") + public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + @JsonProperty(JSON_PROPERTY_ANYTYPE1) private Object anytype1 = null; - @JsonProperty("anytype_2") + public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; + @JsonProperty(JSON_PROPERTY_ANYTYPE2) private Object anytype2 = null; - @JsonProperty("anytype_3") + public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; + @JsonProperty(JSON_PROPERTY_ANYTYPE3) private Object anytype3 = null; public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index f9e8b853c26..9df2c41186a 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 854dc4c82a7..9a86f4a655d 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -31,7 +31,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 722dc937bb2..d7e32f25cbe 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 7681ad996c1..600622d7cab 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesString name(String name) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java index 5354367c55a..a43ceea7064 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java @@ -36,10 +36,12 @@ import javax.validation.Valid; }) public class Animal { - @JsonProperty("className") + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; - @JsonProperty("color") + public static final String JSON_PROPERTY_COLOR = "color"; + @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; public Animal className(String className) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index a7c82bc3546..07c2946dda3 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -31,7 +31,8 @@ import javax.validation.Valid; */ public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 4e77327cd60..365c359b845 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -31,7 +31,8 @@ import javax.validation.Valid; */ public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ArrayTest.java index 6ddf0e10250..1c9ab40620c 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -31,13 +31,16 @@ import javax.validation.Valid; */ public class ArrayTest { - @JsonProperty("array_of_string") + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) private List arrayOfString = new ArrayList<>(); - @JsonProperty("array_array_of_integer") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) private List> arrayArrayOfInteger = new ArrayList<>(); - @JsonProperty("array_array_of_model") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Capitalization.java index 7711c16a395..65f5b799d25 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Capitalization.java @@ -28,22 +28,28 @@ import javax.validation.Valid; */ public class Capitalization { - @JsonProperty("smallCamel") + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; - @JsonProperty("CapitalCamel") + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; - @JsonProperty("small_Snake") + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; - @JsonProperty("Capital_Snake") + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Cat.java index 19f9190ee92..d0e872ebd73 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Cat.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class Cat extends Animal { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/CatAllOf.java index c99b9a33986..e72f96cee93 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class CatAllOf { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Category.java index 31476c70b79..4f388371ed5 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Category.java @@ -28,10 +28,12 @@ import javax.validation.Valid; */ public class Category { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; public Category id(Long id) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ClassModel.java index 4067f2eaf43..b7b9081f44a 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ClassModel.java @@ -29,7 +29,8 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { - @JsonProperty("_class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Client.java index fd0084ed14e..b0ae0657c79 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Client.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class Client { - @JsonProperty("client") + public static final String JSON_PROPERTY_CLIENT = "client"; + @JsonProperty(JSON_PROPERTY_CLIENT) private String client; public Client client(String client) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Dog.java index 251c2381ab3..d9656d309a7 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Dog.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class Dog extends Animal { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public Dog breed(String breed) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/DogAllOf.java index 15821bf9b6b..500f5a63d0e 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class DogAllOf { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/EnumArrays.java index 85899b20ff3..1711a75939a 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -65,7 +65,8 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -103,7 +104,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/EnumTest.java index 5c0a43e659e..7148143b17d 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/EnumTest.java @@ -66,7 +66,8 @@ public class EnumTest { } } - @JsonProperty("enum_string") + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -106,7 +107,8 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -144,7 +146,8 @@ public class EnumTest { } } - @JsonProperty("enum_integer") + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -182,10 +185,12 @@ public class EnumTest { } } - @JsonProperty("enum_number") + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index c68dcd56672..4b53c0068d5 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -30,10 +30,12 @@ import javax.validation.Valid; */ public class FileSchemaTestClass { - @JsonProperty("file") + public static final String JSON_PROPERTY_FILE = "file"; + @JsonProperty(JSON_PROPERTY_FILE) private java.io.File file = null; - @JsonProperty("files") + public static final String JSON_PROPERTY_FILES = "files"; + @JsonProperty(JSON_PROPERTY_FILES) private List files = new ArrayList<>(); public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/FormatTest.java index 1a7a30289b8..28f3431520a 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/FormatTest.java @@ -33,43 +33,56 @@ import javax.validation.Valid; */ public class FormatTest { - @JsonProperty("integer") + public static final String JSON_PROPERTY_INTEGER = "integer"; + @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; - @JsonProperty("int32") + public static final String JSON_PROPERTY_INT32 = "int32"; + @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; - @JsonProperty("int64") + public static final String JSON_PROPERTY_INT64 = "int64"; + @JsonProperty(JSON_PROPERTY_INT64) private Long int64; - @JsonProperty("number") + public static final String JSON_PROPERTY_NUMBER = "number"; + @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; - @JsonProperty("float") + public static final String JSON_PROPERTY_FLOAT = "float"; + @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; - @JsonProperty("double") + public static final String JSON_PROPERTY_DOUBLE = "double"; + @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; - @JsonProperty("string") + public static final String JSON_PROPERTY_STRING = "string"; + @JsonProperty(JSON_PROPERTY_STRING) private String string; - @JsonProperty("byte") + public static final String JSON_PROPERTY_BYTE = "byte"; + @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; - @JsonProperty("binary") + public static final String JSON_PROPERTY_BINARY = "binary"; + @JsonProperty(JSON_PROPERTY_BINARY) private File binary; - @JsonProperty("date") + public static final String JSON_PROPERTY_DATE = "date"; + @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 0f8354388a3..f2175b7f513 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -28,10 +28,12 @@ import javax.validation.Valid; */ public class HasOnlyReadOnly { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("foo") + public static final String JSON_PROPERTY_FOO = "foo"; + @JsonProperty(JSON_PROPERTY_FOO) private String foo; /** diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/MapTest.java index 7dcfedc5996..5b93accce61 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/MapTest.java @@ -31,7 +31,8 @@ import javax.validation.Valid; */ public class MapTest { - @JsonProperty("map_map_of_string") + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) private Map> mapMapOfString = new HashMap<>(); /** @@ -69,13 +70,16 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) private Map mapOfEnumString = new HashMap<>(); - @JsonProperty("direct_map") + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) private Map directMap = new HashMap<>(); - @JsonProperty("indirect_map") + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index f3e7b506dec..7b2418c3fd8 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -34,13 +34,16 @@ import javax.validation.Valid; */ public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") + public static final String JSON_PROPERTY_MAP = "map"; + @JsonProperty(JSON_PROPERTY_MAP) private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Model200Response.java index 2652b3f75dd..8de17e10609 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Model200Response.java @@ -29,10 +29,12 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing model name starting with number") public class Model200Response { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 14390481147..874cba97c69 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -28,13 +28,16 @@ import javax.validation.Valid; */ public class ModelApiResponse { - @JsonProperty("code") + public static final String JSON_PROPERTY_CODE = "code"; + @JsonProperty(JSON_PROPERTY_CODE) private Integer code; - @JsonProperty("type") + public static final String JSON_PROPERTY_TYPE = "type"; + @JsonProperty(JSON_PROPERTY_TYPE) private String type; - @JsonProperty("message") + public static final String JSON_PROPERTY_MESSAGE = "message"; + @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ModelReturn.java index 864b466565e..e606f768eb9 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -29,7 +29,8 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing reserved words") public class ModelReturn { - @JsonProperty("return") + public static final String JSON_PROPERTY_RETURN = "return"; + @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Name.java index 085892f4d4b..9dfdb681267 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Name.java @@ -29,16 +29,20 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing model name same as property name") public class Name { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("snake_case") + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; - @JsonProperty("property") + public static final String JSON_PROPERTY_PROPERTY = "property"; + @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; - @JsonProperty("123Number") + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; public Name name(Integer name) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/NumberOnly.java index 3c04811b8ff..7f083e23a3d 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class NumberOnly { - @JsonProperty("JustNumber") + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Order.java index a42495c55d9..2c967b37274 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Order.java @@ -29,16 +29,20 @@ import javax.validation.Valid; */ public class Order { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("petId") + public static final String JSON_PROPERTY_PET_ID = "petId"; + @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; - @JsonProperty("quantity") + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; - @JsonProperty("shipDate") + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -78,10 +82,12 @@ public class Order { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; - @JsonProperty("complete") + public static final String JSON_PROPERTY_COMPLETE = "complete"; + @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; public Order id(Long id) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/OuterComposite.java index eb24ea692b6..17e6de1f014 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -29,13 +29,16 @@ import javax.validation.Valid; */ public class OuterComposite { - @JsonProperty("my_number") + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; - @JsonProperty("my_string") + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; - @JsonProperty("my_boolean") + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Pet.java index 6c7bc70b5dc..f5a50b7f813 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Pet.java @@ -32,19 +32,24 @@ import javax.validation.Valid; */ public class Pet { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("category") + public static final String JSON_PROPERTY_CATEGORY = "category"; + @JsonProperty(JSON_PROPERTY_CATEGORY) private Category category = null; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; - @JsonProperty("photoUrls") + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList<>(); - @JsonProperty("tags") + public static final String JSON_PROPERTY_TAGS = "tags"; + @JsonProperty(JSON_PROPERTY_TAGS) private List tags = new ArrayList<>(); /** @@ -84,7 +89,8 @@ public class Pet { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public Pet id(Long id) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index c6f758922c7..61b2e2debfd 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -28,10 +28,12 @@ import javax.validation.Valid; */ public class ReadOnlyFirst { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("baz") + public static final String JSON_PROPERTY_BAZ = "baz"; + @JsonProperty(JSON_PROPERTY_BAZ) private String baz; /** diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/SpecialModelName.java index 7d8bc5e8337..65fabe673de 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class SpecialModelName { - @JsonProperty("$special[property.name]") + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Tag.java index 6c20df9d7ef..42f80f36b72 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Tag.java @@ -28,10 +28,12 @@ import javax.validation.Valid; */ public class Tag { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public Tag id(Long id) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 6f1c4237069..0468a2364b1 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -31,19 +31,24 @@ import javax.validation.Valid; */ public class TypeHolderDefault { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/TypeHolderExample.java index f1e1e7792ac..2912e8d03e3 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -31,19 +31,24 @@ import javax.validation.Valid; */ public class TypeHolderExample { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/User.java index 3782d8dd84e..ebfc1761025 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/User.java @@ -28,28 +28,36 @@ import javax.validation.Valid; */ public class User { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("username") + public static final String JSON_PROPERTY_USERNAME = "username"; + @JsonProperty(JSON_PROPERTY_USERNAME) private String username; - @JsonProperty("firstName") + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; - @JsonProperty("lastName") + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; - @JsonProperty("email") + public static final String JSON_PROPERTY_EMAIL = "email"; + @JsonProperty(JSON_PROPERTY_EMAIL) private String email; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; - @JsonProperty("phone") + public static final String JSON_PROPERTY_PHONE = "phone"; + @JsonProperty(JSON_PROPERTY_PHONE) private String phone; - @JsonProperty("userStatus") + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; public User id(Long id) { diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/XmlItem.java index e07171cd7cf..452a0b3c01a 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/XmlItem.java @@ -31,91 +31,120 @@ import javax.validation.Valid; */ public class XmlItem { - @JsonProperty("attribute_string") + public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; - @JsonProperty("attribute_number") + public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; - @JsonProperty("attribute_integer") + public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; - @JsonProperty("attribute_boolean") + public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; - @JsonProperty("wrapped_array") + public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) private List wrappedArray = new ArrayList<>(); - @JsonProperty("name_string") + public static final String JSON_PROPERTY_NAME_STRING = "name_string"; + @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; - @JsonProperty("name_number") + public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; - @JsonProperty("name_integer") + public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; - @JsonProperty("name_boolean") + public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; - @JsonProperty("name_array") + public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) private List nameArray = new ArrayList<>(); - @JsonProperty("name_wrapped_array") + public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) private List nameWrappedArray = new ArrayList<>(); - @JsonProperty("prefix_string") + public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; - @JsonProperty("prefix_number") + public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; - @JsonProperty("prefix_integer") + public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; - @JsonProperty("prefix_boolean") + public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; - @JsonProperty("prefix_array") + public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) private List prefixArray = new ArrayList<>(); - @JsonProperty("prefix_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) private List prefixWrappedArray = new ArrayList<>(); - @JsonProperty("namespace_string") + public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; - @JsonProperty("namespace_number") + public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; - @JsonProperty("namespace_integer") + public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; - @JsonProperty("namespace_boolean") + public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; - @JsonProperty("namespace_array") + public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) private List namespaceArray = new ArrayList<>(); - @JsonProperty("namespace_wrapped_array") + public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) private List namespaceWrappedArray = new ArrayList<>(); - @JsonProperty("prefix_ns_string") + public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; - @JsonProperty("prefix_ns_number") + public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; - @JsonProperty("prefix_ns_integer") + public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; - @JsonProperty("prefix_ns_boolean") + public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; - @JsonProperty("prefix_ns_array") + public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) private List prefixNsArray = new ArrayList<>(); - @JsonProperty("prefix_ns_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 3957e297c7b..fccdfd9063b 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 2c04404bbc6..ca93793eb92 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -31,7 +31,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index b8a58226319..bcc0c1468af 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 5587bce61c2..8c80863eaa5 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -32,37 +32,48 @@ import javax.validation.Valid; */ public class AdditionalPropertiesClass { - @JsonProperty("map_string") + public static final String JSON_PROPERTY_MAP_STRING = "map_string"; + @JsonProperty(JSON_PROPERTY_MAP_STRING) private Map mapString = new HashMap<>(); - @JsonProperty("map_number") + public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) private Map mapNumber = new HashMap<>(); - @JsonProperty("map_integer") + public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) private Map mapInteger = new HashMap<>(); - @JsonProperty("map_boolean") + public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) private Map mapBoolean = new HashMap<>(); - @JsonProperty("map_array_integer") + public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) private Map> mapArrayInteger = new HashMap<>(); - @JsonProperty("map_array_anytype") + public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) private Map> mapArrayAnytype = new HashMap<>(); - @JsonProperty("map_map_string") + public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) private Map> mapMapString = new HashMap<>(); - @JsonProperty("map_map_anytype") + public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) private Map> mapMapAnytype = new HashMap<>(); - @JsonProperty("anytype_1") + public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + @JsonProperty(JSON_PROPERTY_ANYTYPE1) private Object anytype1 = null; - @JsonProperty("anytype_2") + public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; + @JsonProperty(JSON_PROPERTY_ANYTYPE2) private Object anytype2 = null; - @JsonProperty("anytype_3") + public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; + @JsonProperty(JSON_PROPERTY_ANYTYPE3) private Object anytype3 = null; public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index f9e8b853c26..9df2c41186a 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 854dc4c82a7..9a86f4a655d 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -31,7 +31,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 722dc937bb2..d7e32f25cbe 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 7681ad996c1..600622d7cab 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesString name(String name) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java index 5354367c55a..a43ceea7064 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java @@ -36,10 +36,12 @@ import javax.validation.Valid; }) public class Animal { - @JsonProperty("className") + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; - @JsonProperty("color") + public static final String JSON_PROPERTY_COLOR = "color"; + @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; public Animal className(String className) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index a7c82bc3546..07c2946dda3 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -31,7 +31,8 @@ import javax.validation.Valid; */ public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 4e77327cd60..365c359b845 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -31,7 +31,8 @@ import javax.validation.Valid; */ public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ArrayTest.java index 6ddf0e10250..1c9ab40620c 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -31,13 +31,16 @@ import javax.validation.Valid; */ public class ArrayTest { - @JsonProperty("array_of_string") + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) private List arrayOfString = new ArrayList<>(); - @JsonProperty("array_array_of_integer") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) private List> arrayArrayOfInteger = new ArrayList<>(); - @JsonProperty("array_array_of_model") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Capitalization.java index 7711c16a395..65f5b799d25 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Capitalization.java @@ -28,22 +28,28 @@ import javax.validation.Valid; */ public class Capitalization { - @JsonProperty("smallCamel") + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; - @JsonProperty("CapitalCamel") + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; - @JsonProperty("small_Snake") + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; - @JsonProperty("Capital_Snake") + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Cat.java index 19f9190ee92..d0e872ebd73 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Cat.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class Cat extends Animal { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/CatAllOf.java index c99b9a33986..e72f96cee93 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class CatAllOf { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Category.java index 31476c70b79..4f388371ed5 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Category.java @@ -28,10 +28,12 @@ import javax.validation.Valid; */ public class Category { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; public Category id(Long id) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ClassModel.java index 4067f2eaf43..b7b9081f44a 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ClassModel.java @@ -29,7 +29,8 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { - @JsonProperty("_class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Client.java index fd0084ed14e..b0ae0657c79 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Client.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class Client { - @JsonProperty("client") + public static final String JSON_PROPERTY_CLIENT = "client"; + @JsonProperty(JSON_PROPERTY_CLIENT) private String client; public Client client(String client) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Dog.java index 251c2381ab3..d9656d309a7 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Dog.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class Dog extends Animal { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public Dog breed(String breed) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/DogAllOf.java index 15821bf9b6b..500f5a63d0e 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class DogAllOf { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/EnumArrays.java index 85899b20ff3..1711a75939a 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -65,7 +65,8 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -103,7 +104,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/EnumTest.java index 5c0a43e659e..7148143b17d 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/EnumTest.java @@ -66,7 +66,8 @@ public class EnumTest { } } - @JsonProperty("enum_string") + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -106,7 +107,8 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -144,7 +146,8 @@ public class EnumTest { } } - @JsonProperty("enum_integer") + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -182,10 +185,12 @@ public class EnumTest { } } - @JsonProperty("enum_number") + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index c68dcd56672..4b53c0068d5 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -30,10 +30,12 @@ import javax.validation.Valid; */ public class FileSchemaTestClass { - @JsonProperty("file") + public static final String JSON_PROPERTY_FILE = "file"; + @JsonProperty(JSON_PROPERTY_FILE) private java.io.File file = null; - @JsonProperty("files") + public static final String JSON_PROPERTY_FILES = "files"; + @JsonProperty(JSON_PROPERTY_FILES) private List files = new ArrayList<>(); public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/FormatTest.java index 83981730428..f9637c52227 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/FormatTest.java @@ -33,43 +33,56 @@ import javax.validation.Valid; */ public class FormatTest { - @JsonProperty("integer") + public static final String JSON_PROPERTY_INTEGER = "integer"; + @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; - @JsonProperty("int32") + public static final String JSON_PROPERTY_INT32 = "int32"; + @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; - @JsonProperty("int64") + public static final String JSON_PROPERTY_INT64 = "int64"; + @JsonProperty(JSON_PROPERTY_INT64) private Long int64; - @JsonProperty("number") + public static final String JSON_PROPERTY_NUMBER = "number"; + @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; - @JsonProperty("float") + public static final String JSON_PROPERTY_FLOAT = "float"; + @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; - @JsonProperty("double") + public static final String JSON_PROPERTY_DOUBLE = "double"; + @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; - @JsonProperty("string") + public static final String JSON_PROPERTY_STRING = "string"; + @JsonProperty(JSON_PROPERTY_STRING) private String string; - @JsonProperty("byte") + public static final String JSON_PROPERTY_BYTE = "byte"; + @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; - @JsonProperty("binary") + public static final String JSON_PROPERTY_BINARY = "binary"; + @JsonProperty(JSON_PROPERTY_BINARY) private File binary; - @JsonProperty("date") + public static final String JSON_PROPERTY_DATE = "date"; + @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 0f8354388a3..f2175b7f513 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -28,10 +28,12 @@ import javax.validation.Valid; */ public class HasOnlyReadOnly { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("foo") + public static final String JSON_PROPERTY_FOO = "foo"; + @JsonProperty(JSON_PROPERTY_FOO) private String foo; /** diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/MapTest.java index 7dcfedc5996..5b93accce61 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/MapTest.java @@ -31,7 +31,8 @@ import javax.validation.Valid; */ public class MapTest { - @JsonProperty("map_map_of_string") + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) private Map> mapMapOfString = new HashMap<>(); /** @@ -69,13 +70,16 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) private Map mapOfEnumString = new HashMap<>(); - @JsonProperty("direct_map") + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) private Map directMap = new HashMap<>(); - @JsonProperty("indirect_map") + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 29958bbf94d..7d93a45c45f 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -34,13 +34,16 @@ import javax.validation.Valid; */ public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") + public static final String JSON_PROPERTY_MAP = "map"; + @JsonProperty(JSON_PROPERTY_MAP) private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Model200Response.java index 2652b3f75dd..8de17e10609 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Model200Response.java @@ -29,10 +29,12 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing model name starting with number") public class Model200Response { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 14390481147..874cba97c69 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -28,13 +28,16 @@ import javax.validation.Valid; */ public class ModelApiResponse { - @JsonProperty("code") + public static final String JSON_PROPERTY_CODE = "code"; + @JsonProperty(JSON_PROPERTY_CODE) private Integer code; - @JsonProperty("type") + public static final String JSON_PROPERTY_TYPE = "type"; + @JsonProperty(JSON_PROPERTY_TYPE) private String type; - @JsonProperty("message") + public static final String JSON_PROPERTY_MESSAGE = "message"; + @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ModelReturn.java index 864b466565e..e606f768eb9 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -29,7 +29,8 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing reserved words") public class ModelReturn { - @JsonProperty("return") + public static final String JSON_PROPERTY_RETURN = "return"; + @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Name.java index 085892f4d4b..9dfdb681267 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Name.java @@ -29,16 +29,20 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing model name same as property name") public class Name { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("snake_case") + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; - @JsonProperty("property") + public static final String JSON_PROPERTY_PROPERTY = "property"; + @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; - @JsonProperty("123Number") + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; public Name name(Integer name) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/NumberOnly.java index 3c04811b8ff..7f083e23a3d 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class NumberOnly { - @JsonProperty("JustNumber") + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Order.java index db957a8f0e2..b5aaf42748a 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Order.java @@ -29,16 +29,20 @@ import javax.validation.Valid; */ public class Order { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("petId") + public static final String JSON_PROPERTY_PET_ID = "petId"; + @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; - @JsonProperty("quantity") + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; - @JsonProperty("shipDate") + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -78,10 +82,12 @@ public class Order { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; - @JsonProperty("complete") + public static final String JSON_PROPERTY_COMPLETE = "complete"; + @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; public Order id(Long id) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/OuterComposite.java index eb24ea692b6..17e6de1f014 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -29,13 +29,16 @@ import javax.validation.Valid; */ public class OuterComposite { - @JsonProperty("my_number") + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; - @JsonProperty("my_string") + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; - @JsonProperty("my_boolean") + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Pet.java index 6c7bc70b5dc..f5a50b7f813 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Pet.java @@ -32,19 +32,24 @@ import javax.validation.Valid; */ public class Pet { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("category") + public static final String JSON_PROPERTY_CATEGORY = "category"; + @JsonProperty(JSON_PROPERTY_CATEGORY) private Category category = null; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; - @JsonProperty("photoUrls") + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList<>(); - @JsonProperty("tags") + public static final String JSON_PROPERTY_TAGS = "tags"; + @JsonProperty(JSON_PROPERTY_TAGS) private List tags = new ArrayList<>(); /** @@ -84,7 +89,8 @@ public class Pet { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public Pet id(Long id) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index c6f758922c7..61b2e2debfd 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -28,10 +28,12 @@ import javax.validation.Valid; */ public class ReadOnlyFirst { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("baz") + public static final String JSON_PROPERTY_BAZ = "baz"; + @JsonProperty(JSON_PROPERTY_BAZ) private String baz; /** diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/SpecialModelName.java index 7d8bc5e8337..65fabe673de 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class SpecialModelName { - @JsonProperty("$special[property.name]") + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Tag.java index 6c20df9d7ef..42f80f36b72 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Tag.java @@ -28,10 +28,12 @@ import javax.validation.Valid; */ public class Tag { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public Tag id(Long id) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 6f1c4237069..0468a2364b1 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -31,19 +31,24 @@ import javax.validation.Valid; */ public class TypeHolderDefault { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/TypeHolderExample.java index f1e1e7792ac..2912e8d03e3 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -31,19 +31,24 @@ import javax.validation.Valid; */ public class TypeHolderExample { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/User.java index 3782d8dd84e..ebfc1761025 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/User.java @@ -28,28 +28,36 @@ import javax.validation.Valid; */ public class User { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("username") + public static final String JSON_PROPERTY_USERNAME = "username"; + @JsonProperty(JSON_PROPERTY_USERNAME) private String username; - @JsonProperty("firstName") + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; - @JsonProperty("lastName") + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; - @JsonProperty("email") + public static final String JSON_PROPERTY_EMAIL = "email"; + @JsonProperty(JSON_PROPERTY_EMAIL) private String email; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; - @JsonProperty("phone") + public static final String JSON_PROPERTY_PHONE = "phone"; + @JsonProperty(JSON_PROPERTY_PHONE) private String phone; - @JsonProperty("userStatus") + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; public User id(Long id) { diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/XmlItem.java index e07171cd7cf..452a0b3c01a 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/XmlItem.java @@ -31,91 +31,120 @@ import javax.validation.Valid; */ public class XmlItem { - @JsonProperty("attribute_string") + public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; - @JsonProperty("attribute_number") + public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; - @JsonProperty("attribute_integer") + public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; - @JsonProperty("attribute_boolean") + public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; - @JsonProperty("wrapped_array") + public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) private List wrappedArray = new ArrayList<>(); - @JsonProperty("name_string") + public static final String JSON_PROPERTY_NAME_STRING = "name_string"; + @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; - @JsonProperty("name_number") + public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; - @JsonProperty("name_integer") + public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; - @JsonProperty("name_boolean") + public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; - @JsonProperty("name_array") + public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) private List nameArray = new ArrayList<>(); - @JsonProperty("name_wrapped_array") + public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) private List nameWrappedArray = new ArrayList<>(); - @JsonProperty("prefix_string") + public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; - @JsonProperty("prefix_number") + public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; - @JsonProperty("prefix_integer") + public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; - @JsonProperty("prefix_boolean") + public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; - @JsonProperty("prefix_array") + public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) private List prefixArray = new ArrayList<>(); - @JsonProperty("prefix_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) private List prefixWrappedArray = new ArrayList<>(); - @JsonProperty("namespace_string") + public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; - @JsonProperty("namespace_number") + public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; - @JsonProperty("namespace_integer") + public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; - @JsonProperty("namespace_boolean") + public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; - @JsonProperty("namespace_array") + public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) private List namespaceArray = new ArrayList<>(); - @JsonProperty("namespace_wrapped_array") + public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) private List namespaceWrappedArray = new ArrayList<>(); - @JsonProperty("prefix_ns_string") + public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; - @JsonProperty("prefix_ns_number") + public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; - @JsonProperty("prefix_ns_integer") + public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; - @JsonProperty("prefix_ns_boolean") + public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; - @JsonProperty("prefix_ns_array") + public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) private List prefixNsArray = new ArrayList<>(); - @JsonProperty("prefix_ns_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 3957e297c7b..fccdfd9063b 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 2c04404bbc6..ca93793eb92 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -31,7 +31,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index b8a58226319..bcc0c1468af 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 5587bce61c2..8c80863eaa5 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -32,37 +32,48 @@ import javax.validation.Valid; */ public class AdditionalPropertiesClass { - @JsonProperty("map_string") + public static final String JSON_PROPERTY_MAP_STRING = "map_string"; + @JsonProperty(JSON_PROPERTY_MAP_STRING) private Map mapString = new HashMap<>(); - @JsonProperty("map_number") + public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) private Map mapNumber = new HashMap<>(); - @JsonProperty("map_integer") + public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) private Map mapInteger = new HashMap<>(); - @JsonProperty("map_boolean") + public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) private Map mapBoolean = new HashMap<>(); - @JsonProperty("map_array_integer") + public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) private Map> mapArrayInteger = new HashMap<>(); - @JsonProperty("map_array_anytype") + public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) private Map> mapArrayAnytype = new HashMap<>(); - @JsonProperty("map_map_string") + public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) private Map> mapMapString = new HashMap<>(); - @JsonProperty("map_map_anytype") + public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) private Map> mapMapAnytype = new HashMap<>(); - @JsonProperty("anytype_1") + public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + @JsonProperty(JSON_PROPERTY_ANYTYPE1) private Object anytype1 = null; - @JsonProperty("anytype_2") + public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; + @JsonProperty(JSON_PROPERTY_ANYTYPE2) private Object anytype2 = null; - @JsonProperty("anytype_3") + public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; + @JsonProperty(JSON_PROPERTY_ANYTYPE3) private Object anytype3 = null; public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index f9e8b853c26..9df2c41186a 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 854dc4c82a7..9a86f4a655d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -31,7 +31,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 722dc937bb2..d7e32f25cbe 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 7681ad996c1..600622d7cab 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesString name(String name) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java index 5354367c55a..a43ceea7064 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java @@ -36,10 +36,12 @@ import javax.validation.Valid; }) public class Animal { - @JsonProperty("className") + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; - @JsonProperty("color") + public static final String JSON_PROPERTY_COLOR = "color"; + @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; public Animal className(String className) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index a7c82bc3546..07c2946dda3 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -31,7 +31,8 @@ import javax.validation.Valid; */ public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 4e77327cd60..365c359b845 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -31,7 +31,8 @@ import javax.validation.Valid; */ public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java index 6ddf0e10250..1c9ab40620c 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -31,13 +31,16 @@ import javax.validation.Valid; */ public class ArrayTest { - @JsonProperty("array_of_string") + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) private List arrayOfString = new ArrayList<>(); - @JsonProperty("array_array_of_integer") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) private List> arrayArrayOfInteger = new ArrayList<>(); - @JsonProperty("array_array_of_model") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java index 7711c16a395..65f5b799d25 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Capitalization.java @@ -28,22 +28,28 @@ import javax.validation.Valid; */ public class Capitalization { - @JsonProperty("smallCamel") + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; - @JsonProperty("CapitalCamel") + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; - @JsonProperty("small_Snake") + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; - @JsonProperty("Capital_Snake") + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java index 19f9190ee92..d0e872ebd73 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Cat.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class Cat extends Animal { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java index c99b9a33986..e72f96cee93 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class CatAllOf { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java index 31476c70b79..4f388371ed5 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Category.java @@ -28,10 +28,12 @@ import javax.validation.Valid; */ public class Category { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; public Category id(Long id) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java index 4067f2eaf43..b7b9081f44a 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ClassModel.java @@ -29,7 +29,8 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { - @JsonProperty("_class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java index fd0084ed14e..b0ae0657c79 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Client.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class Client { - @JsonProperty("client") + public static final String JSON_PROPERTY_CLIENT = "client"; + @JsonProperty(JSON_PROPERTY_CLIENT) private String client; public Client client(String client) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java index 251c2381ab3..d9656d309a7 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Dog.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class Dog extends Animal { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public Dog breed(String breed) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java index 15821bf9b6b..500f5a63d0e 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class DogAllOf { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java index 85899b20ff3..1711a75939a 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -65,7 +65,8 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -103,7 +104,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java index 5c0a43e659e..7148143b17d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/EnumTest.java @@ -66,7 +66,8 @@ public class EnumTest { } } - @JsonProperty("enum_string") + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -106,7 +107,8 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -144,7 +146,8 @@ public class EnumTest { } } - @JsonProperty("enum_integer") + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -182,10 +185,12 @@ public class EnumTest { } } - @JsonProperty("enum_number") + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index c68dcd56672..4b53c0068d5 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -30,10 +30,12 @@ import javax.validation.Valid; */ public class FileSchemaTestClass { - @JsonProperty("file") + public static final String JSON_PROPERTY_FILE = "file"; + @JsonProperty(JSON_PROPERTY_FILE) private java.io.File file = null; - @JsonProperty("files") + public static final String JSON_PROPERTY_FILES = "files"; + @JsonProperty(JSON_PROPERTY_FILES) private List files = new ArrayList<>(); public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java index 83981730428..f9637c52227 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/FormatTest.java @@ -33,43 +33,56 @@ import javax.validation.Valid; */ public class FormatTest { - @JsonProperty("integer") + public static final String JSON_PROPERTY_INTEGER = "integer"; + @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; - @JsonProperty("int32") + public static final String JSON_PROPERTY_INT32 = "int32"; + @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; - @JsonProperty("int64") + public static final String JSON_PROPERTY_INT64 = "int64"; + @JsonProperty(JSON_PROPERTY_INT64) private Long int64; - @JsonProperty("number") + public static final String JSON_PROPERTY_NUMBER = "number"; + @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; - @JsonProperty("float") + public static final String JSON_PROPERTY_FLOAT = "float"; + @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; - @JsonProperty("double") + public static final String JSON_PROPERTY_DOUBLE = "double"; + @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; - @JsonProperty("string") + public static final String JSON_PROPERTY_STRING = "string"; + @JsonProperty(JSON_PROPERTY_STRING) private String string; - @JsonProperty("byte") + public static final String JSON_PROPERTY_BYTE = "byte"; + @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; - @JsonProperty("binary") + public static final String JSON_PROPERTY_BINARY = "binary"; + @JsonProperty(JSON_PROPERTY_BINARY) private File binary; - @JsonProperty("date") + public static final String JSON_PROPERTY_DATE = "date"; + @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 0f8354388a3..f2175b7f513 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -28,10 +28,12 @@ import javax.validation.Valid; */ public class HasOnlyReadOnly { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("foo") + public static final String JSON_PROPERTY_FOO = "foo"; + @JsonProperty(JSON_PROPERTY_FOO) private String foo; /** diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java index 7dcfedc5996..5b93accce61 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MapTest.java @@ -31,7 +31,8 @@ import javax.validation.Valid; */ public class MapTest { - @JsonProperty("map_map_of_string") + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) private Map> mapMapOfString = new HashMap<>(); /** @@ -69,13 +70,16 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) private Map mapOfEnumString = new HashMap<>(); - @JsonProperty("direct_map") + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) private Map directMap = new HashMap<>(); - @JsonProperty("indirect_map") + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 29958bbf94d..7d93a45c45f 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -34,13 +34,16 @@ import javax.validation.Valid; */ public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") + public static final String JSON_PROPERTY_MAP = "map"; + @JsonProperty(JSON_PROPERTY_MAP) private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java index 2652b3f75dd..8de17e10609 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Model200Response.java @@ -29,10 +29,12 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing model name starting with number") public class Model200Response { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 14390481147..874cba97c69 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -28,13 +28,16 @@ import javax.validation.Valid; */ public class ModelApiResponse { - @JsonProperty("code") + public static final String JSON_PROPERTY_CODE = "code"; + @JsonProperty(JSON_PROPERTY_CODE) private Integer code; - @JsonProperty("type") + public static final String JSON_PROPERTY_TYPE = "type"; + @JsonProperty(JSON_PROPERTY_TYPE) private String type; - @JsonProperty("message") + public static final String JSON_PROPERTY_MESSAGE = "message"; + @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java index 864b466565e..e606f768eb9 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -29,7 +29,8 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing reserved words") public class ModelReturn { - @JsonProperty("return") + public static final String JSON_PROPERTY_RETURN = "return"; + @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java index 085892f4d4b..9dfdb681267 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Name.java @@ -29,16 +29,20 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing model name same as property name") public class Name { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("snake_case") + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; - @JsonProperty("property") + public static final String JSON_PROPERTY_PROPERTY = "property"; + @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; - @JsonProperty("123Number") + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; public Name name(Integer name) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java index 3c04811b8ff..7f083e23a3d 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class NumberOnly { - @JsonProperty("JustNumber") + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java index db957a8f0e2..b5aaf42748a 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Order.java @@ -29,16 +29,20 @@ import javax.validation.Valid; */ public class Order { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("petId") + public static final String JSON_PROPERTY_PET_ID = "petId"; + @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; - @JsonProperty("quantity") + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; - @JsonProperty("shipDate") + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -78,10 +82,12 @@ public class Order { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; - @JsonProperty("complete") + public static final String JSON_PROPERTY_COMPLETE = "complete"; + @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; public Order id(Long id) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java index eb24ea692b6..17e6de1f014 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -29,13 +29,16 @@ import javax.validation.Valid; */ public class OuterComposite { - @JsonProperty("my_number") + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; - @JsonProperty("my_string") + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; - @JsonProperty("my_boolean") + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java index 6c7bc70b5dc..f5a50b7f813 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java @@ -32,19 +32,24 @@ import javax.validation.Valid; */ public class Pet { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("category") + public static final String JSON_PROPERTY_CATEGORY = "category"; + @JsonProperty(JSON_PROPERTY_CATEGORY) private Category category = null; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; - @JsonProperty("photoUrls") + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList<>(); - @JsonProperty("tags") + public static final String JSON_PROPERTY_TAGS = "tags"; + @JsonProperty(JSON_PROPERTY_TAGS) private List tags = new ArrayList<>(); /** @@ -84,7 +89,8 @@ public class Pet { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public Pet id(Long id) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index c6f758922c7..61b2e2debfd 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -28,10 +28,12 @@ import javax.validation.Valid; */ public class ReadOnlyFirst { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("baz") + public static final String JSON_PROPERTY_BAZ = "baz"; + @JsonProperty(JSON_PROPERTY_BAZ) private String baz; /** diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java index 7d8bc5e8337..65fabe673de 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class SpecialModelName { - @JsonProperty("$special[property.name]") + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java index 6c20df9d7ef..42f80f36b72 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Tag.java @@ -28,10 +28,12 @@ import javax.validation.Valid; */ public class Tag { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public Tag id(Long id) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 6f1c4237069..0468a2364b1 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -31,19 +31,24 @@ import javax.validation.Valid; */ public class TypeHolderDefault { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java index f1e1e7792ac..2912e8d03e3 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -31,19 +31,24 @@ import javax.validation.Valid; */ public class TypeHolderExample { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java index 3782d8dd84e..ebfc1761025 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/User.java @@ -28,28 +28,36 @@ import javax.validation.Valid; */ public class User { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("username") + public static final String JSON_PROPERTY_USERNAME = "username"; + @JsonProperty(JSON_PROPERTY_USERNAME) private String username; - @JsonProperty("firstName") + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; - @JsonProperty("lastName") + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; - @JsonProperty("email") + public static final String JSON_PROPERTY_EMAIL = "email"; + @JsonProperty(JSON_PROPERTY_EMAIL) private String email; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; - @JsonProperty("phone") + public static final String JSON_PROPERTY_PHONE = "phone"; + @JsonProperty(JSON_PROPERTY_PHONE) private String phone; - @JsonProperty("userStatus") + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; public User id(Long id) { diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java index e07171cd7cf..452a0b3c01a 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/XmlItem.java @@ -31,91 +31,120 @@ import javax.validation.Valid; */ public class XmlItem { - @JsonProperty("attribute_string") + public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; - @JsonProperty("attribute_number") + public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; - @JsonProperty("attribute_integer") + public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; - @JsonProperty("attribute_boolean") + public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; - @JsonProperty("wrapped_array") + public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) private List wrappedArray = new ArrayList<>(); - @JsonProperty("name_string") + public static final String JSON_PROPERTY_NAME_STRING = "name_string"; + @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; - @JsonProperty("name_number") + public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; - @JsonProperty("name_integer") + public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; - @JsonProperty("name_boolean") + public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; - @JsonProperty("name_array") + public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) private List nameArray = new ArrayList<>(); - @JsonProperty("name_wrapped_array") + public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) private List nameWrappedArray = new ArrayList<>(); - @JsonProperty("prefix_string") + public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; - @JsonProperty("prefix_number") + public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; - @JsonProperty("prefix_integer") + public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; - @JsonProperty("prefix_boolean") + public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; - @JsonProperty("prefix_array") + public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) private List prefixArray = new ArrayList<>(); - @JsonProperty("prefix_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) private List prefixWrappedArray = new ArrayList<>(); - @JsonProperty("namespace_string") + public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; - @JsonProperty("namespace_number") + public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; - @JsonProperty("namespace_integer") + public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; - @JsonProperty("namespace_boolean") + public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; - @JsonProperty("namespace_array") + public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) private List namespaceArray = new ArrayList<>(); - @JsonProperty("namespace_wrapped_array") + public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) private List namespaceWrappedArray = new ArrayList<>(); - @JsonProperty("prefix_ns_string") + public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; - @JsonProperty("prefix_ns_number") + public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; - @JsonProperty("prefix_ns_integer") + public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; - @JsonProperty("prefix_ns_boolean") + public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; - @JsonProperty("prefix_ns_array") + public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) private List prefixNsArray = new ArrayList<>(); - @JsonProperty("prefix_ns_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 69d6a817294..0df18c37e39 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 0147a592b7e..0d9a6b14532 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 89aa511c2a8..8e85a1f2246 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index ecb4e102ea2..dc8ea1e9ec3 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -30,37 +30,48 @@ import java.util.Map; */ public class AdditionalPropertiesClass { - @JsonProperty("map_string") + public static final String JSON_PROPERTY_MAP_STRING = "map_string"; + @JsonProperty(JSON_PROPERTY_MAP_STRING) private Map mapString = new HashMap<>(); - @JsonProperty("map_number") + public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) private Map mapNumber = new HashMap<>(); - @JsonProperty("map_integer") + public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) private Map mapInteger = new HashMap<>(); - @JsonProperty("map_boolean") + public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) private Map mapBoolean = new HashMap<>(); - @JsonProperty("map_array_integer") + public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) private Map> mapArrayInteger = new HashMap<>(); - @JsonProperty("map_array_anytype") + public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) private Map> mapArrayAnytype = new HashMap<>(); - @JsonProperty("map_map_string") + public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) private Map> mapMapString = new HashMap<>(); - @JsonProperty("map_map_anytype") + public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) private Map> mapMapAnytype = new HashMap<>(); - @JsonProperty("anytype_1") + public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + @JsonProperty(JSON_PROPERTY_ANYTYPE1) private Object anytype1 = null; - @JsonProperty("anytype_2") + public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; + @JsonProperty(JSON_PROPERTY_ANYTYPE2) private Object anytype2 = null; - @JsonProperty("anytype_3") + public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; + @JsonProperty(JSON_PROPERTY_ANYTYPE3) private Object anytype3 = null; public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index f27ff011de1..77388b95d86 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 479696fdcef..f0a3318bca1 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index bd569b0da3e..19d772f4522 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 27e03a2313e..09e6431c916 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesString name(String name) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java index dc16717ac32..a2d34d82f47 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java @@ -34,10 +34,12 @@ import io.swagger.annotations.ApiModelProperty; }) public class Animal { - @JsonProperty("className") + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; - @JsonProperty("color") + public static final String JSON_PROPERTY_COLOR = "color"; + @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; public Animal className(String className) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 66e9fba5d75..ce83908187a 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import java.util.List; */ public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 9f5b467a314..ad502738c10 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import java.util.List; */ public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java index 7ac67880894..d0c2fc409c5 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -29,13 +29,16 @@ import org.openapitools.client.model.ReadOnlyFirst; */ public class ArrayTest { - @JsonProperty("array_of_string") + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) private List arrayOfString = new ArrayList<>(); - @JsonProperty("array_array_of_integer") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) private List> arrayArrayOfInteger = new ArrayList<>(); - @JsonProperty("array_array_of_model") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java index 3f3df29d5da..1d4ebff1533 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Capitalization.java @@ -26,22 +26,28 @@ import io.swagger.annotations.ApiModelProperty; */ public class Capitalization { - @JsonProperty("smallCamel") + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; - @JsonProperty("CapitalCamel") + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; - @JsonProperty("small_Snake") + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; - @JsonProperty("Capital_Snake") + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java index a8108d6f151..11ffa39d982 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Cat.java @@ -28,7 +28,8 @@ import org.openapitools.client.model.CatAllOf; */ public class Cat extends Animal { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java index 42e96146107..1c12b1972cf 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class CatAllOf { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java index 3eccd2cd922..652d69552d1 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Category.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class Category { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; public Category id(Long id) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java index 2aaed27fffd..16036936e7a 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ClassModel.java @@ -27,7 +27,8 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { - @JsonProperty("_class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java index 458e8129602..a5c065a1dd0 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Client.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class Client { - @JsonProperty("client") + public static final String JSON_PROPERTY_CLIENT = "client"; + @JsonProperty(JSON_PROPERTY_CLIENT) private String client; public Client client(String client) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java index 83f5cb0e272..7ac3c33202e 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Dog.java @@ -28,7 +28,8 @@ import org.openapitools.client.model.DogAllOf; */ public class Dog extends Animal { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public Dog breed(String breed) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java index d1e1402789f..b79847a96e4 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class DogAllOf { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java index a3bd1af4725..2db426ab8bf 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -63,7 +63,8 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -101,7 +102,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java index b365a8a56fe..bde85ff2a09 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/EnumTest.java @@ -64,7 +64,8 @@ public class EnumTest { } } - @JsonProperty("enum_string") + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -104,7 +105,8 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -142,7 +144,8 @@ public class EnumTest { } } - @JsonProperty("enum_integer") + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -180,10 +183,12 @@ public class EnumTest { } } - @JsonProperty("enum_number") + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index ad8cf751e11..2c247d819ce 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -28,10 +28,12 @@ import java.util.List; */ public class FileSchemaTestClass { - @JsonProperty("file") + public static final String JSON_PROPERTY_FILE = "file"; + @JsonProperty(JSON_PROPERTY_FILE) private java.io.File file = null; - @JsonProperty("files") + public static final String JSON_PROPERTY_FILES = "files"; + @JsonProperty(JSON_PROPERTY_FILES) private List files = new ArrayList<>(); public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java index b08bc944dd4..e1795a8bf25 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/FormatTest.java @@ -31,43 +31,56 @@ import java.util.UUID; */ public class FormatTest { - @JsonProperty("integer") + public static final String JSON_PROPERTY_INTEGER = "integer"; + @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; - @JsonProperty("int32") + public static final String JSON_PROPERTY_INT32 = "int32"; + @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; - @JsonProperty("int64") + public static final String JSON_PROPERTY_INT64 = "int64"; + @JsonProperty(JSON_PROPERTY_INT64) private Long int64; - @JsonProperty("number") + public static final String JSON_PROPERTY_NUMBER = "number"; + @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; - @JsonProperty("float") + public static final String JSON_PROPERTY_FLOAT = "float"; + @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; - @JsonProperty("double") + public static final String JSON_PROPERTY_DOUBLE = "double"; + @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; - @JsonProperty("string") + public static final String JSON_PROPERTY_STRING = "string"; + @JsonProperty(JSON_PROPERTY_STRING) private String string; - @JsonProperty("byte") + public static final String JSON_PROPERTY_BYTE = "byte"; + @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; - @JsonProperty("binary") + public static final String JSON_PROPERTY_BINARY = "binary"; + @JsonProperty(JSON_PROPERTY_BINARY) private AsyncFile binary; - @JsonProperty("date") + public static final String JSON_PROPERTY_DATE = "date"; + @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index e9453bb6cce..ad6b28d9d1e 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class HasOnlyReadOnly { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("foo") + public static final String JSON_PROPERTY_FOO = "foo"; + @JsonProperty(JSON_PROPERTY_FOO) private String foo; /** diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java index b0d3e04bb63..021d59d2570 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MapTest.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class MapTest { - @JsonProperty("map_map_of_string") + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) private Map> mapMapOfString = new HashMap<>(); /** @@ -67,13 +68,16 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) private Map mapOfEnumString = new HashMap<>(); - @JsonProperty("direct_map") + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) private Map directMap = new HashMap<>(); - @JsonProperty("indirect_map") + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index fed78a2162f..ad173f004a1 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -32,13 +32,16 @@ import org.openapitools.client.model.Animal; */ public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") + public static final String JSON_PROPERTY_MAP = "map"; + @JsonProperty(JSON_PROPERTY_MAP) private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java index 39fabeeb6da..d86df5d7eab 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Model200Response.java @@ -27,10 +27,12 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model name starting with number") public class Model200Response { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java index bb334129511..4c9a7f87b5a 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -26,13 +26,16 @@ import io.swagger.annotations.ApiModelProperty; */ public class ModelApiResponse { - @JsonProperty("code") + public static final String JSON_PROPERTY_CODE = "code"; + @JsonProperty(JSON_PROPERTY_CODE) private Integer code; - @JsonProperty("type") + public static final String JSON_PROPERTY_TYPE = "type"; + @JsonProperty(JSON_PROPERTY_TYPE) private String type; - @JsonProperty("message") + public static final String JSON_PROPERTY_MESSAGE = "message"; + @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java index 9aafb13e04d..9c9ac21a3fb 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -27,7 +27,8 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing reserved words") public class ModelReturn { - @JsonProperty("return") + public static final String JSON_PROPERTY_RETURN = "return"; + @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java index 9518276dd61..47f89c54361 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Name.java @@ -27,16 +27,20 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model name same as property name") public class Name { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("snake_case") + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; - @JsonProperty("property") + public static final String JSON_PROPERTY_PROPERTY = "property"; + @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; - @JsonProperty("123Number") + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; public Name name(Integer name) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java index 0245e8e2109..f5331da226e 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -27,7 +27,8 @@ import java.math.BigDecimal; */ public class NumberOnly { - @JsonProperty("JustNumber") + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java index 594c76e484d..0730133f9cb 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Order.java @@ -27,16 +27,20 @@ import java.time.OffsetDateTime; */ public class Order { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("petId") + public static final String JSON_PROPERTY_PET_ID = "petId"; + @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; - @JsonProperty("quantity") + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; - @JsonProperty("shipDate") + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -76,10 +80,12 @@ public class Order { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; - @JsonProperty("complete") + public static final String JSON_PROPERTY_COMPLETE = "complete"; + @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; public Order id(Long id) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java index c8bd99011c0..7193ba2a0c9 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -27,13 +27,16 @@ import java.math.BigDecimal; */ public class OuterComposite { - @JsonProperty("my_number") + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; - @JsonProperty("my_string") + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; - @JsonProperty("my_boolean") + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java index 08f37737561..b8e18631bf1 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java @@ -30,19 +30,24 @@ import org.openapitools.client.model.Tag; */ public class Pet { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("category") + public static final String JSON_PROPERTY_CATEGORY = "category"; + @JsonProperty(JSON_PROPERTY_CATEGORY) private Category category = null; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; - @JsonProperty("photoUrls") + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList<>(); - @JsonProperty("tags") + public static final String JSON_PROPERTY_TAGS = "tags"; + @JsonProperty(JSON_PROPERTY_TAGS) private List tags = new ArrayList<>(); /** @@ -82,7 +87,8 @@ public class Pet { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public Pet id(Long id) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 1379ee09ea6..b0949b9e2ea 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class ReadOnlyFirst { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("baz") + public static final String JSON_PROPERTY_BAZ = "baz"; + @JsonProperty(JSON_PROPERTY_BAZ) private String baz; /** diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java index 869771afad8..a9d03234061 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class SpecialModelName { - @JsonProperty("$special[property.name]") + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java index 4bb498aff43..45f17b22cf3 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Tag.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class Tag { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public Tag id(Long id) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 3c6488d270a..3f3030998f1 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -29,19 +29,24 @@ import java.util.List; */ public class TypeHolderDefault { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 812b5839aa5..99ddaa8d2eb 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -29,19 +29,24 @@ import java.util.List; */ public class TypeHolderExample { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java index 73164c3ee28..9ce7869e755 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/User.java @@ -26,28 +26,36 @@ import io.swagger.annotations.ApiModelProperty; */ public class User { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("username") + public static final String JSON_PROPERTY_USERNAME = "username"; + @JsonProperty(JSON_PROPERTY_USERNAME) private String username; - @JsonProperty("firstName") + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; - @JsonProperty("lastName") + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; - @JsonProperty("email") + public static final String JSON_PROPERTY_EMAIL = "email"; + @JsonProperty(JSON_PROPERTY_EMAIL) private String email; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; - @JsonProperty("phone") + public static final String JSON_PROPERTY_PHONE = "phone"; + @JsonProperty(JSON_PROPERTY_PHONE) private String phone; - @JsonProperty("userStatus") + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; public User id(Long id) { diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java index aa7ff22ccde..66404193208 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/XmlItem.java @@ -29,91 +29,120 @@ import java.util.List; */ public class XmlItem { - @JsonProperty("attribute_string") + public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; - @JsonProperty("attribute_number") + public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; - @JsonProperty("attribute_integer") + public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; - @JsonProperty("attribute_boolean") + public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; - @JsonProperty("wrapped_array") + public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) private List wrappedArray = new ArrayList<>(); - @JsonProperty("name_string") + public static final String JSON_PROPERTY_NAME_STRING = "name_string"; + @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; - @JsonProperty("name_number") + public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; - @JsonProperty("name_integer") + public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; - @JsonProperty("name_boolean") + public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; - @JsonProperty("name_array") + public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) private List nameArray = new ArrayList<>(); - @JsonProperty("name_wrapped_array") + public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) private List nameWrappedArray = new ArrayList<>(); - @JsonProperty("prefix_string") + public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; - @JsonProperty("prefix_number") + public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; - @JsonProperty("prefix_integer") + public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; - @JsonProperty("prefix_boolean") + public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; - @JsonProperty("prefix_array") + public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) private List prefixArray = new ArrayList<>(); - @JsonProperty("prefix_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) private List prefixWrappedArray = new ArrayList<>(); - @JsonProperty("namespace_string") + public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; - @JsonProperty("namespace_number") + public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; - @JsonProperty("namespace_integer") + public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; - @JsonProperty("namespace_boolean") + public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; - @JsonProperty("namespace_array") + public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) private List namespaceArray = new ArrayList<>(); - @JsonProperty("namespace_wrapped_array") + public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) private List namespaceWrappedArray = new ArrayList<>(); - @JsonProperty("prefix_ns_string") + public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; - @JsonProperty("prefix_ns_number") + public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; - @JsonProperty("prefix_ns_integer") + public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; - @JsonProperty("prefix_ns_boolean") + public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; - @JsonProperty("prefix_ns_array") + public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) private List prefixNsArray = new ArrayList<>(); - @JsonProperty("prefix_ns_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(String attributeString) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 69d6a817294..0df18c37e39 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 0147a592b7e..0d9a6b14532 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesArray name(String name) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 89aa511c2a8..8e85a1f2246 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index ecb4e102ea2..dc8ea1e9ec3 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -30,37 +30,48 @@ import java.util.Map; */ public class AdditionalPropertiesClass { - @JsonProperty("map_string") + public static final String JSON_PROPERTY_MAP_STRING = "map_string"; + @JsonProperty(JSON_PROPERTY_MAP_STRING) private Map mapString = new HashMap<>(); - @JsonProperty("map_number") + public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) private Map mapNumber = new HashMap<>(); - @JsonProperty("map_integer") + public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) private Map mapInteger = new HashMap<>(); - @JsonProperty("map_boolean") + public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) private Map mapBoolean = new HashMap<>(); - @JsonProperty("map_array_integer") + public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) private Map> mapArrayInteger = new HashMap<>(); - @JsonProperty("map_array_anytype") + public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) private Map> mapArrayAnytype = new HashMap<>(); - @JsonProperty("map_map_string") + public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) private Map> mapMapString = new HashMap<>(); - @JsonProperty("map_map_anytype") + public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) private Map> mapMapAnytype = new HashMap<>(); - @JsonProperty("anytype_1") + public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + @JsonProperty(JSON_PROPERTY_ANYTYPE1) private Object anytype1 = null; - @JsonProperty("anytype_2") + public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; + @JsonProperty(JSON_PROPERTY_ANYTYPE2) private Object anytype2 = null; - @JsonProperty("anytype_3") + public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; + @JsonProperty(JSON_PROPERTY_ANYTYPE3) private Object anytype3 = null; public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index f27ff011de1..77388b95d86 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesInteger name(String name) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 479696fdcef..f0a3318bca1 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesNumber name(String name) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index bd569b0da3e..19d772f4522 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesObject name(String name) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 27e03a2313e..09e6431c916 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -28,7 +28,8 @@ import java.util.Map; */ public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesString name(String name) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java index dc16717ac32..a2d34d82f47 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java @@ -34,10 +34,12 @@ import io.swagger.annotations.ApiModelProperty; }) public class Animal { - @JsonProperty("className") + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; - @JsonProperty("color") + public static final String JSON_PROPERTY_COLOR = "color"; + @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; public Animal className(String className) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 66e9fba5d75..ce83908187a 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import java.util.List; */ public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 9f5b467a314..ad502738c10 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import java.util.List; */ public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java index 7ac67880894..d0c2fc409c5 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -29,13 +29,16 @@ import org.openapitools.client.model.ReadOnlyFirst; */ public class ArrayTest { - @JsonProperty("array_of_string") + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) private List arrayOfString = new ArrayList<>(); - @JsonProperty("array_array_of_integer") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) private List> arrayArrayOfInteger = new ArrayList<>(); - @JsonProperty("array_array_of_model") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java index 3f3df29d5da..1d4ebff1533 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Capitalization.java @@ -26,22 +26,28 @@ import io.swagger.annotations.ApiModelProperty; */ public class Capitalization { - @JsonProperty("smallCamel") + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; - @JsonProperty("CapitalCamel") + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; - @JsonProperty("small_Snake") + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; - @JsonProperty("Capital_Snake") + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java index a8108d6f151..11ffa39d982 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Cat.java @@ -28,7 +28,8 @@ import org.openapitools.client.model.CatAllOf; */ public class Cat extends Animal { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public Cat declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java index 42e96146107..1c12b1972cf 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class CatAllOf { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public CatAllOf declawed(Boolean declawed) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java index 3eccd2cd922..652d69552d1 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Category.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class Category { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; public Category id(Long id) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java index 2aaed27fffd..16036936e7a 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ClassModel.java @@ -27,7 +27,8 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { - @JsonProperty("_class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public ClassModel propertyClass(String propertyClass) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java index 458e8129602..a5c065a1dd0 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Client.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class Client { - @JsonProperty("client") + public static final String JSON_PROPERTY_CLIENT = "client"; + @JsonProperty(JSON_PROPERTY_CLIENT) private String client; public Client client(String client) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java index 83f5cb0e272..7ac3c33202e 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Dog.java @@ -28,7 +28,8 @@ import org.openapitools.client.model.DogAllOf; */ public class Dog extends Animal { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public Dog breed(String breed) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java index d1e1402789f..b79847a96e4 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class DogAllOf { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public DogAllOf breed(String breed) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java index a3bd1af4725..2db426ab8bf 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -63,7 +63,8 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -101,7 +102,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java index b365a8a56fe..bde85ff2a09 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/EnumTest.java @@ -64,7 +64,8 @@ public class EnumTest { } } - @JsonProperty("enum_string") + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -104,7 +105,8 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -142,7 +144,8 @@ public class EnumTest { } } - @JsonProperty("enum_integer") + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -180,10 +183,12 @@ public class EnumTest { } } - @JsonProperty("enum_number") + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index ad8cf751e11..2c247d819ce 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -28,10 +28,12 @@ import java.util.List; */ public class FileSchemaTestClass { - @JsonProperty("file") + public static final String JSON_PROPERTY_FILE = "file"; + @JsonProperty(JSON_PROPERTY_FILE) private java.io.File file = null; - @JsonProperty("files") + public static final String JSON_PROPERTY_FILES = "files"; + @JsonProperty(JSON_PROPERTY_FILES) private List files = new ArrayList<>(); public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java index 8d075e26bad..1b9426d9ab6 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/FormatTest.java @@ -31,43 +31,56 @@ import java.util.UUID; */ public class FormatTest { - @JsonProperty("integer") + public static final String JSON_PROPERTY_INTEGER = "integer"; + @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; - @JsonProperty("int32") + public static final String JSON_PROPERTY_INT32 = "int32"; + @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; - @JsonProperty("int64") + public static final String JSON_PROPERTY_INT64 = "int64"; + @JsonProperty(JSON_PROPERTY_INT64) private Long int64; - @JsonProperty("number") + public static final String JSON_PROPERTY_NUMBER = "number"; + @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; - @JsonProperty("float") + public static final String JSON_PROPERTY_FLOAT = "float"; + @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; - @JsonProperty("double") + public static final String JSON_PROPERTY_DOUBLE = "double"; + @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; - @JsonProperty("string") + public static final String JSON_PROPERTY_STRING = "string"; + @JsonProperty(JSON_PROPERTY_STRING) private String string; - @JsonProperty("byte") + public static final String JSON_PROPERTY_BYTE = "byte"; + @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; - @JsonProperty("binary") + public static final String JSON_PROPERTY_BINARY = "binary"; + @JsonProperty(JSON_PROPERTY_BINARY) private File binary; - @JsonProperty("date") + public static final String JSON_PROPERTY_DATE = "date"; + @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public FormatTest integer(Integer integer) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index e9453bb6cce..ad6b28d9d1e 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class HasOnlyReadOnly { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("foo") + public static final String JSON_PROPERTY_FOO = "foo"; + @JsonProperty(JSON_PROPERTY_FOO) private String foo; /** diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java index b0d3e04bb63..021d59d2570 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java @@ -29,7 +29,8 @@ import java.util.Map; */ public class MapTest { - @JsonProperty("map_map_of_string") + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) private Map> mapMapOfString = new HashMap<>(); /** @@ -67,13 +68,16 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) private Map mapOfEnumString = new HashMap<>(); - @JsonProperty("direct_map") + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) private Map directMap = new HashMap<>(); - @JsonProperty("indirect_map") + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index fed78a2162f..ad173f004a1 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -32,13 +32,16 @@ import org.openapitools.client.model.Animal; */ public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") + public static final String JSON_PROPERTY_MAP = "map"; + @JsonProperty(JSON_PROPERTY_MAP) private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java index 39fabeeb6da..d86df5d7eab 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java @@ -27,10 +27,12 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model name starting with number") public class Model200Response { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public Model200Response name(Integer name) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java index bb334129511..4c9a7f87b5a 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -26,13 +26,16 @@ import io.swagger.annotations.ApiModelProperty; */ public class ModelApiResponse { - @JsonProperty("code") + public static final String JSON_PROPERTY_CODE = "code"; + @JsonProperty(JSON_PROPERTY_CODE) private Integer code; - @JsonProperty("type") + public static final String JSON_PROPERTY_TYPE = "type"; + @JsonProperty(JSON_PROPERTY_TYPE) private String type; - @JsonProperty("message") + public static final String JSON_PROPERTY_MESSAGE = "message"; + @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; public ModelApiResponse code(Integer code) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java index 9aafb13e04d..9c9ac21a3fb 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -27,7 +27,8 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing reserved words") public class ModelReturn { - @JsonProperty("return") + public static final String JSON_PROPERTY_RETURN = "return"; + @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; public ModelReturn _return(Integer _return) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java index 9518276dd61..47f89c54361 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java @@ -27,16 +27,20 @@ import io.swagger.annotations.ApiModelProperty; @ApiModel(description = "Model for testing model name same as property name") public class Name { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("snake_case") + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; - @JsonProperty("property") + public static final String JSON_PROPERTY_PROPERTY = "property"; + @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; - @JsonProperty("123Number") + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; public Name name(Integer name) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java index 0245e8e2109..f5331da226e 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -27,7 +27,8 @@ import java.math.BigDecimal; */ public class NumberOnly { - @JsonProperty("JustNumber") + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java index 594c76e484d..0730133f9cb 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java @@ -27,16 +27,20 @@ import java.time.OffsetDateTime; */ public class Order { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("petId") + public static final String JSON_PROPERTY_PET_ID = "petId"; + @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; - @JsonProperty("quantity") + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; - @JsonProperty("shipDate") + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -76,10 +80,12 @@ public class Order { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; - @JsonProperty("complete") + public static final String JSON_PROPERTY_COMPLETE = "complete"; + @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; public Order id(Long id) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java index c8bd99011c0..7193ba2a0c9 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -27,13 +27,16 @@ import java.math.BigDecimal; */ public class OuterComposite { - @JsonProperty("my_number") + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; - @JsonProperty("my_string") + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; - @JsonProperty("my_boolean") + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java index 08f37737561..b8e18631bf1 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java @@ -30,19 +30,24 @@ import org.openapitools.client.model.Tag; */ public class Pet { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("category") + public static final String JSON_PROPERTY_CATEGORY = "category"; + @JsonProperty(JSON_PROPERTY_CATEGORY) private Category category = null; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; - @JsonProperty("photoUrls") + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList<>(); - @JsonProperty("tags") + public static final String JSON_PROPERTY_TAGS = "tags"; + @JsonProperty(JSON_PROPERTY_TAGS) private List tags = new ArrayList<>(); /** @@ -82,7 +87,8 @@ public class Pet { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public Pet id(Long id) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 1379ee09ea6..b0949b9e2ea 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class ReadOnlyFirst { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("baz") + public static final String JSON_PROPERTY_BAZ = "baz"; + @JsonProperty(JSON_PROPERTY_BAZ) private String baz; /** diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java index 869771afad8..a9d03234061 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -26,7 +26,8 @@ import io.swagger.annotations.ApiModelProperty; */ public class SpecialModelName { - @JsonProperty("$special[property.name]") + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java index 4bb498aff43..45f17b22cf3 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java @@ -26,10 +26,12 @@ import io.swagger.annotations.ApiModelProperty; */ public class Tag { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public Tag id(Long id) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index 3c6488d270a..3f3030998f1 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -29,19 +29,24 @@ import java.util.List; */ public class TypeHolderDefault { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 812b5839aa5..99ddaa8d2eb 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -29,19 +29,24 @@ import java.util.List; */ public class TypeHolderExample { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java index 73164c3ee28..9ce7869e755 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/User.java @@ -26,28 +26,36 @@ import io.swagger.annotations.ApiModelProperty; */ public class User { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("username") + public static final String JSON_PROPERTY_USERNAME = "username"; + @JsonProperty(JSON_PROPERTY_USERNAME) private String username; - @JsonProperty("firstName") + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; - @JsonProperty("lastName") + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; - @JsonProperty("email") + public static final String JSON_PROPERTY_EMAIL = "email"; + @JsonProperty(JSON_PROPERTY_EMAIL) private String email; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; - @JsonProperty("phone") + public static final String JSON_PROPERTY_PHONE = "phone"; + @JsonProperty(JSON_PROPERTY_PHONE) private String phone; - @JsonProperty("userStatus") + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; public User id(Long id) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/XmlItem.java index aa7ff22ccde..66404193208 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/XmlItem.java @@ -29,91 +29,120 @@ import java.util.List; */ public class XmlItem { - @JsonProperty("attribute_string") + public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; - @JsonProperty("attribute_number") + public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; - @JsonProperty("attribute_integer") + public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; - @JsonProperty("attribute_boolean") + public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; - @JsonProperty("wrapped_array") + public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) private List wrappedArray = new ArrayList<>(); - @JsonProperty("name_string") + public static final String JSON_PROPERTY_NAME_STRING = "name_string"; + @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; - @JsonProperty("name_number") + public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; - @JsonProperty("name_integer") + public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; - @JsonProperty("name_boolean") + public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; - @JsonProperty("name_array") + public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) private List nameArray = new ArrayList<>(); - @JsonProperty("name_wrapped_array") + public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) private List nameWrappedArray = new ArrayList<>(); - @JsonProperty("prefix_string") + public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; - @JsonProperty("prefix_number") + public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; - @JsonProperty("prefix_integer") + public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; - @JsonProperty("prefix_boolean") + public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; - @JsonProperty("prefix_array") + public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) private List prefixArray = new ArrayList<>(); - @JsonProperty("prefix_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) private List prefixWrappedArray = new ArrayList<>(); - @JsonProperty("namespace_string") + public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; - @JsonProperty("namespace_number") + public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; - @JsonProperty("namespace_integer") + public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; - @JsonProperty("namespace_boolean") + public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; - @JsonProperty("namespace_array") + public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) private List namespaceArray = new ArrayList<>(); - @JsonProperty("namespace_wrapped_array") + public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) private List namespaceWrappedArray = new ArrayList<>(); - @JsonProperty("prefix_ns_string") + public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; - @JsonProperty("prefix_ns_number") + public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; - @JsonProperty("prefix_ns_integer") + public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; - @JsonProperty("prefix_ns_boolean") + public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; - @JsonProperty("prefix_ns_array") + public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) private List prefixNsArray = new ArrayList<>(); - @JsonProperty("prefix_ns_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(String attributeString) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java index f1e95b88790..76bd7bda482 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesAnyType extends HashMap implements Serializable { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java index 18bbf10c765..9b192d8bc40 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesArray extends HashMap implements Serializable { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesArray name(String name) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 0e610780a5a..53b59254da2 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesBoolean extends HashMap implements Serializable { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index a0b4399e3e2..f53002ba085 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -31,37 +31,48 @@ import javax.validation.Valid; */ public class AdditionalPropertiesClass implements Serializable { - @JsonProperty("map_string") + public static final String JSON_PROPERTY_MAP_STRING = "map_string"; + @JsonProperty(JSON_PROPERTY_MAP_STRING) private Map mapString = null; - @JsonProperty("map_number") + public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) private Map mapNumber = null; - @JsonProperty("map_integer") + public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) private Map mapInteger = null; - @JsonProperty("map_boolean") + public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) private Map mapBoolean = null; - @JsonProperty("map_array_integer") + public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) private Map> mapArrayInteger = null; - @JsonProperty("map_array_anytype") + public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) private Map> mapArrayAnytype = null; - @JsonProperty("map_map_string") + public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) private Map> mapMapString = null; - @JsonProperty("map_map_anytype") + public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) private Map> mapMapAnytype = null; - @JsonProperty("anytype_1") + public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + @JsonProperty(JSON_PROPERTY_ANYTYPE1) private Object anytype1 = null; - @JsonProperty("anytype_2") + public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; + @JsonProperty(JSON_PROPERTY_ANYTYPE2) private Object anytype2 = null; - @JsonProperty("anytype_3") + public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; + @JsonProperty(JSON_PROPERTY_ANYTYPE3) private Object anytype3 = null; public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java index 9d3066a7881..910a0a14075 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesInteger extends HashMap implements Serializable { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesInteger name(String name) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java index 7cc96c5eddc..0604b2f0973 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesNumber extends HashMap implements Serializable { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesNumber name(String name) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java index 66cfd964775..a5fc827456f 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesObject extends HashMap implements Serializable { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesObject name(String name) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java index 873abf45f3a..91afde4e5da 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesString extends HashMap implements Serializable { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesString name(String name) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Animal.java index 50b9b4a108c..1213a4a57f3 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Animal.java @@ -34,10 +34,12 @@ import javax.validation.Valid; }) public class Animal implements Serializable { - @JsonProperty("className") + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; - @JsonProperty("color") + public static final String JSON_PROPERTY_COLOR = "color"; + @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; public Animal className(String className) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index aaa83ff81ae..c0c05a2cc84 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class ArrayOfArrayOfNumberOnly implements Serializable { - @JsonProperty("ArrayArrayNumber") + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = null; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index e1664f815f0..128a94f550d 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class ArrayOfNumberOnly implements Serializable { - @JsonProperty("ArrayNumber") + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) private List arrayNumber = null; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayTest.java index f20acd08c0c..d69678fed7e 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ArrayTest.java @@ -30,13 +30,16 @@ import javax.validation.Valid; */ public class ArrayTest implements Serializable { - @JsonProperty("array_of_string") + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) private List arrayOfString = null; - @JsonProperty("array_array_of_integer") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) private List> arrayArrayOfInteger = null; - @JsonProperty("array_array_of_model") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = null; public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Capitalization.java index ce838e7b2e0..19cda7e3723 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Capitalization.java @@ -27,22 +27,28 @@ import javax.validation.Valid; */ public class Capitalization implements Serializable { - @JsonProperty("smallCamel") + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; - @JsonProperty("CapitalCamel") + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; - @JsonProperty("small_Snake") + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; - @JsonProperty("Capital_Snake") + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Cat.java index aafc67f1785..3a4f8b5c5fc 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Cat.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class Cat extends Animal implements Serializable { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public Cat declawed(Boolean declawed) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/CatAllOf.java index fba55910c87..3ffd449fbae 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/CatAllOf.java @@ -27,7 +27,8 @@ import javax.validation.Valid; */ public class CatAllOf implements Serializable { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public CatAllOf declawed(Boolean declawed) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Category.java index e43e2c4181a..a5620a90754 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Category.java @@ -27,10 +27,12 @@ import javax.validation.Valid; */ public class Category implements Serializable { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; public Category id(Long id) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ClassModel.java index 77a42849361..2f88bc344f8 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ClassModel.java @@ -28,7 +28,8 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel implements Serializable { - @JsonProperty("_class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public ClassModel propertyClass(String propertyClass) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Client.java index 756161f84c9..9044569e11d 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Client.java @@ -27,7 +27,8 @@ import javax.validation.Valid; */ public class Client implements Serializable { - @JsonProperty("client") + public static final String JSON_PROPERTY_CLIENT = "client"; + @JsonProperty(JSON_PROPERTY_CLIENT) private String client; public Client client(String client) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Dog.java index 842c2e6077a..2d3f0ae54a7 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Dog.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class Dog extends Animal implements Serializable { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public Dog breed(String breed) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/DogAllOf.java index 31b5181c12d..8c0474710c6 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/DogAllOf.java @@ -27,7 +27,8 @@ import javax.validation.Valid; */ public class DogAllOf implements Serializable { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public DogAllOf breed(String breed) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumArrays.java index b3259aa4301..a22a11383e8 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumArrays.java @@ -61,7 +61,8 @@ public class EnumArrays implements Serializable { } } - @JsonProperty("just_symbol") + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -95,7 +96,8 @@ public class EnumArrays implements Serializable { } } - @JsonProperty("array_enum") + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) private List arrayEnum = null; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java index 61917d5f0fa..4cf22d06585 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/EnumTest.java @@ -62,7 +62,8 @@ public class EnumTest implements Serializable { } } - @JsonProperty("enum_string") + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -98,7 +99,8 @@ public class EnumTest implements Serializable { } } - @JsonProperty("enum_string_required") + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -132,7 +134,8 @@ public class EnumTest implements Serializable { } } - @JsonProperty("enum_integer") + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -166,10 +169,12 @@ public class EnumTest implements Serializable { } } - @JsonProperty("enum_number") + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index e561e3992d5..3a085b53df3 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -29,10 +29,12 @@ import javax.validation.Valid; */ public class FileSchemaTestClass implements Serializable { - @JsonProperty("file") + public static final String JSON_PROPERTY_FILE = "file"; + @JsonProperty(JSON_PROPERTY_FILE) private java.io.File file = null; - @JsonProperty("files") + public static final String JSON_PROPERTY_FILES = "files"; + @JsonProperty(JSON_PROPERTY_FILES) private List files = null; public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FormatTest.java index 2a41a4ccd88..b9d19989570 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/FormatTest.java @@ -32,43 +32,56 @@ import javax.validation.Valid; */ public class FormatTest implements Serializable { - @JsonProperty("integer") + public static final String JSON_PROPERTY_INTEGER = "integer"; + @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; - @JsonProperty("int32") + public static final String JSON_PROPERTY_INT32 = "int32"; + @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; - @JsonProperty("int64") + public static final String JSON_PROPERTY_INT64 = "int64"; + @JsonProperty(JSON_PROPERTY_INT64) private Long int64; - @JsonProperty("number") + public static final String JSON_PROPERTY_NUMBER = "number"; + @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; - @JsonProperty("float") + public static final String JSON_PROPERTY_FLOAT = "float"; + @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; - @JsonProperty("double") + public static final String JSON_PROPERTY_DOUBLE = "double"; + @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; - @JsonProperty("string") + public static final String JSON_PROPERTY_STRING = "string"; + @JsonProperty(JSON_PROPERTY_STRING) private String string; - @JsonProperty("byte") + public static final String JSON_PROPERTY_BYTE = "byte"; + @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; - @JsonProperty("binary") + public static final String JSON_PROPERTY_BINARY = "binary"; + @JsonProperty(JSON_PROPERTY_BINARY) private File binary; - @JsonProperty("date") + public static final String JSON_PROPERTY_DATE = "date"; + @JsonProperty(JSON_PROPERTY_DATE) private LocalDate date; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public FormatTest integer(Integer integer) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 64e86fc23ee..c844a811e53 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -27,10 +27,12 @@ import javax.validation.Valid; */ public class HasOnlyReadOnly implements Serializable { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("foo") + public static final String JSON_PROPERTY_FOO = "foo"; + @JsonProperty(JSON_PROPERTY_FOO) private String foo; public HasOnlyReadOnly bar(String bar) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java index 0976ffdbfb8..7ff777de2ba 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MapTest.java @@ -31,7 +31,8 @@ import javax.validation.Valid; */ public class MapTest implements Serializable { - @JsonProperty("map_map_of_string") + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) private Map> mapMapOfString = null; /** @@ -65,13 +66,16 @@ public class MapTest implements Serializable { } } - @JsonProperty("map_of_enum_string") + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) private Map mapOfEnumString = null; - @JsonProperty("direct_map") + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) private Map directMap = null; - @JsonProperty("indirect_map") + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 5897f04868f..dea3ce1e460 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -33,13 +33,16 @@ import javax.validation.Valid; */ public class MixedPropertiesAndAdditionalPropertiesClass implements Serializable { - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private OffsetDateTime dateTime; - @JsonProperty("map") + public static final String JSON_PROPERTY_MAP = "map"; + @JsonProperty(JSON_PROPERTY_MAP) private Map map = null; public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Model200Response.java index 12d174e0543..cf9d920bd67 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Model200Response.java @@ -28,10 +28,12 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing model name starting with number") public class Model200Response implements Serializable { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public Model200Response name(Integer name) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelApiResponse.java index c35c6cfe509..dae73bd1a35 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -27,13 +27,16 @@ import javax.validation.Valid; */ public class ModelApiResponse implements Serializable { - @JsonProperty("code") + public static final String JSON_PROPERTY_CODE = "code"; + @JsonProperty(JSON_PROPERTY_CODE) private Integer code; - @JsonProperty("type") + public static final String JSON_PROPERTY_TYPE = "type"; + @JsonProperty(JSON_PROPERTY_TYPE) private String type; - @JsonProperty("message") + public static final String JSON_PROPERTY_MESSAGE = "message"; + @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; public ModelApiResponse code(Integer code) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelReturn.java index 4d3f313b691..a559626ec06 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ModelReturn.java @@ -28,7 +28,8 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing reserved words") public class ModelReturn implements Serializable { - @JsonProperty("return") + public static final String JSON_PROPERTY_RETURN = "return"; + @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; public ModelReturn _return(Integer _return) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Name.java index 5225528974c..7e8038ea341 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Name.java @@ -28,16 +28,20 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing model name same as property name") public class Name implements Serializable { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("snake_case") + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; - @JsonProperty("property") + public static final String JSON_PROPERTY_PROPERTY = "property"; + @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; - @JsonProperty("123Number") + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; public Name name(Integer name) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/NumberOnly.java index 71d1e967b4c..e5c392741b5 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/NumberOnly.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class NumberOnly implements Serializable { - @JsonProperty("JustNumber") + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Order.java index 3e9b98fe780..ded72798bcd 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Order.java @@ -29,16 +29,20 @@ import javax.validation.Valid; */ public class Order implements Serializable { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("petId") + public static final String JSON_PROPERTY_PET_ID = "petId"; + @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; - @JsonProperty("quantity") + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; - @JsonProperty("shipDate") + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + @JsonProperty(JSON_PROPERTY_SHIP_DATE) private OffsetDateTime shipDate; /** @@ -74,10 +78,12 @@ public class Order implements Serializable { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; - @JsonProperty("complete") + public static final String JSON_PROPERTY_COMPLETE = "complete"; + @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; public Order id(Long id) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/OuterComposite.java index a8c34fdd894..a8955b79e4d 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/OuterComposite.java @@ -28,13 +28,16 @@ import javax.validation.Valid; */ public class OuterComposite implements Serializable { - @JsonProperty("my_number") + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; - @JsonProperty("my_string") + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; - @JsonProperty("my_boolean") + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Pet.java index fac32941b1b..d8bbd3edc3a 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Pet.java @@ -32,19 +32,24 @@ import javax.validation.Valid; */ public class Pet implements Serializable { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("category") + public static final String JSON_PROPERTY_CATEGORY = "category"; + @JsonProperty(JSON_PROPERTY_CATEGORY) private Category category = null; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; - @JsonProperty("photoUrls") + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList<>(); - @JsonProperty("tags") + public static final String JSON_PROPERTY_TAGS = "tags"; + @JsonProperty(JSON_PROPERTY_TAGS) private List tags = null; /** @@ -80,7 +85,8 @@ public class Pet implements Serializable { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public Pet id(Long id) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index 4dc90efe454..d7c81327919 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -27,10 +27,12 @@ import javax.validation.Valid; */ public class ReadOnlyFirst implements Serializable { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("baz") + public static final String JSON_PROPERTY_BAZ = "baz"; + @JsonProperty(JSON_PROPERTY_BAZ) private String baz; public ReadOnlyFirst bar(String bar) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/SpecialModelName.java index f25855c8049..64e5c42dbd1 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -27,7 +27,8 @@ import javax.validation.Valid; */ public class SpecialModelName implements Serializable { - @JsonProperty("$special[property.name]") + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Tag.java index 3d7b87f1786..6800d8660b6 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Tag.java @@ -27,10 +27,12 @@ import javax.validation.Valid; */ public class Tag implements Serializable { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public Tag id(Long id) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/TypeHolderDefault.java index 609e7315c84..e390947e2ff 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -30,19 +30,24 @@ import javax.validation.Valid; */ public class TypeHolderDefault implements Serializable { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/TypeHolderExample.java index 160adee9977..85adfbb4f1c 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -30,19 +30,24 @@ import javax.validation.Valid; */ public class TypeHolderExample implements Serializable { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList<>(); public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/User.java index eb084ef8214..b4df90e9094 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/User.java @@ -27,28 +27,36 @@ import javax.validation.Valid; */ public class User implements Serializable { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("username") + public static final String JSON_PROPERTY_USERNAME = "username"; + @JsonProperty(JSON_PROPERTY_USERNAME) private String username; - @JsonProperty("firstName") + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; - @JsonProperty("lastName") + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; - @JsonProperty("email") + public static final String JSON_PROPERTY_EMAIL = "email"; + @JsonProperty(JSON_PROPERTY_EMAIL) private String email; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; - @JsonProperty("phone") + public static final String JSON_PROPERTY_PHONE = "phone"; + @JsonProperty(JSON_PROPERTY_PHONE) private String phone; - @JsonProperty("userStatus") + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; public User id(Long id) { diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/XmlItem.java index 29a4c963a51..3bc454bcc1c 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/XmlItem.java @@ -30,91 +30,120 @@ import javax.validation.Valid; */ public class XmlItem implements Serializable { - @JsonProperty("attribute_string") + public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; - @JsonProperty("attribute_number") + public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; - @JsonProperty("attribute_integer") + public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; - @JsonProperty("attribute_boolean") + public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; - @JsonProperty("wrapped_array") + public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) private List wrappedArray = null; - @JsonProperty("name_string") + public static final String JSON_PROPERTY_NAME_STRING = "name_string"; + @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; - @JsonProperty("name_number") + public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; - @JsonProperty("name_integer") + public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; - @JsonProperty("name_boolean") + public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; - @JsonProperty("name_array") + public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) private List nameArray = null; - @JsonProperty("name_wrapped_array") + public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) private List nameWrappedArray = null; - @JsonProperty("prefix_string") + public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; - @JsonProperty("prefix_number") + public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; - @JsonProperty("prefix_integer") + public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; - @JsonProperty("prefix_boolean") + public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; - @JsonProperty("prefix_array") + public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) private List prefixArray = null; - @JsonProperty("prefix_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) private List prefixWrappedArray = null; - @JsonProperty("namespace_string") + public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; - @JsonProperty("namespace_number") + public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; - @JsonProperty("namespace_integer") + public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; - @JsonProperty("namespace_boolean") + public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; - @JsonProperty("namespace_array") + public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) private List namespaceArray = null; - @JsonProperty("namespace_wrapped_array") + public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) private List namespaceWrappedArray = null; - @JsonProperty("prefix_ns_string") + public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; - @JsonProperty("prefix_ns_number") + public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; - @JsonProperty("prefix_ns_integer") + public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; - @JsonProperty("prefix_ns_boolean") + public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; - @JsonProperty("prefix_ns_array") + public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) private List prefixNsArray = null; - @JsonProperty("prefix_ns_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) private List prefixNsWrappedArray = null; public XmlItem attributeString(String attributeString) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 4cf2e0f8f25..8b19fc6c1d2 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -29,10 +29,12 @@ import javax.validation.Valid; */ public class AdditionalPropertiesClass { - @JsonProperty("map_property") + public static final String JSON_PROPERTY_MAP_PROPERTY = "map_property"; + @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) private Map mapProperty = null; - @JsonProperty("map_of_map_property") + public static final String JSON_PROPERTY_MAP_OF_MAP_PROPERTY = "map_of_map_property"; + @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) private Map> mapOfMapProperty = null; public AdditionalPropertiesClass mapProperty(Map mapProperty) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Animal.java index 41de9bf738e..196a01e7ec4 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Animal.java @@ -33,10 +33,12 @@ import javax.validation.Valid; }) public class Animal { - @JsonProperty("className") + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; - @JsonProperty("color") + public static final String JSON_PROPERTY_COLOR = "color"; + @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; public Animal className(String className) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 2e8994cb533..dd585cbc5d4 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = null; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index c45285d1c63..e6ce7cdead2 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) private List arrayNumber = null; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayTest.java index b45fb5dd64f..a90ffb02426 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ArrayTest.java @@ -29,13 +29,16 @@ import javax.validation.Valid; */ public class ArrayTest { - @JsonProperty("array_of_string") + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) private List arrayOfString = null; - @JsonProperty("array_array_of_integer") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) private List> arrayArrayOfInteger = null; - @JsonProperty("array_array_of_model") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = null; public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Capitalization.java index 5176fd7516d..61c0f797129 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Capitalization.java @@ -26,22 +26,28 @@ import javax.validation.Valid; */ public class Capitalization { - @JsonProperty("smallCamel") + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; - @JsonProperty("CapitalCamel") + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; - @JsonProperty("small_Snake") + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; - @JsonProperty("Capital_Snake") + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Cat.java index fe2ac658ed7..bf7893083ce 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Cat.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class Cat extends Animal { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public Cat declawed(Boolean declawed) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/CatAllOf.java index 40e3c4b8ef9..af37e289596 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/CatAllOf.java @@ -26,7 +26,8 @@ import javax.validation.Valid; */ public class CatAllOf { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public CatAllOf declawed(Boolean declawed) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Category.java index e31a47278b8..74caab13ae2 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Category.java @@ -26,10 +26,12 @@ import javax.validation.Valid; */ public class Category { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; public Category id(Long id) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ClassModel.java index 7845744e726..18d53d76e4b 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ClassModel.java @@ -27,7 +27,8 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { - @JsonProperty("_class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public ClassModel propertyClass(String propertyClass) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Client.java index 42d3c83dbed..0b9ce9c74e0 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Client.java @@ -26,7 +26,8 @@ import javax.validation.Valid; */ public class Client { - @JsonProperty("client") + public static final String JSON_PROPERTY_CLIENT = "client"; + @JsonProperty(JSON_PROPERTY_CLIENT) private String client; public Client client(String client) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Dog.java index 0df59680968..831f704b6a9 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Dog.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class Dog extends Animal { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public Dog breed(String breed) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/DogAllOf.java index fc9b46e619e..4de5a238f00 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/DogAllOf.java @@ -26,7 +26,8 @@ import javax.validation.Valid; */ public class DogAllOf { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public DogAllOf breed(String breed) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumArrays.java index b2850acc72c..87593bd9fb4 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumArrays.java @@ -60,7 +60,8 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -94,7 +95,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) private List arrayEnum = null; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java index 8abcd5f7785..f33a932689d 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/EnumTest.java @@ -64,7 +64,8 @@ public class EnumTest { } } - @JsonProperty("enum_string") + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -100,7 +101,8 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -134,7 +136,8 @@ public class EnumTest { } } - @JsonProperty("enum_integer") + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -168,19 +171,24 @@ public class EnumTest { } } - @JsonProperty("enum_number") + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; - @JsonProperty("outerEnumInteger") + public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER = "outerEnumInteger"; + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) private OuterEnumInteger outerEnumInteger; - @JsonProperty("outerEnumDefaultValue") + public static final String JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE = "outerEnumDefaultValue"; + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; - @JsonProperty("outerEnumIntegerDefaultValue") + public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE = "outerEnumIntegerDefaultValue"; + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 52e0ef4cde5..2c86b3fda55 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -28,10 +28,12 @@ import javax.validation.Valid; */ public class FileSchemaTestClass { - @JsonProperty("file") + public static final String JSON_PROPERTY_FILE = "file"; + @JsonProperty(JSON_PROPERTY_FILE) private java.io.File file = null; - @JsonProperty("files") + public static final String JSON_PROPERTY_FILES = "files"; + @JsonProperty(JSON_PROPERTY_FILES) private List files = null; public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Foo.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Foo.java index 226bc5c7733..ce5db3d6983 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Foo.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Foo.java @@ -26,7 +26,8 @@ import javax.validation.Valid; */ public class Foo { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar = "bar"; public Foo bar(String bar) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FormatTest.java index 05bddcff523..7b031a6979e 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/FormatTest.java @@ -30,49 +30,64 @@ import javax.validation.Valid; */ public class FormatTest { - @JsonProperty("integer") + public static final String JSON_PROPERTY_INTEGER = "integer"; + @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; - @JsonProperty("int32") + public static final String JSON_PROPERTY_INT32 = "int32"; + @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; - @JsonProperty("int64") + public static final String JSON_PROPERTY_INT64 = "int64"; + @JsonProperty(JSON_PROPERTY_INT64) private Long int64; - @JsonProperty("number") + public static final String JSON_PROPERTY_NUMBER = "number"; + @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; - @JsonProperty("float") + public static final String JSON_PROPERTY_FLOAT = "float"; + @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; - @JsonProperty("double") + public static final String JSON_PROPERTY_DOUBLE = "double"; + @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; - @JsonProperty("string") + public static final String JSON_PROPERTY_STRING = "string"; + @JsonProperty(JSON_PROPERTY_STRING) private String string; - @JsonProperty("byte") + public static final String JSON_PROPERTY_BYTE = "byte"; + @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; - @JsonProperty("binary") + public static final String JSON_PROPERTY_BINARY = "binary"; + @JsonProperty(JSON_PROPERTY_BINARY) private File binary; - @JsonProperty("date") + public static final String JSON_PROPERTY_DATE = "date"; + @JsonProperty(JSON_PROPERTY_DATE) private Date date; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private Date dateTime; - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; - @JsonProperty("pattern_with_digits") + public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS = "pattern_with_digits"; + @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS) private String patternWithDigits; - @JsonProperty("pattern_with_digits_and_delimiter") + public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER = "pattern_with_digits_and_delimiter"; + @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER) private String patternWithDigitsAndDelimiter; public FormatTest integer(Integer integer) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index e46b20cfcdb..1e3b44e6187 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -26,10 +26,12 @@ import javax.validation.Valid; */ public class HasOnlyReadOnly { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("foo") + public static final String JSON_PROPERTY_FOO = "foo"; + @JsonProperty(JSON_PROPERTY_FOO) private String foo; public HasOnlyReadOnly bar(String bar) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HealthCheckResult.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HealthCheckResult.java index aecaf119578..c8f37b3d367 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HealthCheckResult.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/HealthCheckResult.java @@ -27,7 +27,8 @@ import javax.validation.Valid; @ApiModel(description = "Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.") public class HealthCheckResult { - @JsonProperty("NullableMessage") + public static final String JSON_PROPERTY_NULLABLE_MESSAGE = "NullableMessage"; + @JsonProperty(JSON_PROPERTY_NULLABLE_MESSAGE) private String nullableMessage; public HealthCheckResult nullableMessage(String nullableMessage) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject.java index 0fd05a3e52e..3ff2df8be6d 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject.java @@ -26,10 +26,12 @@ import javax.validation.Valid; */ public class InlineObject { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private String status; public InlineObject name(String name) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject1.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject1.java index b496394f3a9..89a32d73a63 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject1.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject1.java @@ -27,10 +27,12 @@ import javax.validation.Valid; */ public class InlineObject1 { - @JsonProperty("additionalMetadata") + public static final String JSON_PROPERTY_ADDITIONAL_METADATA = "additionalMetadata"; + @JsonProperty(JSON_PROPERTY_ADDITIONAL_METADATA) private String additionalMetadata; - @JsonProperty("file") + public static final String JSON_PROPERTY_FILE = "file"; + @JsonProperty(JSON_PROPERTY_FILE) private File file; public InlineObject1 additionalMetadata(String additionalMetadata) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject2.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject2.java index ea81718e3ee..09e12a0f711 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject2.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject2.java @@ -60,7 +60,8 @@ public class InlineObject2 { } } - @JsonProperty("enum_form_string_array") + public static final String JSON_PROPERTY_ENUM_FORM_STRING_ARRAY = "enum_form_string_array"; + @JsonProperty(JSON_PROPERTY_ENUM_FORM_STRING_ARRAY) private List enumFormStringArray = null; /** @@ -96,7 +97,8 @@ public class InlineObject2 { } } - @JsonProperty("enum_form_string") + public static final String JSON_PROPERTY_ENUM_FORM_STRING = "enum_form_string"; + @JsonProperty(JSON_PROPERTY_ENUM_FORM_STRING) private EnumFormStringEnum enumFormString = EnumFormStringEnum._EFG; public InlineObject2 enumFormStringArray(List enumFormStringArray) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject3.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject3.java index c0feacd91db..1d390c65683 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject3.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject3.java @@ -29,46 +29,60 @@ import javax.validation.Valid; */ public class InlineObject3 { - @JsonProperty("integer") + public static final String JSON_PROPERTY_INTEGER = "integer"; + @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; - @JsonProperty("int32") + public static final String JSON_PROPERTY_INT32 = "int32"; + @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; - @JsonProperty("int64") + public static final String JSON_PROPERTY_INT64 = "int64"; + @JsonProperty(JSON_PROPERTY_INT64) private Long int64; - @JsonProperty("number") + public static final String JSON_PROPERTY_NUMBER = "number"; + @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; - @JsonProperty("float") + public static final String JSON_PROPERTY_FLOAT = "float"; + @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; - @JsonProperty("double") + public static final String JSON_PROPERTY_DOUBLE = "double"; + @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; - @JsonProperty("string") + public static final String JSON_PROPERTY_STRING = "string"; + @JsonProperty(JSON_PROPERTY_STRING) private String string; - @JsonProperty("pattern_without_delimiter") + public static final String JSON_PROPERTY_PATTERN_WITHOUT_DELIMITER = "pattern_without_delimiter"; + @JsonProperty(JSON_PROPERTY_PATTERN_WITHOUT_DELIMITER) private String patternWithoutDelimiter; - @JsonProperty("byte") + public static final String JSON_PROPERTY_BYTE = "byte"; + @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; - @JsonProperty("binary") + public static final String JSON_PROPERTY_BINARY = "binary"; + @JsonProperty(JSON_PROPERTY_BINARY) private File binary; - @JsonProperty("date") + public static final String JSON_PROPERTY_DATE = "date"; + @JsonProperty(JSON_PROPERTY_DATE) private Date date; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private Date dateTime; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; - @JsonProperty("callback") + public static final String JSON_PROPERTY_CALLBACK = "callback"; + @JsonProperty(JSON_PROPERTY_CALLBACK) private String callback; public InlineObject3 integer(Integer integer) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject4.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject4.java index 11ed4d4285c..da323853d86 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject4.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject4.java @@ -26,10 +26,12 @@ import javax.validation.Valid; */ public class InlineObject4 { - @JsonProperty("param") + public static final String JSON_PROPERTY_PARAM = "param"; + @JsonProperty(JSON_PROPERTY_PARAM) private String param; - @JsonProperty("param2") + public static final String JSON_PROPERTY_PARAM2 = "param2"; + @JsonProperty(JSON_PROPERTY_PARAM2) private String param2; public InlineObject4 param(String param) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject5.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject5.java index 8950ea27d6e..6b822c410df 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject5.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineObject5.java @@ -27,10 +27,12 @@ import javax.validation.Valid; */ public class InlineObject5 { - @JsonProperty("additionalMetadata") + public static final String JSON_PROPERTY_ADDITIONAL_METADATA = "additionalMetadata"; + @JsonProperty(JSON_PROPERTY_ADDITIONAL_METADATA) private String additionalMetadata; - @JsonProperty("requiredFile") + public static final String JSON_PROPERTY_REQUIRED_FILE = "requiredFile"; + @JsonProperty(JSON_PROPERTY_REQUIRED_FILE) private File requiredFile; public InlineObject5 additionalMetadata(String additionalMetadata) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineResponseDefault.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineResponseDefault.java index f9ae6167bcc..d1a5d14dace 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineResponseDefault.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/InlineResponseDefault.java @@ -27,7 +27,8 @@ import javax.validation.Valid; */ public class InlineResponseDefault { - @JsonProperty("string") + public static final String JSON_PROPERTY_STRING = "string"; + @JsonProperty(JSON_PROPERTY_STRING) private Foo string = null; public InlineResponseDefault string(Foo string) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MapTest.java index f3d22350d6e..df661e027e9 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MapTest.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class MapTest { - @JsonProperty("map_map_of_string") + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) private Map> mapMapOfString = null; /** @@ -64,13 +65,16 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) private Map mapOfEnumString = null; - @JsonProperty("direct_map") + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) private Map directMap = null; - @JsonProperty("indirect_map") + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index d1d502a89de..e6c0672c5ca 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -32,13 +32,16 @@ import javax.validation.Valid; */ public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private Date dateTime; - @JsonProperty("map") + public static final String JSON_PROPERTY_MAP = "map"; + @JsonProperty(JSON_PROPERTY_MAP) private Map map = null; public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Model200Response.java index 8c27eb78743..0780d432241 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Model200Response.java @@ -27,10 +27,12 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing model name starting with number") public class Model200Response { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public Model200Response name(Integer name) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelApiResponse.java index b57511abaa7..1b5c00664ca 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -26,13 +26,16 @@ import javax.validation.Valid; */ public class ModelApiResponse { - @JsonProperty("code") + public static final String JSON_PROPERTY_CODE = "code"; + @JsonProperty(JSON_PROPERTY_CODE) private Integer code; - @JsonProperty("type") + public static final String JSON_PROPERTY_TYPE = "type"; + @JsonProperty(JSON_PROPERTY_TYPE) private String type; - @JsonProperty("message") + public static final String JSON_PROPERTY_MESSAGE = "message"; + @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; public ModelApiResponse code(Integer code) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelReturn.java index fdde8af707e..98e64dd70f3 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ModelReturn.java @@ -27,7 +27,8 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing reserved words") public class ModelReturn { - @JsonProperty("return") + public static final String JSON_PROPERTY_RETURN = "return"; + @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; public ModelReturn _return(Integer _return) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Name.java index ef0755902bc..edf4368c9a1 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Name.java @@ -27,16 +27,20 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing model name same as property name") public class Name { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("snake_case") + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; - @JsonProperty("property") + public static final String JSON_PROPERTY_PROPERTY = "property"; + @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; - @JsonProperty("123Number") + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; public Name name(Integer name) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NullableClass.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NullableClass.java index 5500f91def1..37b9e807a59 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NullableClass.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NullableClass.java @@ -32,40 +32,52 @@ import javax.validation.Valid; */ public class NullableClass extends HashMap { - @JsonProperty("integer_prop") + public static final String JSON_PROPERTY_INTEGER_PROP = "integer_prop"; + @JsonProperty(JSON_PROPERTY_INTEGER_PROP) private Integer integerProp; - @JsonProperty("number_prop") + public static final String JSON_PROPERTY_NUMBER_PROP = "number_prop"; + @JsonProperty(JSON_PROPERTY_NUMBER_PROP) private BigDecimal numberProp; - @JsonProperty("boolean_prop") + public static final String JSON_PROPERTY_BOOLEAN_PROP = "boolean_prop"; + @JsonProperty(JSON_PROPERTY_BOOLEAN_PROP) private Boolean booleanProp; - @JsonProperty("string_prop") + public static final String JSON_PROPERTY_STRING_PROP = "string_prop"; + @JsonProperty(JSON_PROPERTY_STRING_PROP) private String stringProp; - @JsonProperty("date_prop") + public static final String JSON_PROPERTY_DATE_PROP = "date_prop"; + @JsonProperty(JSON_PROPERTY_DATE_PROP) private Date dateProp; - @JsonProperty("datetime_prop") + public static final String JSON_PROPERTY_DATETIME_PROP = "datetime_prop"; + @JsonProperty(JSON_PROPERTY_DATETIME_PROP) private Date datetimeProp; - @JsonProperty("array_nullable_prop") + public static final String JSON_PROPERTY_ARRAY_NULLABLE_PROP = "array_nullable_prop"; + @JsonProperty(JSON_PROPERTY_ARRAY_NULLABLE_PROP) private List arrayNullableProp = null; - @JsonProperty("array_and_items_nullable_prop") + public static final String JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP = "array_and_items_nullable_prop"; + @JsonProperty(JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP) private List arrayAndItemsNullableProp = null; - @JsonProperty("array_items_nullable") + public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) private List arrayItemsNullable = null; - @JsonProperty("object_nullable_prop") + public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop"; + @JsonProperty(JSON_PROPERTY_OBJECT_NULLABLE_PROP) private Map objectNullableProp = null; - @JsonProperty("object_and_items_nullable_prop") + public static final String JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP = "object_and_items_nullable_prop"; + @JsonProperty(JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP) private Map objectAndItemsNullableProp = null; - @JsonProperty("object_items_nullable") + public static final String JSON_PROPERTY_OBJECT_ITEMS_NULLABLE = "object_items_nullable"; + @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) private Map objectItemsNullable = null; public NullableClass integerProp(Integer integerProp) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NumberOnly.java index 704db3569d6..15da555feb4 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/NumberOnly.java @@ -27,7 +27,8 @@ import javax.validation.Valid; */ public class NumberOnly { - @JsonProperty("JustNumber") + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Order.java index bd22729501d..4000d7fca78 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Order.java @@ -28,16 +28,20 @@ import javax.validation.Valid; */ public class Order { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("petId") + public static final String JSON_PROPERTY_PET_ID = "petId"; + @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; - @JsonProperty("quantity") + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; - @JsonProperty("shipDate") + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + @JsonProperty(JSON_PROPERTY_SHIP_DATE) private Date shipDate; /** @@ -73,10 +77,12 @@ public class Order { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; - @JsonProperty("complete") + public static final String JSON_PROPERTY_COMPLETE = "complete"; + @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; public Order id(Long id) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterComposite.java index afbbd6609be..ee344471fc0 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/OuterComposite.java @@ -27,13 +27,16 @@ import javax.validation.Valid; */ public class OuterComposite { - @JsonProperty("my_number") + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; - @JsonProperty("my_string") + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; - @JsonProperty("my_boolean") + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Pet.java index ed95d7827f7..086c625aa3b 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Pet.java @@ -31,19 +31,24 @@ import javax.validation.Valid; */ public class Pet { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("category") + public static final String JSON_PROPERTY_CATEGORY = "category"; + @JsonProperty(JSON_PROPERTY_CATEGORY) private Category category = null; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; - @JsonProperty("photoUrls") + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList(); - @JsonProperty("tags") + public static final String JSON_PROPERTY_TAGS = "tags"; + @JsonProperty(JSON_PROPERTY_TAGS) private List tags = null; /** @@ -79,7 +84,8 @@ public class Pet { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public Pet id(Long id) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index bcce02a9c03..1e59f1624a1 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -26,10 +26,12 @@ import javax.validation.Valid; */ public class ReadOnlyFirst { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("baz") + public static final String JSON_PROPERTY_BAZ = "baz"; + @JsonProperty(JSON_PROPERTY_BAZ) private String baz; public ReadOnlyFirst bar(String bar) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialModelName.java index 914d3890980..f7e88175fe9 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -26,7 +26,8 @@ import javax.validation.Valid; */ public class SpecialModelName { - @JsonProperty("$special[property.name]") + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Tag.java index dd36c464221..d610b60e8ca 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/Tag.java @@ -26,10 +26,12 @@ import javax.validation.Valid; */ public class Tag { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public Tag id(Long id) { diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/User.java index 27eb564befb..5df67fece76 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/model/User.java @@ -26,28 +26,36 @@ import javax.validation.Valid; */ public class User { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("username") + public static final String JSON_PROPERTY_USERNAME = "username"; + @JsonProperty(JSON_PROPERTY_USERNAME) private String username; - @JsonProperty("firstName") + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; - @JsonProperty("lastName") + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; - @JsonProperty("email") + public static final String JSON_PROPERTY_EMAIL = "email"; + @JsonProperty(JSON_PROPERTY_EMAIL) private String email; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; - @JsonProperty("phone") + public static final String JSON_PROPERTY_PHONE = "phone"; + @JsonProperty(JSON_PROPERTY_PHONE) private String phone; - @JsonProperty("userStatus") + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; public User id(Long id) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 206581677dc..47156768c39 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java index c26323e1248..201ecdca22a 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesArray name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5e7e6a17f23..93c6b3d0623 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index ea08abdb78b..76cb99844c9 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -30,37 +30,48 @@ import javax.validation.Valid; */ public class AdditionalPropertiesClass { - @JsonProperty("map_string") + public static final String JSON_PROPERTY_MAP_STRING = "map_string"; + @JsonProperty(JSON_PROPERTY_MAP_STRING) private Map mapString = null; - @JsonProperty("map_number") + public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) private Map mapNumber = null; - @JsonProperty("map_integer") + public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) private Map mapInteger = null; - @JsonProperty("map_boolean") + public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) private Map mapBoolean = null; - @JsonProperty("map_array_integer") + public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) private Map> mapArrayInteger = null; - @JsonProperty("map_array_anytype") + public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) private Map> mapArrayAnytype = null; - @JsonProperty("map_map_string") + public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) private Map> mapMapString = null; - @JsonProperty("map_map_anytype") + public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) private Map> mapMapAnytype = null; - @JsonProperty("anytype_1") + public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + @JsonProperty(JSON_PROPERTY_ANYTYPE1) private Object anytype1 = null; - @JsonProperty("anytype_2") + public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; + @JsonProperty(JSON_PROPERTY_ANYTYPE2) private Object anytype2 = null; - @JsonProperty("anytype_3") + public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; + @JsonProperty(JSON_PROPERTY_ANYTYPE3) private Object anytype3 = null; public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java index 4b87b18400a..cbe2aeb620d 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesInteger name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java index 832c7288ce8..4d865d10914 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesNumber name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java index fe8f7545675..a810b4e281c 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesObject name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java index 3ac82c485f7..338cd8fd95d 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesString name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Animal.java index 41de9bf738e..196a01e7ec4 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Animal.java @@ -33,10 +33,12 @@ import javax.validation.Valid; }) public class Animal { - @JsonProperty("className") + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; - @JsonProperty("color") + public static final String JSON_PROPERTY_COLOR = "color"; + @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; public Animal className(String className) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 2e8994cb533..dd585cbc5d4 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = null; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index c45285d1c63..e6ce7cdead2 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) private List arrayNumber = null; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayTest.java index b45fb5dd64f..a90ffb02426 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ArrayTest.java @@ -29,13 +29,16 @@ import javax.validation.Valid; */ public class ArrayTest { - @JsonProperty("array_of_string") + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) private List arrayOfString = null; - @JsonProperty("array_array_of_integer") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) private List> arrayArrayOfInteger = null; - @JsonProperty("array_array_of_model") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = null; public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Capitalization.java index 5176fd7516d..61c0f797129 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Capitalization.java @@ -26,22 +26,28 @@ import javax.validation.Valid; */ public class Capitalization { - @JsonProperty("smallCamel") + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; - @JsonProperty("CapitalCamel") + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; - @JsonProperty("small_Snake") + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; - @JsonProperty("Capital_Snake") + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Cat.java index fe2ac658ed7..bf7893083ce 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Cat.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class Cat extends Animal { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public Cat declawed(Boolean declawed) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/CatAllOf.java index 40e3c4b8ef9..af37e289596 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/CatAllOf.java @@ -26,7 +26,8 @@ import javax.validation.Valid; */ public class CatAllOf { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public CatAllOf declawed(Boolean declawed) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Category.java index e31a47278b8..74caab13ae2 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Category.java @@ -26,10 +26,12 @@ import javax.validation.Valid; */ public class Category { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; public Category id(Long id) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ClassModel.java index 7845744e726..18d53d76e4b 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ClassModel.java @@ -27,7 +27,8 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { - @JsonProperty("_class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public ClassModel propertyClass(String propertyClass) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Client.java index 42d3c83dbed..0b9ce9c74e0 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Client.java @@ -26,7 +26,8 @@ import javax.validation.Valid; */ public class Client { - @JsonProperty("client") + public static final String JSON_PROPERTY_CLIENT = "client"; + @JsonProperty(JSON_PROPERTY_CLIENT) private String client; public Client client(String client) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Dog.java index 0df59680968..831f704b6a9 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Dog.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class Dog extends Animal { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public Dog breed(String breed) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/DogAllOf.java index fc9b46e619e..4de5a238f00 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/DogAllOf.java @@ -26,7 +26,8 @@ import javax.validation.Valid; */ public class DogAllOf { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public DogAllOf breed(String breed) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumArrays.java index b2850acc72c..87593bd9fb4 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumArrays.java @@ -60,7 +60,8 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -94,7 +95,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) private List arrayEnum = null; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java index 03b3369d592..35f24f090f1 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/EnumTest.java @@ -61,7 +61,8 @@ public class EnumTest { } } - @JsonProperty("enum_string") + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -97,7 +98,8 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -131,7 +133,8 @@ public class EnumTest { } } - @JsonProperty("enum_integer") + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -165,10 +168,12 @@ public class EnumTest { } } - @JsonProperty("enum_number") + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 52e0ef4cde5..2c86b3fda55 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -28,10 +28,12 @@ import javax.validation.Valid; */ public class FileSchemaTestClass { - @JsonProperty("file") + public static final String JSON_PROPERTY_FILE = "file"; + @JsonProperty(JSON_PROPERTY_FILE) private java.io.File file = null; - @JsonProperty("files") + public static final String JSON_PROPERTY_FILES = "files"; + @JsonProperty(JSON_PROPERTY_FILES) private List files = null; public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FormatTest.java index 03b0e3f57ff..34ad45203ba 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/FormatTest.java @@ -30,43 +30,56 @@ import javax.validation.Valid; */ public class FormatTest { - @JsonProperty("integer") + public static final String JSON_PROPERTY_INTEGER = "integer"; + @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; - @JsonProperty("int32") + public static final String JSON_PROPERTY_INT32 = "int32"; + @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; - @JsonProperty("int64") + public static final String JSON_PROPERTY_INT64 = "int64"; + @JsonProperty(JSON_PROPERTY_INT64) private Long int64; - @JsonProperty("number") + public static final String JSON_PROPERTY_NUMBER = "number"; + @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; - @JsonProperty("float") + public static final String JSON_PROPERTY_FLOAT = "float"; + @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; - @JsonProperty("double") + public static final String JSON_PROPERTY_DOUBLE = "double"; + @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; - @JsonProperty("string") + public static final String JSON_PROPERTY_STRING = "string"; + @JsonProperty(JSON_PROPERTY_STRING) private String string; - @JsonProperty("byte") + public static final String JSON_PROPERTY_BYTE = "byte"; + @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; - @JsonProperty("binary") + public static final String JSON_PROPERTY_BINARY = "binary"; + @JsonProperty(JSON_PROPERTY_BINARY) private File binary; - @JsonProperty("date") + public static final String JSON_PROPERTY_DATE = "date"; + @JsonProperty(JSON_PROPERTY_DATE) private Date date; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private Date dateTime; - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public FormatTest integer(Integer integer) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index e46b20cfcdb..1e3b44e6187 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -26,10 +26,12 @@ import javax.validation.Valid; */ public class HasOnlyReadOnly { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("foo") + public static final String JSON_PROPERTY_FOO = "foo"; + @JsonProperty(JSON_PROPERTY_FOO) private String foo; public HasOnlyReadOnly bar(String bar) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java index f3d22350d6e..df661e027e9 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MapTest.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class MapTest { - @JsonProperty("map_map_of_string") + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) private Map> mapMapOfString = null; /** @@ -64,13 +65,16 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) private Map mapOfEnumString = null; - @JsonProperty("direct_map") + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) private Map directMap = null; - @JsonProperty("indirect_map") + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index d1d502a89de..e6c0672c5ca 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -32,13 +32,16 @@ import javax.validation.Valid; */ public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private Date dateTime; - @JsonProperty("map") + public static final String JSON_PROPERTY_MAP = "map"; + @JsonProperty(JSON_PROPERTY_MAP) private Map map = null; public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Model200Response.java index 8c27eb78743..0780d432241 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Model200Response.java @@ -27,10 +27,12 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing model name starting with number") public class Model200Response { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public Model200Response name(Integer name) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java index b57511abaa7..1b5c00664ca 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -26,13 +26,16 @@ import javax.validation.Valid; */ public class ModelApiResponse { - @JsonProperty("code") + public static final String JSON_PROPERTY_CODE = "code"; + @JsonProperty(JSON_PROPERTY_CODE) private Integer code; - @JsonProperty("type") + public static final String JSON_PROPERTY_TYPE = "type"; + @JsonProperty(JSON_PROPERTY_TYPE) private String type; - @JsonProperty("message") + public static final String JSON_PROPERTY_MESSAGE = "message"; + @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; public ModelApiResponse code(Integer code) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelReturn.java index fdde8af707e..98e64dd70f3 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ModelReturn.java @@ -27,7 +27,8 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing reserved words") public class ModelReturn { - @JsonProperty("return") + public static final String JSON_PROPERTY_RETURN = "return"; + @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; public ModelReturn _return(Integer _return) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Name.java index ef0755902bc..edf4368c9a1 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Name.java @@ -27,16 +27,20 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing model name same as property name") public class Name { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("snake_case") + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; - @JsonProperty("property") + public static final String JSON_PROPERTY_PROPERTY = "property"; + @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; - @JsonProperty("123Number") + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; public Name name(Integer name) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/NumberOnly.java index 704db3569d6..15da555feb4 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/NumberOnly.java @@ -27,7 +27,8 @@ import javax.validation.Valid; */ public class NumberOnly { - @JsonProperty("JustNumber") + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Order.java index bd22729501d..4000d7fca78 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Order.java @@ -28,16 +28,20 @@ import javax.validation.Valid; */ public class Order { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("petId") + public static final String JSON_PROPERTY_PET_ID = "petId"; + @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; - @JsonProperty("quantity") + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; - @JsonProperty("shipDate") + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + @JsonProperty(JSON_PROPERTY_SHIP_DATE) private Date shipDate; /** @@ -73,10 +77,12 @@ public class Order { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; - @JsonProperty("complete") + public static final String JSON_PROPERTY_COMPLETE = "complete"; + @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; public Order id(Long id) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/OuterComposite.java index afbbd6609be..ee344471fc0 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/OuterComposite.java @@ -27,13 +27,16 @@ import javax.validation.Valid; */ public class OuterComposite { - @JsonProperty("my_number") + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; - @JsonProperty("my_string") + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; - @JsonProperty("my_boolean") + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Pet.java index ed95d7827f7..086c625aa3b 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Pet.java @@ -31,19 +31,24 @@ import javax.validation.Valid; */ public class Pet { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("category") + public static final String JSON_PROPERTY_CATEGORY = "category"; + @JsonProperty(JSON_PROPERTY_CATEGORY) private Category category = null; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; - @JsonProperty("photoUrls") + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList(); - @JsonProperty("tags") + public static final String JSON_PROPERTY_TAGS = "tags"; + @JsonProperty(JSON_PROPERTY_TAGS) private List tags = null; /** @@ -79,7 +84,8 @@ public class Pet { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public Pet id(Long id) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index bcce02a9c03..1e59f1624a1 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -26,10 +26,12 @@ import javax.validation.Valid; */ public class ReadOnlyFirst { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("baz") + public static final String JSON_PROPERTY_BAZ = "baz"; + @JsonProperty(JSON_PROPERTY_BAZ) private String baz; public ReadOnlyFirst bar(String bar) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java index 16c037b9e68..19b09742162 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -26,7 +26,8 @@ import javax.validation.Valid; */ public class SpecialModelName { - @JsonProperty("$special[property.name]") + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Tag.java index dd36c464221..d610b60e8ca 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Tag.java @@ -26,10 +26,12 @@ import javax.validation.Valid; */ public class Tag { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public Tag id(Long id) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java index 88fa741adf3..18a173dd67e 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -29,19 +29,24 @@ import javax.validation.Valid; */ public class TypeHolderDefault { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java index 364e5452a5b..0ff32afc693 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -29,19 +29,24 @@ import javax.validation.Valid; */ public class TypeHolderExample { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/User.java index 27eb564befb..5df67fece76 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/User.java @@ -26,28 +26,36 @@ import javax.validation.Valid; */ public class User { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("username") + public static final String JSON_PROPERTY_USERNAME = "username"; + @JsonProperty(JSON_PROPERTY_USERNAME) private String username; - @JsonProperty("firstName") + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; - @JsonProperty("lastName") + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; - @JsonProperty("email") + public static final String JSON_PROPERTY_EMAIL = "email"; + @JsonProperty(JSON_PROPERTY_EMAIL) private String email; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; - @JsonProperty("phone") + public static final String JSON_PROPERTY_PHONE = "phone"; + @JsonProperty(JSON_PROPERTY_PHONE) private String phone; - @JsonProperty("userStatus") + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; public User id(Long id) { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/XmlItem.java index e03c35a009b..b0098143188 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/XmlItem.java @@ -29,91 +29,120 @@ import javax.validation.Valid; */ public class XmlItem { - @JsonProperty("attribute_string") + public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; - @JsonProperty("attribute_number") + public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; - @JsonProperty("attribute_integer") + public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; - @JsonProperty("attribute_boolean") + public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; - @JsonProperty("wrapped_array") + public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) private List wrappedArray = null; - @JsonProperty("name_string") + public static final String JSON_PROPERTY_NAME_STRING = "name_string"; + @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; - @JsonProperty("name_number") + public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; - @JsonProperty("name_integer") + public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; - @JsonProperty("name_boolean") + public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; - @JsonProperty("name_array") + public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) private List nameArray = null; - @JsonProperty("name_wrapped_array") + public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) private List nameWrappedArray = null; - @JsonProperty("prefix_string") + public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; - @JsonProperty("prefix_number") + public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; - @JsonProperty("prefix_integer") + public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; - @JsonProperty("prefix_boolean") + public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; - @JsonProperty("prefix_array") + public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) private List prefixArray = null; - @JsonProperty("prefix_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) private List prefixWrappedArray = null; - @JsonProperty("namespace_string") + public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; - @JsonProperty("namespace_number") + public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; - @JsonProperty("namespace_integer") + public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; - @JsonProperty("namespace_boolean") + public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; - @JsonProperty("namespace_array") + public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) private List namespaceArray = null; - @JsonProperty("namespace_wrapped_array") + public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) private List namespaceWrappedArray = null; - @JsonProperty("prefix_ns_string") + public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; - @JsonProperty("prefix_ns_number") + public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; - @JsonProperty("prefix_ns_integer") + public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; - @JsonProperty("prefix_ns_boolean") + public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; - @JsonProperty("prefix_ns_array") + public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) private List prefixNsArray = null; - @JsonProperty("prefix_ns_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) private List prefixNsWrappedArray = null; public XmlItem attributeString(String attributeString) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 206581677dc..47156768c39 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java index c26323e1248..201ecdca22a 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesArray name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5e7e6a17f23..93c6b3d0623 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index ea08abdb78b..76cb99844c9 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -30,37 +30,48 @@ import javax.validation.Valid; */ public class AdditionalPropertiesClass { - @JsonProperty("map_string") + public static final String JSON_PROPERTY_MAP_STRING = "map_string"; + @JsonProperty(JSON_PROPERTY_MAP_STRING) private Map mapString = null; - @JsonProperty("map_number") + public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) private Map mapNumber = null; - @JsonProperty("map_integer") + public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) private Map mapInteger = null; - @JsonProperty("map_boolean") + public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) private Map mapBoolean = null; - @JsonProperty("map_array_integer") + public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) private Map> mapArrayInteger = null; - @JsonProperty("map_array_anytype") + public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) private Map> mapArrayAnytype = null; - @JsonProperty("map_map_string") + public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) private Map> mapMapString = null; - @JsonProperty("map_map_anytype") + public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) private Map> mapMapAnytype = null; - @JsonProperty("anytype_1") + public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + @JsonProperty(JSON_PROPERTY_ANYTYPE1) private Object anytype1 = null; - @JsonProperty("anytype_2") + public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; + @JsonProperty(JSON_PROPERTY_ANYTYPE2) private Object anytype2 = null; - @JsonProperty("anytype_3") + public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; + @JsonProperty(JSON_PROPERTY_ANYTYPE3) private Object anytype3 = null; public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java index 4b87b18400a..cbe2aeb620d 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesInteger name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java index 832c7288ce8..4d865d10914 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesNumber name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java index fe8f7545675..a810b4e281c 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesObject name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java index 3ac82c485f7..338cd8fd95d 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesString name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Animal.java index 41de9bf738e..196a01e7ec4 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Animal.java @@ -33,10 +33,12 @@ import javax.validation.Valid; }) public class Animal { - @JsonProperty("className") + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; - @JsonProperty("color") + public static final String JSON_PROPERTY_COLOR = "color"; + @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; public Animal className(String className) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 2e8994cb533..dd585cbc5d4 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = null; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index c45285d1c63..e6ce7cdead2 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) private List arrayNumber = null; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayTest.java index b45fb5dd64f..a90ffb02426 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ArrayTest.java @@ -29,13 +29,16 @@ import javax.validation.Valid; */ public class ArrayTest { - @JsonProperty("array_of_string") + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) private List arrayOfString = null; - @JsonProperty("array_array_of_integer") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) private List> arrayArrayOfInteger = null; - @JsonProperty("array_array_of_model") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = null; public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Capitalization.java index 5176fd7516d..61c0f797129 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Capitalization.java @@ -26,22 +26,28 @@ import javax.validation.Valid; */ public class Capitalization { - @JsonProperty("smallCamel") + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; - @JsonProperty("CapitalCamel") + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; - @JsonProperty("small_Snake") + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; - @JsonProperty("Capital_Snake") + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Cat.java index fe2ac658ed7..bf7893083ce 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Cat.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class Cat extends Animal { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public Cat declawed(Boolean declawed) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/CatAllOf.java index 40e3c4b8ef9..af37e289596 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/CatAllOf.java @@ -26,7 +26,8 @@ import javax.validation.Valid; */ public class CatAllOf { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public CatAllOf declawed(Boolean declawed) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Category.java index e31a47278b8..74caab13ae2 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Category.java @@ -26,10 +26,12 @@ import javax.validation.Valid; */ public class Category { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; public Category id(Long id) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ClassModel.java index 7845744e726..18d53d76e4b 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ClassModel.java @@ -27,7 +27,8 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { - @JsonProperty("_class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public ClassModel propertyClass(String propertyClass) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Client.java index 42d3c83dbed..0b9ce9c74e0 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Client.java @@ -26,7 +26,8 @@ import javax.validation.Valid; */ public class Client { - @JsonProperty("client") + public static final String JSON_PROPERTY_CLIENT = "client"; + @JsonProperty(JSON_PROPERTY_CLIENT) private String client; public Client client(String client) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Dog.java index 0df59680968..831f704b6a9 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Dog.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class Dog extends Animal { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public Dog breed(String breed) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/DogAllOf.java index fc9b46e619e..4de5a238f00 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/DogAllOf.java @@ -26,7 +26,8 @@ import javax.validation.Valid; */ public class DogAllOf { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public DogAllOf breed(String breed) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumArrays.java index b2850acc72c..87593bd9fb4 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumArrays.java @@ -60,7 +60,8 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -94,7 +95,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) private List arrayEnum = null; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java index 03b3369d592..35f24f090f1 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/EnumTest.java @@ -61,7 +61,8 @@ public class EnumTest { } } - @JsonProperty("enum_string") + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -97,7 +98,8 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -131,7 +133,8 @@ public class EnumTest { } } - @JsonProperty("enum_integer") + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -165,10 +168,12 @@ public class EnumTest { } } - @JsonProperty("enum_number") + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 52e0ef4cde5..2c86b3fda55 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -28,10 +28,12 @@ import javax.validation.Valid; */ public class FileSchemaTestClass { - @JsonProperty("file") + public static final String JSON_PROPERTY_FILE = "file"; + @JsonProperty(JSON_PROPERTY_FILE) private java.io.File file = null; - @JsonProperty("files") + public static final String JSON_PROPERTY_FILES = "files"; + @JsonProperty(JSON_PROPERTY_FILES) private List files = null; public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FormatTest.java index 03b0e3f57ff..34ad45203ba 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/FormatTest.java @@ -30,43 +30,56 @@ import javax.validation.Valid; */ public class FormatTest { - @JsonProperty("integer") + public static final String JSON_PROPERTY_INTEGER = "integer"; + @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; - @JsonProperty("int32") + public static final String JSON_PROPERTY_INT32 = "int32"; + @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; - @JsonProperty("int64") + public static final String JSON_PROPERTY_INT64 = "int64"; + @JsonProperty(JSON_PROPERTY_INT64) private Long int64; - @JsonProperty("number") + public static final String JSON_PROPERTY_NUMBER = "number"; + @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; - @JsonProperty("float") + public static final String JSON_PROPERTY_FLOAT = "float"; + @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; - @JsonProperty("double") + public static final String JSON_PROPERTY_DOUBLE = "double"; + @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; - @JsonProperty("string") + public static final String JSON_PROPERTY_STRING = "string"; + @JsonProperty(JSON_PROPERTY_STRING) private String string; - @JsonProperty("byte") + public static final String JSON_PROPERTY_BYTE = "byte"; + @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; - @JsonProperty("binary") + public static final String JSON_PROPERTY_BINARY = "binary"; + @JsonProperty(JSON_PROPERTY_BINARY) private File binary; - @JsonProperty("date") + public static final String JSON_PROPERTY_DATE = "date"; + @JsonProperty(JSON_PROPERTY_DATE) private Date date; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private Date dateTime; - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public FormatTest integer(Integer integer) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index e46b20cfcdb..1e3b44e6187 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -26,10 +26,12 @@ import javax.validation.Valid; */ public class HasOnlyReadOnly { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("foo") + public static final String JSON_PROPERTY_FOO = "foo"; + @JsonProperty(JSON_PROPERTY_FOO) private String foo; public HasOnlyReadOnly bar(String bar) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java index f3d22350d6e..df661e027e9 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MapTest.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class MapTest { - @JsonProperty("map_map_of_string") + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) private Map> mapMapOfString = null; /** @@ -64,13 +65,16 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) private Map mapOfEnumString = null; - @JsonProperty("direct_map") + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) private Map directMap = null; - @JsonProperty("indirect_map") + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index d1d502a89de..e6c0672c5ca 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -32,13 +32,16 @@ import javax.validation.Valid; */ public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private Date dateTime; - @JsonProperty("map") + public static final String JSON_PROPERTY_MAP = "map"; + @JsonProperty(JSON_PROPERTY_MAP) private Map map = null; public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Model200Response.java index 8c27eb78743..0780d432241 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Model200Response.java @@ -27,10 +27,12 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing model name starting with number") public class Model200Response { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public Model200Response name(Integer name) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelApiResponse.java index b57511abaa7..1b5c00664ca 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -26,13 +26,16 @@ import javax.validation.Valid; */ public class ModelApiResponse { - @JsonProperty("code") + public static final String JSON_PROPERTY_CODE = "code"; + @JsonProperty(JSON_PROPERTY_CODE) private Integer code; - @JsonProperty("type") + public static final String JSON_PROPERTY_TYPE = "type"; + @JsonProperty(JSON_PROPERTY_TYPE) private String type; - @JsonProperty("message") + public static final String JSON_PROPERTY_MESSAGE = "message"; + @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; public ModelApiResponse code(Integer code) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelReturn.java index fdde8af707e..98e64dd70f3 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ModelReturn.java @@ -27,7 +27,8 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing reserved words") public class ModelReturn { - @JsonProperty("return") + public static final String JSON_PROPERTY_RETURN = "return"; + @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; public ModelReturn _return(Integer _return) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Name.java index ef0755902bc..edf4368c9a1 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Name.java @@ -27,16 +27,20 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing model name same as property name") public class Name { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("snake_case") + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; - @JsonProperty("property") + public static final String JSON_PROPERTY_PROPERTY = "property"; + @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; - @JsonProperty("123Number") + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; public Name name(Integer name) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/NumberOnly.java index 704db3569d6..15da555feb4 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/NumberOnly.java @@ -27,7 +27,8 @@ import javax.validation.Valid; */ public class NumberOnly { - @JsonProperty("JustNumber") + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Order.java index bd22729501d..4000d7fca78 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Order.java @@ -28,16 +28,20 @@ import javax.validation.Valid; */ public class Order { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("petId") + public static final String JSON_PROPERTY_PET_ID = "petId"; + @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; - @JsonProperty("quantity") + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; - @JsonProperty("shipDate") + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + @JsonProperty(JSON_PROPERTY_SHIP_DATE) private Date shipDate; /** @@ -73,10 +77,12 @@ public class Order { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; - @JsonProperty("complete") + public static final String JSON_PROPERTY_COMPLETE = "complete"; + @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; public Order id(Long id) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/OuterComposite.java index afbbd6609be..ee344471fc0 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/OuterComposite.java @@ -27,13 +27,16 @@ import javax.validation.Valid; */ public class OuterComposite { - @JsonProperty("my_number") + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; - @JsonProperty("my_string") + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; - @JsonProperty("my_boolean") + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Pet.java index ed95d7827f7..086c625aa3b 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Pet.java @@ -31,19 +31,24 @@ import javax.validation.Valid; */ public class Pet { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("category") + public static final String JSON_PROPERTY_CATEGORY = "category"; + @JsonProperty(JSON_PROPERTY_CATEGORY) private Category category = null; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; - @JsonProperty("photoUrls") + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList(); - @JsonProperty("tags") + public static final String JSON_PROPERTY_TAGS = "tags"; + @JsonProperty(JSON_PROPERTY_TAGS) private List tags = null; /** @@ -79,7 +84,8 @@ public class Pet { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public Pet id(Long id) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index bcce02a9c03..1e59f1624a1 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -26,10 +26,12 @@ import javax.validation.Valid; */ public class ReadOnlyFirst { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("baz") + public static final String JSON_PROPERTY_BAZ = "baz"; + @JsonProperty(JSON_PROPERTY_BAZ) private String baz; public ReadOnlyFirst bar(String bar) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/SpecialModelName.java index 16c037b9e68..19b09742162 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -26,7 +26,8 @@ import javax.validation.Valid; */ public class SpecialModelName { - @JsonProperty("$special[property.name]") + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Tag.java index dd36c464221..d610b60e8ca 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Tag.java @@ -26,10 +26,12 @@ import javax.validation.Valid; */ public class Tag { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public Tag id(Long id) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderDefault.java index 88fa741adf3..18a173dd67e 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -29,19 +29,24 @@ import javax.validation.Valid; */ public class TypeHolderDefault { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderExample.java index 364e5452a5b..0ff32afc693 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -29,19 +29,24 @@ import javax.validation.Valid; */ public class TypeHolderExample { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/User.java index 27eb564befb..5df67fece76 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/User.java @@ -26,28 +26,36 @@ import javax.validation.Valid; */ public class User { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("username") + public static final String JSON_PROPERTY_USERNAME = "username"; + @JsonProperty(JSON_PROPERTY_USERNAME) private String username; - @JsonProperty("firstName") + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; - @JsonProperty("lastName") + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; - @JsonProperty("email") + public static final String JSON_PROPERTY_EMAIL = "email"; + @JsonProperty(JSON_PROPERTY_EMAIL) private String email; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; - @JsonProperty("phone") + public static final String JSON_PROPERTY_PHONE = "phone"; + @JsonProperty(JSON_PROPERTY_PHONE) private String phone; - @JsonProperty("userStatus") + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; public User id(Long id) { diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/XmlItem.java index e03c35a009b..b0098143188 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/XmlItem.java @@ -29,91 +29,120 @@ import javax.validation.Valid; */ public class XmlItem { - @JsonProperty("attribute_string") + public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; - @JsonProperty("attribute_number") + public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; - @JsonProperty("attribute_integer") + public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; - @JsonProperty("attribute_boolean") + public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; - @JsonProperty("wrapped_array") + public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) private List wrappedArray = null; - @JsonProperty("name_string") + public static final String JSON_PROPERTY_NAME_STRING = "name_string"; + @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; - @JsonProperty("name_number") + public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; - @JsonProperty("name_integer") + public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; - @JsonProperty("name_boolean") + public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; - @JsonProperty("name_array") + public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) private List nameArray = null; - @JsonProperty("name_wrapped_array") + public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) private List nameWrappedArray = null; - @JsonProperty("prefix_string") + public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; - @JsonProperty("prefix_number") + public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; - @JsonProperty("prefix_integer") + public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; - @JsonProperty("prefix_boolean") + public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; - @JsonProperty("prefix_array") + public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) private List prefixArray = null; - @JsonProperty("prefix_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) private List prefixWrappedArray = null; - @JsonProperty("namespace_string") + public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; - @JsonProperty("namespace_number") + public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; - @JsonProperty("namespace_integer") + public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; - @JsonProperty("namespace_boolean") + public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; - @JsonProperty("namespace_array") + public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) private List namespaceArray = null; - @JsonProperty("namespace_wrapped_array") + public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) private List namespaceWrappedArray = null; - @JsonProperty("prefix_ns_string") + public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; - @JsonProperty("prefix_ns_number") + public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; - @JsonProperty("prefix_ns_integer") + public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; - @JsonProperty("prefix_ns_boolean") + public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; - @JsonProperty("prefix_ns_array") + public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) private List prefixNsArray = null; - @JsonProperty("prefix_ns_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) private List prefixNsWrappedArray = null; public XmlItem attributeString(String attributeString) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 206581677dc..47156768c39 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java index c26323e1248..201ecdca22a 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesArray name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5e7e6a17f23..93c6b3d0623 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index ea08abdb78b..76cb99844c9 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -30,37 +30,48 @@ import javax.validation.Valid; */ public class AdditionalPropertiesClass { - @JsonProperty("map_string") + public static final String JSON_PROPERTY_MAP_STRING = "map_string"; + @JsonProperty(JSON_PROPERTY_MAP_STRING) private Map mapString = null; - @JsonProperty("map_number") + public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) private Map mapNumber = null; - @JsonProperty("map_integer") + public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) private Map mapInteger = null; - @JsonProperty("map_boolean") + public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) private Map mapBoolean = null; - @JsonProperty("map_array_integer") + public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) private Map> mapArrayInteger = null; - @JsonProperty("map_array_anytype") + public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) private Map> mapArrayAnytype = null; - @JsonProperty("map_map_string") + public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) private Map> mapMapString = null; - @JsonProperty("map_map_anytype") + public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) private Map> mapMapAnytype = null; - @JsonProperty("anytype_1") + public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + @JsonProperty(JSON_PROPERTY_ANYTYPE1) private Object anytype1 = null; - @JsonProperty("anytype_2") + public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; + @JsonProperty(JSON_PROPERTY_ANYTYPE2) private Object anytype2 = null; - @JsonProperty("anytype_3") + public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; + @JsonProperty(JSON_PROPERTY_ANYTYPE3) private Object anytype3 = null; public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java index 4b87b18400a..cbe2aeb620d 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesInteger name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java index 832c7288ce8..4d865d10914 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesNumber name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java index fe8f7545675..a810b4e281c 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesObject name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java index 3ac82c485f7..338cd8fd95d 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesString name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Animal.java index 41de9bf738e..196a01e7ec4 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Animal.java @@ -33,10 +33,12 @@ import javax.validation.Valid; }) public class Animal { - @JsonProperty("className") + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; - @JsonProperty("color") + public static final String JSON_PROPERTY_COLOR = "color"; + @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; public Animal className(String className) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 2e8994cb533..dd585cbc5d4 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = null; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index c45285d1c63..e6ce7cdead2 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) private List arrayNumber = null; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayTest.java index b45fb5dd64f..a90ffb02426 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ArrayTest.java @@ -29,13 +29,16 @@ import javax.validation.Valid; */ public class ArrayTest { - @JsonProperty("array_of_string") + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) private List arrayOfString = null; - @JsonProperty("array_array_of_integer") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) private List> arrayArrayOfInteger = null; - @JsonProperty("array_array_of_model") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = null; public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Capitalization.java index 5176fd7516d..61c0f797129 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Capitalization.java @@ -26,22 +26,28 @@ import javax.validation.Valid; */ public class Capitalization { - @JsonProperty("smallCamel") + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; - @JsonProperty("CapitalCamel") + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; - @JsonProperty("small_Snake") + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; - @JsonProperty("Capital_Snake") + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Cat.java index fe2ac658ed7..bf7893083ce 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Cat.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class Cat extends Animal { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public Cat declawed(Boolean declawed) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/CatAllOf.java index 40e3c4b8ef9..af37e289596 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/CatAllOf.java @@ -26,7 +26,8 @@ import javax.validation.Valid; */ public class CatAllOf { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public CatAllOf declawed(Boolean declawed) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Category.java index e31a47278b8..74caab13ae2 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Category.java @@ -26,10 +26,12 @@ import javax.validation.Valid; */ public class Category { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; public Category id(Long id) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ClassModel.java index 7845744e726..18d53d76e4b 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ClassModel.java @@ -27,7 +27,8 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { - @JsonProperty("_class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public ClassModel propertyClass(String propertyClass) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Client.java index 42d3c83dbed..0b9ce9c74e0 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Client.java @@ -26,7 +26,8 @@ import javax.validation.Valid; */ public class Client { - @JsonProperty("client") + public static final String JSON_PROPERTY_CLIENT = "client"; + @JsonProperty(JSON_PROPERTY_CLIENT) private String client; public Client client(String client) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Dog.java index 0df59680968..831f704b6a9 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Dog.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class Dog extends Animal { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public Dog breed(String breed) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/DogAllOf.java index fc9b46e619e..4de5a238f00 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/DogAllOf.java @@ -26,7 +26,8 @@ import javax.validation.Valid; */ public class DogAllOf { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public DogAllOf breed(String breed) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumArrays.java index b2850acc72c..87593bd9fb4 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumArrays.java @@ -60,7 +60,8 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -94,7 +95,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) private List arrayEnum = null; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java index 03b3369d592..35f24f090f1 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/EnumTest.java @@ -61,7 +61,8 @@ public class EnumTest { } } - @JsonProperty("enum_string") + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -97,7 +98,8 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -131,7 +133,8 @@ public class EnumTest { } } - @JsonProperty("enum_integer") + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -165,10 +168,12 @@ public class EnumTest { } } - @JsonProperty("enum_number") + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 52e0ef4cde5..2c86b3fda55 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -28,10 +28,12 @@ import javax.validation.Valid; */ public class FileSchemaTestClass { - @JsonProperty("file") + public static final String JSON_PROPERTY_FILE = "file"; + @JsonProperty(JSON_PROPERTY_FILE) private java.io.File file = null; - @JsonProperty("files") + public static final String JSON_PROPERTY_FILES = "files"; + @JsonProperty(JSON_PROPERTY_FILES) private List files = null; public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FormatTest.java index 03b0e3f57ff..34ad45203ba 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/FormatTest.java @@ -30,43 +30,56 @@ import javax.validation.Valid; */ public class FormatTest { - @JsonProperty("integer") + public static final String JSON_PROPERTY_INTEGER = "integer"; + @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; - @JsonProperty("int32") + public static final String JSON_PROPERTY_INT32 = "int32"; + @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; - @JsonProperty("int64") + public static final String JSON_PROPERTY_INT64 = "int64"; + @JsonProperty(JSON_PROPERTY_INT64) private Long int64; - @JsonProperty("number") + public static final String JSON_PROPERTY_NUMBER = "number"; + @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; - @JsonProperty("float") + public static final String JSON_PROPERTY_FLOAT = "float"; + @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; - @JsonProperty("double") + public static final String JSON_PROPERTY_DOUBLE = "double"; + @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; - @JsonProperty("string") + public static final String JSON_PROPERTY_STRING = "string"; + @JsonProperty(JSON_PROPERTY_STRING) private String string; - @JsonProperty("byte") + public static final String JSON_PROPERTY_BYTE = "byte"; + @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; - @JsonProperty("binary") + public static final String JSON_PROPERTY_BINARY = "binary"; + @JsonProperty(JSON_PROPERTY_BINARY) private File binary; - @JsonProperty("date") + public static final String JSON_PROPERTY_DATE = "date"; + @JsonProperty(JSON_PROPERTY_DATE) private Date date; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private Date dateTime; - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public FormatTest integer(Integer integer) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index e46b20cfcdb..1e3b44e6187 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -26,10 +26,12 @@ import javax.validation.Valid; */ public class HasOnlyReadOnly { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("foo") + public static final String JSON_PROPERTY_FOO = "foo"; + @JsonProperty(JSON_PROPERTY_FOO) private String foo; public HasOnlyReadOnly bar(String bar) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java index f3d22350d6e..df661e027e9 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MapTest.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class MapTest { - @JsonProperty("map_map_of_string") + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) private Map> mapMapOfString = null; /** @@ -64,13 +65,16 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) private Map mapOfEnumString = null; - @JsonProperty("direct_map") + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) private Map directMap = null; - @JsonProperty("indirect_map") + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index d1d502a89de..e6c0672c5ca 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -32,13 +32,16 @@ import javax.validation.Valid; */ public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private Date dateTime; - @JsonProperty("map") + public static final String JSON_PROPERTY_MAP = "map"; + @JsonProperty(JSON_PROPERTY_MAP) private Map map = null; public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Model200Response.java index 8c27eb78743..0780d432241 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Model200Response.java @@ -27,10 +27,12 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing model name starting with number") public class Model200Response { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public Model200Response name(Integer name) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java index b57511abaa7..1b5c00664ca 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -26,13 +26,16 @@ import javax.validation.Valid; */ public class ModelApiResponse { - @JsonProperty("code") + public static final String JSON_PROPERTY_CODE = "code"; + @JsonProperty(JSON_PROPERTY_CODE) private Integer code; - @JsonProperty("type") + public static final String JSON_PROPERTY_TYPE = "type"; + @JsonProperty(JSON_PROPERTY_TYPE) private String type; - @JsonProperty("message") + public static final String JSON_PROPERTY_MESSAGE = "message"; + @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; public ModelApiResponse code(Integer code) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelReturn.java index fdde8af707e..98e64dd70f3 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ModelReturn.java @@ -27,7 +27,8 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing reserved words") public class ModelReturn { - @JsonProperty("return") + public static final String JSON_PROPERTY_RETURN = "return"; + @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; public ModelReturn _return(Integer _return) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Name.java index ef0755902bc..edf4368c9a1 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Name.java @@ -27,16 +27,20 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing model name same as property name") public class Name { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("snake_case") + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; - @JsonProperty("property") + public static final String JSON_PROPERTY_PROPERTY = "property"; + @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; - @JsonProperty("123Number") + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; public Name name(Integer name) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/NumberOnly.java index 704db3569d6..15da555feb4 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/NumberOnly.java @@ -27,7 +27,8 @@ import javax.validation.Valid; */ public class NumberOnly { - @JsonProperty("JustNumber") + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Order.java index bd22729501d..4000d7fca78 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Order.java @@ -28,16 +28,20 @@ import javax.validation.Valid; */ public class Order { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("petId") + public static final String JSON_PROPERTY_PET_ID = "petId"; + @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; - @JsonProperty("quantity") + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; - @JsonProperty("shipDate") + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + @JsonProperty(JSON_PROPERTY_SHIP_DATE) private Date shipDate; /** @@ -73,10 +77,12 @@ public class Order { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; - @JsonProperty("complete") + public static final String JSON_PROPERTY_COMPLETE = "complete"; + @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; public Order id(Long id) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/OuterComposite.java index afbbd6609be..ee344471fc0 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/OuterComposite.java @@ -27,13 +27,16 @@ import javax.validation.Valid; */ public class OuterComposite { - @JsonProperty("my_number") + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; - @JsonProperty("my_string") + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; - @JsonProperty("my_boolean") + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Pet.java index ed95d7827f7..086c625aa3b 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Pet.java @@ -31,19 +31,24 @@ import javax.validation.Valid; */ public class Pet { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("category") + public static final String JSON_PROPERTY_CATEGORY = "category"; + @JsonProperty(JSON_PROPERTY_CATEGORY) private Category category = null; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; - @JsonProperty("photoUrls") + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList(); - @JsonProperty("tags") + public static final String JSON_PROPERTY_TAGS = "tags"; + @JsonProperty(JSON_PROPERTY_TAGS) private List tags = null; /** @@ -79,7 +84,8 @@ public class Pet { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public Pet id(Long id) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index bcce02a9c03..1e59f1624a1 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -26,10 +26,12 @@ import javax.validation.Valid; */ public class ReadOnlyFirst { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("baz") + public static final String JSON_PROPERTY_BAZ = "baz"; + @JsonProperty(JSON_PROPERTY_BAZ) private String baz; public ReadOnlyFirst bar(String bar) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java index 16c037b9e68..19b09742162 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -26,7 +26,8 @@ import javax.validation.Valid; */ public class SpecialModelName { - @JsonProperty("$special[property.name]") + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Tag.java index dd36c464221..d610b60e8ca 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Tag.java @@ -26,10 +26,12 @@ import javax.validation.Valid; */ public class Tag { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public Tag id(Long id) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java index 88fa741adf3..18a173dd67e 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -29,19 +29,24 @@ import javax.validation.Valid; */ public class TypeHolderDefault { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java index 364e5452a5b..0ff32afc693 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -29,19 +29,24 @@ import javax.validation.Valid; */ public class TypeHolderExample { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/User.java index 27eb564befb..5df67fece76 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/User.java @@ -26,28 +26,36 @@ import javax.validation.Valid; */ public class User { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("username") + public static final String JSON_PROPERTY_USERNAME = "username"; + @JsonProperty(JSON_PROPERTY_USERNAME) private String username; - @JsonProperty("firstName") + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; - @JsonProperty("lastName") + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; - @JsonProperty("email") + public static final String JSON_PROPERTY_EMAIL = "email"; + @JsonProperty(JSON_PROPERTY_EMAIL) private String email; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; - @JsonProperty("phone") + public static final String JSON_PROPERTY_PHONE = "phone"; + @JsonProperty(JSON_PROPERTY_PHONE) private String phone; - @JsonProperty("userStatus") + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; public User id(Long id) { diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/XmlItem.java index e03c35a009b..b0098143188 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/XmlItem.java @@ -29,91 +29,120 @@ import javax.validation.Valid; */ public class XmlItem { - @JsonProperty("attribute_string") + public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; - @JsonProperty("attribute_number") + public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; - @JsonProperty("attribute_integer") + public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; - @JsonProperty("attribute_boolean") + public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; - @JsonProperty("wrapped_array") + public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) private List wrappedArray = null; - @JsonProperty("name_string") + public static final String JSON_PROPERTY_NAME_STRING = "name_string"; + @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; - @JsonProperty("name_number") + public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; - @JsonProperty("name_integer") + public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; - @JsonProperty("name_boolean") + public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; - @JsonProperty("name_array") + public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) private List nameArray = null; - @JsonProperty("name_wrapped_array") + public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) private List nameWrappedArray = null; - @JsonProperty("prefix_string") + public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; - @JsonProperty("prefix_number") + public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; - @JsonProperty("prefix_integer") + public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; - @JsonProperty("prefix_boolean") + public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; - @JsonProperty("prefix_array") + public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) private List prefixArray = null; - @JsonProperty("prefix_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) private List prefixWrappedArray = null; - @JsonProperty("namespace_string") + public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; - @JsonProperty("namespace_number") + public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; - @JsonProperty("namespace_integer") + public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; - @JsonProperty("namespace_boolean") + public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; - @JsonProperty("namespace_array") + public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) private List namespaceArray = null; - @JsonProperty("namespace_wrapped_array") + public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) private List namespaceWrappedArray = null; - @JsonProperty("prefix_ns_string") + public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; - @JsonProperty("prefix_ns_number") + public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; - @JsonProperty("prefix_ns_integer") + public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; - @JsonProperty("prefix_ns_boolean") + public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; - @JsonProperty("prefix_ns_array") + public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) private List prefixNsArray = null; - @JsonProperty("prefix_ns_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) private List prefixNsWrappedArray = null; public XmlItem attributeString(String attributeString) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 206581677dc..47156768c39 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesAnyType extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesAnyType name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java index c26323e1248..201ecdca22a 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesArray extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesArray name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 5e7e6a17f23..93c6b3d0623 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesBoolean extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesBoolean name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index ea08abdb78b..76cb99844c9 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -30,37 +30,48 @@ import javax.validation.Valid; */ public class AdditionalPropertiesClass { - @JsonProperty("map_string") + public static final String JSON_PROPERTY_MAP_STRING = "map_string"; + @JsonProperty(JSON_PROPERTY_MAP_STRING) private Map mapString = null; - @JsonProperty("map_number") + public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) private Map mapNumber = null; - @JsonProperty("map_integer") + public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) private Map mapInteger = null; - @JsonProperty("map_boolean") + public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean"; + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) private Map mapBoolean = null; - @JsonProperty("map_array_integer") + public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) private Map> mapArrayInteger = null; - @JsonProperty("map_array_anytype") + public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) private Map> mapArrayAnytype = null; - @JsonProperty("map_map_string") + public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) private Map> mapMapString = null; - @JsonProperty("map_map_anytype") + public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) private Map> mapMapAnytype = null; - @JsonProperty("anytype_1") + public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + @JsonProperty(JSON_PROPERTY_ANYTYPE1) private Object anytype1 = null; - @JsonProperty("anytype_2") + public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2"; + @JsonProperty(JSON_PROPERTY_ANYTYPE2) private Object anytype2 = null; - @JsonProperty("anytype_3") + public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; + @JsonProperty(JSON_PROPERTY_ANYTYPE3) private Object anytype3 = null; public AdditionalPropertiesClass mapString(Map mapString) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java index 4b87b18400a..cbe2aeb620d 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesInteger extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesInteger name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java index 832c7288ce8..4d865d10914 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesNumber extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesNumber name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java index fe8f7545675..a810b4e281c 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesObject extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesObject name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java index 3ac82c485f7..338cd8fd95d 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class AdditionalPropertiesString extends HashMap { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public AdditionalPropertiesString name(String name) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Animal.java index 41de9bf738e..196a01e7ec4 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Animal.java @@ -33,10 +33,12 @@ import javax.validation.Valid; }) public class Animal { - @JsonProperty("className") + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @JsonProperty(JSON_PROPERTY_CLASS_NAME) private String className; - @JsonProperty("color") + public static final String JSON_PROPERTY_COLOR = "color"; + @JsonProperty(JSON_PROPERTY_COLOR) private String color = "red"; public Animal className(String className) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 2e8994cb533..dd585cbc5d4 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) private List> arrayArrayNumber = null; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index c45285d1c63..e6ce7cdead2 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -29,7 +29,8 @@ import javax.validation.Valid; */ public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) private List arrayNumber = null; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayTest.java index b45fb5dd64f..a90ffb02426 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ArrayTest.java @@ -29,13 +29,16 @@ import javax.validation.Valid; */ public class ArrayTest { - @JsonProperty("array_of_string") + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) private List arrayOfString = null; - @JsonProperty("array_array_of_integer") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) private List> arrayArrayOfInteger = null; - @JsonProperty("array_array_of_model") + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) private List> arrayArrayOfModel = null; public ArrayTest arrayOfString(List arrayOfString) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Capitalization.java index 5176fd7516d..61c0f797129 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Capitalization.java @@ -26,22 +26,28 @@ import javax.validation.Valid; */ public class Capitalization { - @JsonProperty("smallCamel") + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) private String smallCamel; - @JsonProperty("CapitalCamel") + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) private String capitalCamel; - @JsonProperty("small_Snake") + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) private String smallSnake; - @JsonProperty("Capital_Snake") + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) private String capitalSnake; - @JsonProperty("SCA_ETH_Flow_Points") + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) private String scAETHFlowPoints; - @JsonProperty("ATT_NAME") + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Cat.java index fe2ac658ed7..bf7893083ce 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Cat.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class Cat extends Animal { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public Cat declawed(Boolean declawed) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/CatAllOf.java index 40e3c4b8ef9..af37e289596 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/CatAllOf.java @@ -26,7 +26,8 @@ import javax.validation.Valid; */ public class CatAllOf { - @JsonProperty("declawed") + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @JsonProperty(JSON_PROPERTY_DECLAWED) private Boolean declawed; public CatAllOf declawed(Boolean declawed) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Category.java index e31a47278b8..74caab13ae2 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Category.java @@ -26,10 +26,12 @@ import javax.validation.Valid; */ public class Category { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name = "default-name"; public Category id(Long id) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ClassModel.java index 7845744e726..18d53d76e4b 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ClassModel.java @@ -27,7 +27,8 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { - @JsonProperty("_class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public ClassModel propertyClass(String propertyClass) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Client.java index 42d3c83dbed..0b9ce9c74e0 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Client.java @@ -26,7 +26,8 @@ import javax.validation.Valid; */ public class Client { - @JsonProperty("client") + public static final String JSON_PROPERTY_CLIENT = "client"; + @JsonProperty(JSON_PROPERTY_CLIENT) private String client; public Client client(String client) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Dog.java index 0df59680968..831f704b6a9 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Dog.java @@ -28,7 +28,8 @@ import javax.validation.Valid; */ public class Dog extends Animal { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public Dog breed(String breed) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/DogAllOf.java index fc9b46e619e..4de5a238f00 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/DogAllOf.java @@ -26,7 +26,8 @@ import javax.validation.Valid; */ public class DogAllOf { - @JsonProperty("breed") + public static final String JSON_PROPERTY_BREED = "breed"; + @JsonProperty(JSON_PROPERTY_BREED) private String breed; public DogAllOf breed(String breed) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumArrays.java index b2850acc72c..87593bd9fb4 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumArrays.java @@ -60,7 +60,8 @@ public class EnumArrays { } } - @JsonProperty("just_symbol") + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) private JustSymbolEnum justSymbol; /** @@ -94,7 +95,8 @@ public class EnumArrays { } } - @JsonProperty("array_enum") + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) private List arrayEnum = null; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java index 03b3369d592..35f24f090f1 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/EnumTest.java @@ -61,7 +61,8 @@ public class EnumTest { } } - @JsonProperty("enum_string") + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING) private EnumStringEnum enumString; /** @@ -97,7 +98,8 @@ public class EnumTest { } } - @JsonProperty("enum_string_required") + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) private EnumStringRequiredEnum enumStringRequired; /** @@ -131,7 +133,8 @@ public class EnumTest { } } - @JsonProperty("enum_integer") + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) private EnumIntegerEnum enumInteger; /** @@ -165,10 +168,12 @@ public class EnumTest { } } - @JsonProperty("enum_number") + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) private EnumNumberEnum enumNumber; - @JsonProperty("outerEnum") + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) private OuterEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 52e0ef4cde5..2c86b3fda55 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -28,10 +28,12 @@ import javax.validation.Valid; */ public class FileSchemaTestClass { - @JsonProperty("file") + public static final String JSON_PROPERTY_FILE = "file"; + @JsonProperty(JSON_PROPERTY_FILE) private java.io.File file = null; - @JsonProperty("files") + public static final String JSON_PROPERTY_FILES = "files"; + @JsonProperty(JSON_PROPERTY_FILES) private List files = null; public FileSchemaTestClass file(java.io.File file) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FormatTest.java index 03b0e3f57ff..34ad45203ba 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/FormatTest.java @@ -30,43 +30,56 @@ import javax.validation.Valid; */ public class FormatTest { - @JsonProperty("integer") + public static final String JSON_PROPERTY_INTEGER = "integer"; + @JsonProperty(JSON_PROPERTY_INTEGER) private Integer integer; - @JsonProperty("int32") + public static final String JSON_PROPERTY_INT32 = "int32"; + @JsonProperty(JSON_PROPERTY_INT32) private Integer int32; - @JsonProperty("int64") + public static final String JSON_PROPERTY_INT64 = "int64"; + @JsonProperty(JSON_PROPERTY_INT64) private Long int64; - @JsonProperty("number") + public static final String JSON_PROPERTY_NUMBER = "number"; + @JsonProperty(JSON_PROPERTY_NUMBER) private BigDecimal number; - @JsonProperty("float") + public static final String JSON_PROPERTY_FLOAT = "float"; + @JsonProperty(JSON_PROPERTY_FLOAT) private Float _float; - @JsonProperty("double") + public static final String JSON_PROPERTY_DOUBLE = "double"; + @JsonProperty(JSON_PROPERTY_DOUBLE) private Double _double; - @JsonProperty("string") + public static final String JSON_PROPERTY_STRING = "string"; + @JsonProperty(JSON_PROPERTY_STRING) private String string; - @JsonProperty("byte") + public static final String JSON_PROPERTY_BYTE = "byte"; + @JsonProperty(JSON_PROPERTY_BYTE) private byte[] _byte; - @JsonProperty("binary") + public static final String JSON_PROPERTY_BINARY = "binary"; + @JsonProperty(JSON_PROPERTY_BINARY) private File binary; - @JsonProperty("date") + public static final String JSON_PROPERTY_DATE = "date"; + @JsonProperty(JSON_PROPERTY_DATE) private Date date; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private Date dateTime; - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; public FormatTest integer(Integer integer) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index e46b20cfcdb..1e3b44e6187 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -26,10 +26,12 @@ import javax.validation.Valid; */ public class HasOnlyReadOnly { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("foo") + public static final String JSON_PROPERTY_FOO = "foo"; + @JsonProperty(JSON_PROPERTY_FOO) private String foo; public HasOnlyReadOnly bar(String bar) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java index f3d22350d6e..df661e027e9 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MapTest.java @@ -30,7 +30,8 @@ import javax.validation.Valid; */ public class MapTest { - @JsonProperty("map_map_of_string") + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) private Map> mapMapOfString = null; /** @@ -64,13 +65,16 @@ public class MapTest { } } - @JsonProperty("map_of_enum_string") + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) private Map mapOfEnumString = null; - @JsonProperty("direct_map") + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) private Map directMap = null; - @JsonProperty("indirect_map") + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index d1d502a89de..e6c0672c5ca 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -32,13 +32,16 @@ import javax.validation.Valid; */ public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") + public static final String JSON_PROPERTY_UUID = "uuid"; + @JsonProperty(JSON_PROPERTY_UUID) private UUID uuid; - @JsonProperty("dateTime") + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @JsonProperty(JSON_PROPERTY_DATE_TIME) private Date dateTime; - @JsonProperty("map") + public static final String JSON_PROPERTY_MAP = "map"; + @JsonProperty(JSON_PROPERTY_MAP) private Map map = null; public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Model200Response.java index 8c27eb78743..0780d432241 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Model200Response.java @@ -27,10 +27,12 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing model name starting with number") public class Model200Response { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("class") + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) private String propertyClass; public Model200Response name(Integer name) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelApiResponse.java index b57511abaa7..1b5c00664ca 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -26,13 +26,16 @@ import javax.validation.Valid; */ public class ModelApiResponse { - @JsonProperty("code") + public static final String JSON_PROPERTY_CODE = "code"; + @JsonProperty(JSON_PROPERTY_CODE) private Integer code; - @JsonProperty("type") + public static final String JSON_PROPERTY_TYPE = "type"; + @JsonProperty(JSON_PROPERTY_TYPE) private String type; - @JsonProperty("message") + public static final String JSON_PROPERTY_MESSAGE = "message"; + @JsonProperty(JSON_PROPERTY_MESSAGE) private String message; public ModelApiResponse code(Integer code) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelReturn.java index fdde8af707e..98e64dd70f3 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ModelReturn.java @@ -27,7 +27,8 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing reserved words") public class ModelReturn { - @JsonProperty("return") + public static final String JSON_PROPERTY_RETURN = "return"; + @JsonProperty(JSON_PROPERTY_RETURN) private Integer _return; public ModelReturn _return(Integer _return) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Name.java index ef0755902bc..edf4368c9a1 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Name.java @@ -27,16 +27,20 @@ import javax.validation.Valid; @ApiModel(description = "Model for testing model name same as property name") public class Name { - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private Integer name; - @JsonProperty("snake_case") + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) private Integer snakeCase; - @JsonProperty("property") + public static final String JSON_PROPERTY_PROPERTY = "property"; + @JsonProperty(JSON_PROPERTY_PROPERTY) private String property; - @JsonProperty("123Number") + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + @JsonProperty(JSON_PROPERTY_123NUMBER) private Integer _123number; public Name name(Integer name) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/NumberOnly.java index 704db3569d6..15da555feb4 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/NumberOnly.java @@ -27,7 +27,8 @@ import javax.validation.Valid; */ public class NumberOnly { - @JsonProperty("JustNumber") + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Order.java index bd22729501d..4000d7fca78 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Order.java @@ -28,16 +28,20 @@ import javax.validation.Valid; */ public class Order { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("petId") + public static final String JSON_PROPERTY_PET_ID = "petId"; + @JsonProperty(JSON_PROPERTY_PET_ID) private Long petId; - @JsonProperty("quantity") + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + @JsonProperty(JSON_PROPERTY_QUANTITY) private Integer quantity; - @JsonProperty("shipDate") + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + @JsonProperty(JSON_PROPERTY_SHIP_DATE) private Date shipDate; /** @@ -73,10 +77,12 @@ public class Order { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; - @JsonProperty("complete") + public static final String JSON_PROPERTY_COMPLETE = "complete"; + @JsonProperty(JSON_PROPERTY_COMPLETE) private Boolean complete = false; public Order id(Long id) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/OuterComposite.java index afbbd6609be..ee344471fc0 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/OuterComposite.java @@ -27,13 +27,16 @@ import javax.validation.Valid; */ public class OuterComposite { - @JsonProperty("my_number") + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + @JsonProperty(JSON_PROPERTY_MY_NUMBER) private BigDecimal myNumber; - @JsonProperty("my_string") + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + @JsonProperty(JSON_PROPERTY_MY_STRING) private String myString; - @JsonProperty("my_boolean") + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Pet.java index ed95d7827f7..086c625aa3b 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Pet.java @@ -31,19 +31,24 @@ import javax.validation.Valid; */ public class Pet { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("category") + public static final String JSON_PROPERTY_CATEGORY = "category"; + @JsonProperty(JSON_PROPERTY_CATEGORY) private Category category = null; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; - @JsonProperty("photoUrls") + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) private List photoUrls = new ArrayList(); - @JsonProperty("tags") + public static final String JSON_PROPERTY_TAGS = "tags"; + @JsonProperty(JSON_PROPERTY_TAGS) private List tags = null; /** @@ -79,7 +84,8 @@ public class Pet { } } - @JsonProperty("status") + public static final String JSON_PROPERTY_STATUS = "status"; + @JsonProperty(JSON_PROPERTY_STATUS) private StatusEnum status; public Pet id(Long id) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index bcce02a9c03..1e59f1624a1 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -26,10 +26,12 @@ import javax.validation.Valid; */ public class ReadOnlyFirst { - @JsonProperty("bar") + public static final String JSON_PROPERTY_BAR = "bar"; + @JsonProperty(JSON_PROPERTY_BAR) private String bar; - @JsonProperty("baz") + public static final String JSON_PROPERTY_BAZ = "baz"; + @JsonProperty(JSON_PROPERTY_BAZ) private String baz; public ReadOnlyFirst bar(String bar) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/SpecialModelName.java index 16c037b9e68..19b09742162 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -26,7 +26,8 @@ import javax.validation.Valid; */ public class SpecialModelName { - @JsonProperty("$special[property.name]") + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Tag.java index dd36c464221..d610b60e8ca 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Tag.java @@ -26,10 +26,12 @@ import javax.validation.Valid; */ public class Tag { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("name") + public static final String JSON_PROPERTY_NAME = "name"; + @JsonProperty(JSON_PROPERTY_NAME) private String name; public Tag id(Long id) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderDefault.java index 88fa741adf3..18a173dd67e 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -29,19 +29,24 @@ import javax.validation.Valid; */ public class TypeHolderDefault { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem = "what"; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem = true; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); public TypeHolderDefault stringItem(String stringItem) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderExample.java index 364e5452a5b..0ff32afc693 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -29,19 +29,24 @@ import javax.validation.Valid; */ public class TypeHolderExample { - @JsonProperty("string_item") + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) private String stringItem; - @JsonProperty("number_item") + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) private BigDecimal numberItem; - @JsonProperty("integer_item") + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) private Integer integerItem; - @JsonProperty("bool_item") + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) private Boolean boolItem; - @JsonProperty("array_item") + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) private List arrayItem = new ArrayList(); public TypeHolderExample stringItem(String stringItem) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/User.java index 27eb564befb..5df67fece76 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/User.java @@ -26,28 +26,36 @@ import javax.validation.Valid; */ public class User { - @JsonProperty("id") + public static final String JSON_PROPERTY_ID = "id"; + @JsonProperty(JSON_PROPERTY_ID) private Long id; - @JsonProperty("username") + public static final String JSON_PROPERTY_USERNAME = "username"; + @JsonProperty(JSON_PROPERTY_USERNAME) private String username; - @JsonProperty("firstName") + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + @JsonProperty(JSON_PROPERTY_FIRST_NAME) private String firstName; - @JsonProperty("lastName") + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + @JsonProperty(JSON_PROPERTY_LAST_NAME) private String lastName; - @JsonProperty("email") + public static final String JSON_PROPERTY_EMAIL = "email"; + @JsonProperty(JSON_PROPERTY_EMAIL) private String email; - @JsonProperty("password") + public static final String JSON_PROPERTY_PASSWORD = "password"; + @JsonProperty(JSON_PROPERTY_PASSWORD) private String password; - @JsonProperty("phone") + public static final String JSON_PROPERTY_PHONE = "phone"; + @JsonProperty(JSON_PROPERTY_PHONE) private String phone; - @JsonProperty("userStatus") + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + @JsonProperty(JSON_PROPERTY_USER_STATUS) private Integer userStatus; public User id(Long id) { diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/XmlItem.java index e03c35a009b..b0098143188 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/XmlItem.java @@ -29,91 +29,120 @@ import javax.validation.Valid; */ public class XmlItem { - @JsonProperty("attribute_string") + public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) private String attributeString; - @JsonProperty("attribute_number") + public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) private BigDecimal attributeNumber; - @JsonProperty("attribute_integer") + public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) private Integer attributeInteger; - @JsonProperty("attribute_boolean") + public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) private Boolean attributeBoolean; - @JsonProperty("wrapped_array") + public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) private List wrappedArray = null; - @JsonProperty("name_string") + public static final String JSON_PROPERTY_NAME_STRING = "name_string"; + @JsonProperty(JSON_PROPERTY_NAME_STRING) private String nameString; - @JsonProperty("name_number") + public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) private BigDecimal nameNumber; - @JsonProperty("name_integer") + public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) private Integer nameInteger; - @JsonProperty("name_boolean") + public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) private Boolean nameBoolean; - @JsonProperty("name_array") + public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) private List nameArray = null; - @JsonProperty("name_wrapped_array") + public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) private List nameWrappedArray = null; - @JsonProperty("prefix_string") + public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) private String prefixString; - @JsonProperty("prefix_number") + public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) private BigDecimal prefixNumber; - @JsonProperty("prefix_integer") + public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) private Integer prefixInteger; - @JsonProperty("prefix_boolean") + public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) private Boolean prefixBoolean; - @JsonProperty("prefix_array") + public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) private List prefixArray = null; - @JsonProperty("prefix_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) private List prefixWrappedArray = null; - @JsonProperty("namespace_string") + public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) private String namespaceString; - @JsonProperty("namespace_number") + public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) private BigDecimal namespaceNumber; - @JsonProperty("namespace_integer") + public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) private Integer namespaceInteger; - @JsonProperty("namespace_boolean") + public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) private Boolean namespaceBoolean; - @JsonProperty("namespace_array") + public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) private List namespaceArray = null; - @JsonProperty("namespace_wrapped_array") + public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) private List namespaceWrappedArray = null; - @JsonProperty("prefix_ns_string") + public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) private String prefixNsString; - @JsonProperty("prefix_ns_number") + public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) private BigDecimal prefixNsNumber; - @JsonProperty("prefix_ns_integer") + public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) private Integer prefixNsInteger; - @JsonProperty("prefix_ns_boolean") + public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) private Boolean prefixNsBoolean; - @JsonProperty("prefix_ns_array") + public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) private List prefixNsArray = null; - @JsonProperty("prefix_ns_wrapped_array") + public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) private List prefixNsWrappedArray = null; public XmlItem attributeString(String attributeString) { From 59c4e381d1f96cbc5acda68f9d3853f28c85fa54 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 9 Aug 2019 22:25:32 +0800 Subject: [PATCH 70/75] Prepare 4.1.0 release (#3597) * update pom * update doc * update version * add dep for nullable annotaiton --- README.md | 14 +++++++------- modules/openapi-generator-cli/pom.xml | 2 +- modules/openapi-generator-core/pom.xml | 2 +- .../openapi-generator-gradle-plugin/README.adoc | 6 +++--- .../gradle.properties | 2 +- modules/openapi-generator-gradle-plugin/pom.xml | 2 +- .../samples/local-spec/README.md | 2 +- .../samples/local-spec/gradle.properties | 2 +- modules/openapi-generator-maven-plugin/README.md | 2 +- .../examples/java-client.xml | 9 ++++++++- .../examples/multi-module/java-client/pom.xml | 9 ++++++++- .../examples/non-java-invalid-spec.xml | 2 +- .../examples/non-java.xml | 2 +- modules/openapi-generator-maven-plugin/pom.xml | 2 +- modules/openapi-generator-online/pom.xml | 2 +- modules/openapi-generator/pom.xml | 2 +- pom.xml | 2 +- samples/meta-codegen/lib/pom.xml | 2 +- 18 files changed, 40 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index b40e0653213..815236441e5 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ OpenAPI Generator Version | Release Date | Notes ---------------------------- | ------------ | ----- 5.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.0.0-SNAPSHOT/)| 13.05.2020 | Major release with breaking changes (no fallback) 4.1.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.1.0-SNAPSHOT/)| 31.07.2019 | Minor release (breaking changes with fallbacks) -[4.0.3](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.0.3) (latest stable release) | 09.07.2019 | Patch release (bug fixes, minor enhancements, etc) +[4.1.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.1.0) (latest stable release) | 09.07.2019 | Patch release (bug fixes, minor enhancements, etc) OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0 @@ -158,16 +158,16 @@ See the different versions of the [openapi-generator-cli](https://mvnrepository. If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum): -JAR location: `http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.0.3/openapi-generator-cli-4.0.3.jar` +JAR location: `http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.1.0/openapi-generator-cli-4.1.0.jar` For **Mac/Linux** users: ```sh -wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.0.3/openapi-generator-cli-4.0.3.jar -O openapi-generator-cli.jar +wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.1.0/openapi-generator-cli-4.1.0.jar -O openapi-generator-cli.jar ``` For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g. ``` -Invoke-WebRequest -OutFile openapi-generator-cli.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.0.3/openapi-generator-cli-4.0.3.jar +Invoke-WebRequest -OutFile openapi-generator-cli.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.1.0/openapi-generator-cli-4.1.0.jar ``` After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage. @@ -382,10 +382,10 @@ openapi-generator version ``` -Or install a particular OpenAPI Generator version (e.g. v4.0.3): +Or install a particular OpenAPI Generator version (e.g. v4.1.0): ```sh -npm install @openapitools/openapi-generator-cli@cli-4.0.3 -g +npm install @openapitools/openapi-generator-cli@cli-4.1.0 -g ``` Or install it as dev-dependency: @@ -409,7 +409,7 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat (if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g php -o c:\temp\php_api_client`) -You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.0.3/openapi-generator-cli-4.0.3.jar) +You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.1.0/openapi-generator-cli-4.1.0.jar) To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate` diff --git a/modules/openapi-generator-cli/pom.xml b/modules/openapi-generator-cli/pom.xml index 181a3fb219e..eb0e05cb9db 100644 --- a/modules/openapi-generator-cli/pom.xml +++ b/modules/openapi-generator-cli/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 4.1.0-SNAPSHOT + 4.1.0 ../.. diff --git a/modules/openapi-generator-core/pom.xml b/modules/openapi-generator-core/pom.xml index d9e99ca645b..b4201d1cc86 100644 --- a/modules/openapi-generator-core/pom.xml +++ b/modules/openapi-generator-core/pom.xml @@ -6,7 +6,7 @@ openapi-generator-project org.openapitools - 4.1.0-SNAPSHOT + 4.1.0 ../.. diff --git a/modules/openapi-generator-gradle-plugin/README.adoc b/modules/openapi-generator-gradle-plugin/README.adoc index 3ed40ed1ea0..d35c7240ed8 100644 --- a/modules/openapi-generator-gradle-plugin/README.adoc +++ b/modules/openapi-generator-gradle-plugin/README.adoc @@ -45,7 +45,7 @@ compileJava.dependsOn tasks.openApiGenerate [source,group] ---- plugins { - id "org.openapi.generator" version "4.0.3" + id "org.openapi.generator" version "4.1.0" } ---- @@ -61,7 +61,7 @@ buildscript { // url "https://plugins.gradle.org/m2/" } dependencies { - classpath "org.openapitools:openapi-generator-gradle-plugin:4.0.3" + classpath "org.openapitools:openapi-generator-gradle-plugin:4.1.0" } } @@ -609,7 +609,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:3.2.1' - classpath('org.openapitools:openapi-generator-gradle-plugin:4.0.3') { + classpath('org.openapitools:openapi-generator-gradle-plugin:4.1.0') { exclude group: 'com.google.guava' } } diff --git a/modules/openapi-generator-gradle-plugin/gradle.properties b/modules/openapi-generator-gradle-plugin/gradle.properties index 56e187700a2..d9177251532 100644 --- a/modules/openapi-generator-gradle-plugin/gradle.properties +++ b/modules/openapi-generator-gradle-plugin/gradle.properties @@ -1,5 +1,5 @@ # RELEASE_VERSION -openApiGeneratorVersion=4.1.0-SNAPSHOT +openApiGeneratorVersion=4.1.0 # /RELEASE_VERSION # BEGIN placeholders diff --git a/modules/openapi-generator-gradle-plugin/pom.xml b/modules/openapi-generator-gradle-plugin/pom.xml index 9200f120a3b..f380f5dec07 100644 --- a/modules/openapi-generator-gradle-plugin/pom.xml +++ b/modules/openapi-generator-gradle-plugin/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 4.1.0-SNAPSHOT + 4.1.0 ../.. diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md b/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md index 178b02089a2..33dc2591229 100644 --- a/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md +++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md @@ -17,5 +17,5 @@ gradle generateGoWithInvalidSpec The samples can be tested against other versions of the plugin using the `openApiGeneratorVersion` property. For example: ```bash -gradle -PopenApiGeneratorVersion=4.0.3 openApiValidate +gradle -PopenApiGeneratorVersion=4.1.0 openApiValidate ``` diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties index 00abde066a2..149e1997c3d 100644 --- a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties +++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties @@ -1,3 +1,3 @@ # RELEASE_VERSION -openApiGeneratorVersion=4.0.3 +openApiGeneratorVersion=4.1.0 # /RELEASE_VERSION diff --git a/modules/openapi-generator-maven-plugin/README.md b/modules/openapi-generator-maven-plugin/README.md index 20015bddf01..2161502a97b 100644 --- a/modules/openapi-generator-maven-plugin/README.md +++ b/modules/openapi-generator-maven-plugin/README.md @@ -12,7 +12,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase) org.openapitools openapi-generator-maven-plugin - 4.0.3 + 4.1.0 diff --git a/modules/openapi-generator-maven-plugin/examples/java-client.xml b/modules/openapi-generator-maven-plugin/examples/java-client.xml index e8f0bc88d6b..6c58a46213f 100644 --- a/modules/openapi-generator-maven-plugin/examples/java-client.xml +++ b/modules/openapi-generator-maven-plugin/examples/java-client.xml @@ -13,7 +13,7 @@ org.openapitools openapi-generator-maven-plugin - 4.0.3 + 4.1.0 @@ -88,6 +88,13 @@ ${jersey-version} + + + com.google.code.findbugs + jsr305 + 3.0.2 + + com.fasterxml.jackson.jaxrs diff --git a/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml b/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml index d7dcdbd7dfa..c128373f444 100644 --- a/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml +++ b/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml @@ -19,7 +19,7 @@ org.openapitools openapi-generator-maven-plugin - 4.0.3 + 4.1.0 @@ -101,6 +101,13 @@ ${jersey-version} + + + com.google.code.findbugs + jsr305 + 3.0.2 + + com.fasterxml.jackson.jaxrs diff --git a/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml b/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml index 8ea704877f8..95dc5c71679 100644 --- a/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml +++ b/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml @@ -13,7 +13,7 @@ org.openapitools openapi-generator-maven-plugin - 4.0.3 + 4.1.0 diff --git a/modules/openapi-generator-maven-plugin/examples/non-java.xml b/modules/openapi-generator-maven-plugin/examples/non-java.xml index ccace5a9933..df0297f8149 100644 --- a/modules/openapi-generator-maven-plugin/examples/non-java.xml +++ b/modules/openapi-generator-maven-plugin/examples/non-java.xml @@ -13,7 +13,7 @@ org.openapitools openapi-generator-maven-plugin - 4.0.3 + 4.1.0 diff --git a/modules/openapi-generator-maven-plugin/pom.xml b/modules/openapi-generator-maven-plugin/pom.xml index 99756e916e8..c07e74574d0 100644 --- a/modules/openapi-generator-maven-plugin/pom.xml +++ b/modules/openapi-generator-maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.openapitools openapi-generator-project - 4.1.0-SNAPSHOT + 4.1.0 ../.. diff --git a/modules/openapi-generator-online/pom.xml b/modules/openapi-generator-online/pom.xml index 428799dd261..7d503422b91 100644 --- a/modules/openapi-generator-online/pom.xml +++ b/modules/openapi-generator-online/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 4.1.0-SNAPSHOT + 4.1.0 ../.. diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index 417e71b46c2..d04857c4b51 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 4.1.0-SNAPSHOT + 4.1.0 ../.. diff --git a/pom.xml b/pom.xml index cf950e43c45..5bc866f4d3a 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ pom openapi-generator-project - 4.1.0-SNAPSHOT + 4.1.0 https://github.com/openapitools/openapi-generator diff --git a/samples/meta-codegen/lib/pom.xml b/samples/meta-codegen/lib/pom.xml index a8b81bb1118..9885a55a759 100644 --- a/samples/meta-codegen/lib/pom.xml +++ b/samples/meta-codegen/lib/pom.xml @@ -121,7 +121,7 @@ UTF-8 - 4.1.0-SNAPSHOT + 4.1.0 1.0.0 4.8.1 From 5956569e7a0d423521168f894bd1ac7b56ad35f1 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 10 Aug 2019 09:41:08 +0800 Subject: [PATCH 71/75] Prepare 4.1.1-SNAPSHOT (#3603) * update pom * update samples * update pom --- README.md | 5 +++-- modules/openapi-generator-cli/pom.xml | 2 +- modules/openapi-generator-core/pom.xml | 2 +- modules/openapi-generator-gradle-plugin/gradle.properties | 2 +- modules/openapi-generator-gradle-plugin/pom.xml | 2 +- .../openapi-generator-maven-plugin/examples/java-client.xml | 2 +- .../examples/multi-module/java-client/pom.xml | 2 +- modules/openapi-generator-maven-plugin/pom.xml | 2 +- modules/openapi-generator-online/pom.xml | 2 +- modules/openapi-generator/pom.xml | 2 +- pom.xml | 2 +- samples/client/petstore/R/.openapi-generator/VERSION | 2 +- samples/client/petstore/apex/.openapi-generator/VERSION | 2 +- .../csharp-netcore/OpenAPIClient/.openapi-generator/VERSION | 2 +- .../OpenAPIClientCore/.openapi-generator/VERSION | 2 +- .../petstore/csharp/OpenAPIClient/.openapi-generator/VERSION | 2 +- samples/client/petstore/elixir/.openapi-generator/VERSION | 2 +- .../go/go-petstore-withXml/.openapi-generator/VERSION | 2 +- .../petstore/go/go-petstore/.openapi-generator/VERSION | 2 +- samples/client/petstore/groovy/.openapi-generator/VERSION | 2 +- .../petstore/haskell-http-client/.openapi-generator/VERSION | 2 +- .../client/petstore/java/feign/.openapi-generator/VERSION | 2 +- .../client/petstore/java/feign10x/.openapi-generator/VERSION | 2 +- .../java/google-api-client/.openapi-generator/VERSION | 2 +- .../client/petstore/java/jersey1/.openapi-generator/VERSION | 2 +- .../petstore/java/jersey2-java6/.openapi-generator/VERSION | 2 +- .../petstore/java/jersey2-java8/.openapi-generator/VERSION | 2 +- .../client/petstore/java/jersey2/.openapi-generator/VERSION | 2 +- .../client/petstore/java/native/.openapi-generator/VERSION | 2 +- .../okhttp-gson-parcelableModel/.openapi-generator/VERSION | 2 +- .../petstore/java/okhttp-gson/.openapi-generator/VERSION | 2 +- .../petstore/java/rest-assured/.openapi-generator/VERSION | 2 +- .../client/petstore/java/resteasy/.openapi-generator/VERSION | 2 +- .../java/resttemplate-withXml/.openapi-generator/VERSION | 2 +- .../petstore/java/resttemplate/.openapi-generator/VERSION | 2 +- .../client/petstore/java/retrofit/.openapi-generator/VERSION | 2 +- .../java/retrofit2-play24/.openapi-generator/VERSION | 2 +- .../java/retrofit2-play25/.openapi-generator/VERSION | 2 +- .../java/retrofit2-play26/.openapi-generator/VERSION | 2 +- .../petstore/java/retrofit2/.openapi-generator/VERSION | 2 +- .../petstore/java/retrofit2rx/.openapi-generator/VERSION | 2 +- .../petstore/java/retrofit2rx2/.openapi-generator/VERSION | 2 +- .../client/petstore/java/vertx/.openapi-generator/VERSION | 2 +- .../petstore/java/webclient/.openapi-generator/VERSION | 2 +- .../petstore/javascript-es6/.openapi-generator/VERSION | 2 +- .../javascript-promise-es6/.openapi-generator/VERSION | 2 +- .../petstore/javascript-promise/.openapi-generator/VERSION | 2 +- samples/client/petstore/javascript-promise/src/ApiClient.js | 2 +- .../petstore/javascript-promise/src/api/AnotherFakeApi.js | 2 +- .../client/petstore/javascript-promise/src/api/FakeApi.js | 2 +- .../javascript-promise/src/api/FakeClassnameTags123Api.js | 2 +- samples/client/petstore/javascript-promise/src/api/PetApi.js | 2 +- .../client/petstore/javascript-promise/src/api/StoreApi.js | 2 +- .../client/petstore/javascript-promise/src/api/UserApi.js | 2 +- samples/client/petstore/javascript-promise/src/index.js | 2 +- .../src/model/AdditionalPropertiesAnyType.js | 2 +- .../src/model/AdditionalPropertiesArray.js | 2 +- .../src/model/AdditionalPropertiesBoolean.js | 2 +- .../src/model/AdditionalPropertiesClass.js | 2 +- .../src/model/AdditionalPropertiesInteger.js | 2 +- .../src/model/AdditionalPropertiesNumber.js | 2 +- .../src/model/AdditionalPropertiesObject.js | 2 +- .../src/model/AdditionalPropertiesString.js | 2 +- .../client/petstore/javascript-promise/src/model/Animal.js | 2 +- .../petstore/javascript-promise/src/model/ApiResponse.js | 2 +- .../javascript-promise/src/model/ArrayOfArrayOfNumberOnly.js | 2 +- .../javascript-promise/src/model/ArrayOfNumberOnly.js | 2 +- .../petstore/javascript-promise/src/model/ArrayTest.js | 2 +- .../petstore/javascript-promise/src/model/Capitalization.js | 2 +- samples/client/petstore/javascript-promise/src/model/Cat.js | 2 +- .../client/petstore/javascript-promise/src/model/CatAllOf.js | 2 +- .../client/petstore/javascript-promise/src/model/Category.js | 2 +- .../petstore/javascript-promise/src/model/ClassModel.js | 2 +- .../client/petstore/javascript-promise/src/model/Client.js | 2 +- samples/client/petstore/javascript-promise/src/model/Dog.js | 2 +- .../client/petstore/javascript-promise/src/model/DogAllOf.js | 2 +- .../petstore/javascript-promise/src/model/EnumArrays.js | 2 +- .../petstore/javascript-promise/src/model/EnumClass.js | 2 +- .../client/petstore/javascript-promise/src/model/EnumTest.js | 2 +- samples/client/petstore/javascript-promise/src/model/File.js | 2 +- .../javascript-promise/src/model/FileSchemaTestClass.js | 2 +- .../petstore/javascript-promise/src/model/FormatTest.js | 2 +- .../petstore/javascript-promise/src/model/HasOnlyReadOnly.js | 2 +- samples/client/petstore/javascript-promise/src/model/List.js | 2 +- .../client/petstore/javascript-promise/src/model/MapTest.js | 2 +- .../src/model/MixedPropertiesAndAdditionalPropertiesClass.js | 2 +- .../javascript-promise/src/model/Model200Response.js | 2 +- .../petstore/javascript-promise/src/model/ModelReturn.js | 2 +- samples/client/petstore/javascript-promise/src/model/Name.js | 2 +- .../petstore/javascript-promise/src/model/NumberOnly.js | 2 +- .../client/petstore/javascript-promise/src/model/Order.js | 2 +- .../petstore/javascript-promise/src/model/OuterComposite.js | 2 +- .../petstore/javascript-promise/src/model/OuterEnum.js | 2 +- samples/client/petstore/javascript-promise/src/model/Pet.js | 2 +- .../petstore/javascript-promise/src/model/ReadOnlyFirst.js | 2 +- .../javascript-promise/src/model/SpecialModelName.js | 2 +- samples/client/petstore/javascript-promise/src/model/Tag.js | 2 +- .../javascript-promise/src/model/TypeHolderDefault.js | 2 +- .../javascript-promise/src/model/TypeHolderExample.js | 2 +- samples/client/petstore/javascript-promise/src/model/User.js | 2 +- .../client/petstore/javascript-promise/src/model/XmlItem.js | 2 +- .../client/petstore/javascript/.openapi-generator/VERSION | 2 +- samples/client/petstore/javascript/src/ApiClient.js | 2 +- samples/client/petstore/javascript/src/api/AnotherFakeApi.js | 2 +- samples/client/petstore/javascript/src/api/FakeApi.js | 2 +- .../petstore/javascript/src/api/FakeClassnameTags123Api.js | 2 +- samples/client/petstore/javascript/src/api/PetApi.js | 2 +- samples/client/petstore/javascript/src/api/StoreApi.js | 2 +- samples/client/petstore/javascript/src/api/UserApi.js | 2 +- samples/client/petstore/javascript/src/index.js | 2 +- .../javascript/src/model/AdditionalPropertiesAnyType.js | 2 +- .../javascript/src/model/AdditionalPropertiesArray.js | 2 +- .../javascript/src/model/AdditionalPropertiesBoolean.js | 2 +- .../javascript/src/model/AdditionalPropertiesClass.js | 2 +- .../javascript/src/model/AdditionalPropertiesInteger.js | 2 +- .../javascript/src/model/AdditionalPropertiesNumber.js | 2 +- .../javascript/src/model/AdditionalPropertiesObject.js | 2 +- .../javascript/src/model/AdditionalPropertiesString.js | 2 +- samples/client/petstore/javascript/src/model/Animal.js | 2 +- samples/client/petstore/javascript/src/model/ApiResponse.js | 2 +- .../javascript/src/model/ArrayOfArrayOfNumberOnly.js | 2 +- .../petstore/javascript/src/model/ArrayOfNumberOnly.js | 2 +- samples/client/petstore/javascript/src/model/ArrayTest.js | 2 +- .../client/petstore/javascript/src/model/Capitalization.js | 2 +- samples/client/petstore/javascript/src/model/Cat.js | 2 +- samples/client/petstore/javascript/src/model/CatAllOf.js | 2 +- samples/client/petstore/javascript/src/model/Category.js | 2 +- samples/client/petstore/javascript/src/model/ClassModel.js | 2 +- samples/client/petstore/javascript/src/model/Client.js | 2 +- samples/client/petstore/javascript/src/model/Dog.js | 2 +- samples/client/petstore/javascript/src/model/DogAllOf.js | 2 +- samples/client/petstore/javascript/src/model/EnumArrays.js | 2 +- samples/client/petstore/javascript/src/model/EnumClass.js | 2 +- samples/client/petstore/javascript/src/model/EnumTest.js | 2 +- samples/client/petstore/javascript/src/model/File.js | 2 +- .../petstore/javascript/src/model/FileSchemaTestClass.js | 2 +- samples/client/petstore/javascript/src/model/FormatTest.js | 2 +- .../client/petstore/javascript/src/model/HasOnlyReadOnly.js | 2 +- samples/client/petstore/javascript/src/model/List.js | 2 +- samples/client/petstore/javascript/src/model/MapTest.js | 2 +- .../src/model/MixedPropertiesAndAdditionalPropertiesClass.js | 2 +- .../client/petstore/javascript/src/model/Model200Response.js | 2 +- samples/client/petstore/javascript/src/model/ModelReturn.js | 2 +- samples/client/petstore/javascript/src/model/Name.js | 2 +- samples/client/petstore/javascript/src/model/NumberOnly.js | 2 +- samples/client/petstore/javascript/src/model/Order.js | 2 +- .../client/petstore/javascript/src/model/OuterComposite.js | 2 +- samples/client/petstore/javascript/src/model/OuterEnum.js | 2 +- samples/client/petstore/javascript/src/model/Pet.js | 2 +- .../client/petstore/javascript/src/model/ReadOnlyFirst.js | 2 +- .../client/petstore/javascript/src/model/SpecialModelName.js | 2 +- samples/client/petstore/javascript/src/model/Tag.js | 2 +- .../petstore/javascript/src/model/TypeHolderDefault.js | 2 +- .../petstore/javascript/src/model/TypeHolderExample.js | 2 +- samples/client/petstore/javascript/src/model/User.js | 2 +- samples/client/petstore/javascript/src/model/XmlItem.js | 2 +- .../client/petstore/kotlin-string/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-threetenbp/.openapi-generator/VERSION | 2 +- samples/client/petstore/kotlin/.openapi-generator/VERSION | 2 +- samples/client/petstore/perl/.openapi-generator/VERSION | 2 +- .../php/OpenAPIClient-php/.openapi-generator/VERSION | 2 +- .../php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php | 2 +- .../OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Api/UserApi.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/ApiException.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Configuration.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/HeaderSelector.php | 2 +- .../lib/Model/AdditionalPropertiesAnyType.php | 2 +- .../lib/Model/AdditionalPropertiesArray.php | 2 +- .../lib/Model/AdditionalPropertiesBoolean.php | 2 +- .../lib/Model/AdditionalPropertiesClass.php | 2 +- .../lib/Model/AdditionalPropertiesInteger.php | 2 +- .../lib/Model/AdditionalPropertiesNumber.php | 2 +- .../lib/Model/AdditionalPropertiesObject.php | 2 +- .../lib/Model/AdditionalPropertiesString.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Animal.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php | 2 +- .../OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php | 2 +- .../php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php | 2 +- .../php/OpenAPIClient-php/lib/Model/Capitalization.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Category.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Client.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/File.php | 2 +- .../php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php | 2 +- .../php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/MapTest.php | 2 +- .../Model/MixedPropertiesAndAdditionalPropertiesClass.php | 2 +- .../php/OpenAPIClient-php/lib/Model/Model200Response.php | 2 +- .../php/OpenAPIClient-php/lib/Model/ModelInterface.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ModelList.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Name.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Order.php | 2 +- .../php/OpenAPIClient-php/lib/Model/OuterComposite.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php | 2 +- .../php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php | 2 +- .../php/OpenAPIClient-php/lib/Model/SpecialModelName.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php | 2 +- .../php/OpenAPIClient-php/lib/Model/TypeHolderDefault.php | 2 +- .../php/OpenAPIClient-php/lib/Model/TypeHolderExample.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/User.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/XmlItem.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php | 2 +- .../php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php | 2 +- .../test/Api/FakeClassnameTags123ApiTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php | 2 +- .../test/Model/AdditionalPropertiesAnyTypeTest.php | 2 +- .../test/Model/AdditionalPropertiesArrayTest.php | 2 +- .../test/Model/AdditionalPropertiesBooleanTest.php | 2 +- .../test/Model/AdditionalPropertiesClassTest.php | 2 +- .../test/Model/AdditionalPropertiesIntegerTest.php | 2 +- .../test/Model/AdditionalPropertiesNumberTest.php | 2 +- .../test/Model/AdditionalPropertiesObjectTest.php | 2 +- .../test/Model/AdditionalPropertiesStringTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ApiResponseTest.php | 2 +- .../test/Model/ArrayOfArrayOfNumberOnlyTest.php | 2 +- .../OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ArrayTestTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/CapitalizationTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/CatAllOfTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/CatTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/CategoryTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ClassModelTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/ClientTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/DogAllOfTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/DogTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/EnumArraysTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/EnumClassTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/EnumTestTest.php | 2 +- .../OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/FileTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/FormatTestTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/MapTestTest.php | 2 +- .../MixedPropertiesAndAdditionalPropertiesClassTest.php | 2 +- .../OpenAPIClient-php/test/Model/Model200ResponseTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ModelListTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ModelReturnTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/NameTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/NumberOnlyTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/OrderTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/OuterCompositeTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/OuterEnumTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/PetTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php | 2 +- .../OpenAPIClient-php/test/Model/SpecialModelNameTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/TagTest.php | 2 +- .../OpenAPIClient-php/test/Model/TypeHolderDefaultTest.php | 2 +- .../OpenAPIClient-php/test/Model/TypeHolderExampleTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/UserTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/XmlItemTest.php | 2 +- .../petstore/python-asyncio/.openapi-generator/VERSION | 2 +- .../petstore/python-tornado/.openapi-generator/VERSION | 2 +- samples/client/petstore/python/.openapi-generator/VERSION | 2 +- .../petstore/spring-cloud-async/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../client/petstore/spring-cloud/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../client/petstore/spring-stubs/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../typescript-angular-v2/default/.openapi-generator/VERSION | 2 +- .../typescript-angular-v2/npm/.openapi-generator/VERSION | 2 +- .../with-interfaces/.openapi-generator/VERSION | 2 +- .../typescript-angular-v4.3/npm/.openapi-generator/VERSION | 2 +- .../typescript-angular-v4/npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../petstore/typescript-angularjs/.openapi-generator/VERSION | 2 +- .../typescript-aurelia/default/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/es6-target/.openapi-generator/VERSION | 2 +- .../builds/with-complex-headers/.openapi-generator/VERSION | 2 +- .../builds/with-interfaces/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../builds/with-npm-version/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/es6-target/.openapi-generator/VERSION | 2 +- .../builds/multiple-parameters/.openapi-generator/VERSION | 2 +- .../builds/with-interfaces/.openapi-generator/VERSION | 2 +- .../builds/with-npm-version/.openapi-generator/VERSION | 2 +- .../petstore/typescript-inversify/.openapi-generator/VERSION | 2 +- .../typescript-jquery/default/.openapi-generator/VERSION | 2 +- .../typescript-jquery/npm/.openapi-generator/VERSION | 2 +- .../typescript-node/default/.openapi-generator/VERSION | 2 +- .../petstore/typescript-node/npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/es6-target/.openapi-generator/VERSION | 2 +- .../builds/with-interfaces/.openapi-generator/VERSION | 2 +- .../builds/with-npm-version/.openapi-generator/VERSION | 2 +- samples/meta-codegen/lib/pom.xml | 2 +- samples/meta-codegen/usage/.openapi-generator/VERSION | 2 +- .../php/OpenAPIClient-php/.openapi-generator/VERSION | 2 +- .../php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php | 2 +- .../OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Api/UserApi.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/ApiException.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Configuration.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/HeaderSelector.php | 2 +- .../lib/Model/AdditionalPropertiesClass.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Animal.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php | 2 +- .../OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php | 2 +- .../php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php | 2 +- .../php/OpenAPIClient-php/lib/Model/Capitalization.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Category.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Client.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/File.php | 2 +- .../php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php | 2 +- .../php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php | 2 +- .../php/OpenAPIClient-php/lib/Model/HealthCheckResult.php | 2 +- .../php/OpenAPIClient-php/lib/Model/InlineObject.php | 2 +- .../php/OpenAPIClient-php/lib/Model/InlineObject1.php | 2 +- .../php/OpenAPIClient-php/lib/Model/InlineObject2.php | 2 +- .../php/OpenAPIClient-php/lib/Model/InlineObject3.php | 2 +- .../php/OpenAPIClient-php/lib/Model/InlineObject4.php | 2 +- .../php/OpenAPIClient-php/lib/Model/InlineObject5.php | 2 +- .../OpenAPIClient-php/lib/Model/InlineResponseDefault.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/MapTest.php | 2 +- .../Model/MixedPropertiesAndAdditionalPropertiesClass.php | 2 +- .../php/OpenAPIClient-php/lib/Model/Model200Response.php | 2 +- .../php/OpenAPIClient-php/lib/Model/ModelInterface.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ModelList.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Name.php | 2 +- .../php/OpenAPIClient-php/lib/Model/NullableClass.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Order.php | 2 +- .../php/OpenAPIClient-php/lib/Model/OuterComposite.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php | 2 +- .../OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php | 2 +- .../php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php | 2 +- .../lib/Model/OuterEnumIntegerDefaultValue.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php | 2 +- .../php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php | 2 +- .../php/OpenAPIClient-php/lib/Model/SpecialModelName.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/User.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php | 2 +- .../php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php | 2 +- .../php/OpenAPIClient-php/test/Api/DefaultApiTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php | 2 +- .../test/Api/FakeClassnameTags123ApiTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php | 2 +- .../test/Model/AdditionalPropertiesClassTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ApiResponseTest.php | 2 +- .../test/Model/ArrayOfArrayOfNumberOnlyTest.php | 2 +- .../OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ArrayTestTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/CapitalizationTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/CatAllOfTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/CatTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/CategoryTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ClassModelTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/ClientTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/DogAllOfTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/DogTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/EnumArraysTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/EnumClassTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/EnumTestTest.php | 2 +- .../OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/FileTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/FooTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/FormatTestTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php | 2 +- .../OpenAPIClient-php/test/Model/HealthCheckResultTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/InlineObject1Test.php | 2 +- .../php/OpenAPIClient-php/test/Model/InlineObject2Test.php | 2 +- .../php/OpenAPIClient-php/test/Model/InlineObject3Test.php | 2 +- .../php/OpenAPIClient-php/test/Model/InlineObject4Test.php | 2 +- .../php/OpenAPIClient-php/test/Model/InlineObject5Test.php | 2 +- .../php/OpenAPIClient-php/test/Model/InlineObjectTest.php | 2 +- .../test/Model/InlineResponseDefaultTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/MapTestTest.php | 2 +- .../MixedPropertiesAndAdditionalPropertiesClassTest.php | 2 +- .../OpenAPIClient-php/test/Model/Model200ResponseTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ModelListTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ModelReturnTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/NameTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/NullableClassTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/NumberOnlyTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/OrderTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/OuterCompositeTest.php | 2 +- .../test/Model/OuterEnumDefaultValueTest.php | 2 +- .../test/Model/OuterEnumIntegerDefaultValueTest.php | 2 +- .../OpenAPIClient-php/test/Model/OuterEnumIntegerTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/OuterEnumTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/PetTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php | 2 +- .../OpenAPIClient-php/test/Model/SpecialModelNameTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/TagTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/UserTest.php | 2 +- .../client/petstore/python/.openapi-generator/VERSION | 2 +- .../client/petstore/ruby-faraday/.openapi-generator/VERSION | 2 +- .../openapi3/client/petstore/ruby-faraday/lib/petstore.rb | 2 +- .../ruby-faraday/lib/petstore/api/another_fake_api.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/api/default_api.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/api/fake_api.rb | 2 +- .../lib/petstore/api/fake_classname_tags123_api.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/api/store_api.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/api/user_api.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/api_client.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/api_error.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/configuration.rb | 2 +- .../lib/petstore/models/additional_properties_class.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/animal.rb | 2 +- .../ruby-faraday/lib/petstore/models/api_response.rb | 2 +- .../lib/petstore/models/array_of_array_of_number_only.rb | 2 +- .../ruby-faraday/lib/petstore/models/array_of_number_only.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/array_test.rb | 2 +- .../ruby-faraday/lib/petstore/models/capitalization.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/cat.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/category.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/class_model.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/client.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/dog.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/enum_class.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/enum_test.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/file.rb | 2 +- .../lib/petstore/models/file_schema_test_class.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/foo.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/format_test.rb | 2 +- .../ruby-faraday/lib/petstore/models/has_only_read_only.rb | 2 +- .../ruby-faraday/lib/petstore/models/health_check_result.rb | 2 +- .../ruby-faraday/lib/petstore/models/inline_object.rb | 2 +- .../ruby-faraday/lib/petstore/models/inline_object1.rb | 2 +- .../ruby-faraday/lib/petstore/models/inline_object2.rb | 2 +- .../ruby-faraday/lib/petstore/models/inline_object3.rb | 2 +- .../ruby-faraday/lib/petstore/models/inline_object4.rb | 2 +- .../ruby-faraday/lib/petstore/models/inline_object5.rb | 2 +- .../lib/petstore/models/inline_response_default.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/list.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/map_test.rb | 2 +- .../mixed_properties_and_additional_properties_class.rb | 2 +- .../ruby-faraday/lib/petstore/models/model200_response.rb | 2 +- .../ruby-faraday/lib/petstore/models/model_return.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/name.rb | 2 +- .../ruby-faraday/lib/petstore/models/nullable_class.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/number_only.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/order.rb | 2 +- .../ruby-faraday/lib/petstore/models/outer_composite.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/outer_enum.rb | 2 +- .../lib/petstore/models/outer_enum_default_value.rb | 2 +- .../ruby-faraday/lib/petstore/models/outer_enum_integer.rb | 2 +- .../lib/petstore/models/outer_enum_integer_default_value.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/pet.rb | 2 +- .../ruby-faraday/lib/petstore/models/read_only_first.rb | 2 +- .../ruby-faraday/lib/petstore/models/special_model_name.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/tag.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/user.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/version.rb | 2 +- .../openapi3/client/petstore/ruby-faraday/petstore.gemspec | 2 +- .../petstore/ruby-faraday/spec/api/another_fake_api_spec.rb | 2 +- .../petstore/ruby-faraday/spec/api/default_api_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/api/fake_api_spec.rb | 2 +- .../ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/api/pet_api_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/api/store_api_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/api/user_api_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/api_client_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/configuration_spec.rb | 2 +- .../spec/models/additional_properties_class_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/animal_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/api_response_spec.rb | 2 +- .../spec/models/array_of_array_of_number_only_spec.rb | 2 +- .../ruby-faraday/spec/models/array_of_number_only_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/array_test_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/capitalization_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/cat_all_of_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/cat_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/category_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/class_model_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/client_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/dog_all_of_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/dog_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/enum_arrays_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/enum_class_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/enum_test_spec.rb | 2 +- .../ruby-faraday/spec/models/file_schema_test_class_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/file_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/foo_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/format_test_spec.rb | 2 +- .../ruby-faraday/spec/models/has_only_read_only_spec.rb | 2 +- .../ruby-faraday/spec/models/health_check_result_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/inline_object1_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/inline_object2_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/inline_object3_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/inline_object4_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/inline_object5_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/inline_object_spec.rb | 2 +- .../ruby-faraday/spec/models/inline_response_default_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/list_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/map_test_spec.rb | 2 +- .../mixed_properties_and_additional_properties_class_spec.rb | 2 +- .../ruby-faraday/spec/models/model200_response_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/model_return_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/name_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/nullable_class_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/number_only_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/order_spec.rb | 2 +- .../ruby-faraday/spec/models/outer_composite_spec.rb | 2 +- .../spec/models/outer_enum_default_value_spec.rb | 2 +- .../spec/models/outer_enum_integer_default_value_spec.rb | 2 +- .../ruby-faraday/spec/models/outer_enum_integer_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/outer_enum_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/pet_spec.rb | 2 +- .../ruby-faraday/spec/models/read_only_first_spec.rb | 2 +- .../ruby-faraday/spec/models/special_model_name_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/tag_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/user_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/spec_helper.rb | 2 +- .../openapi3/client/petstore/ruby/.openapi-generator/VERSION | 2 +- samples/openapi3/client/petstore/ruby/lib/petstore.rb | 2 +- .../petstore/ruby/lib/petstore/api/another_fake_api.rb | 2 +- .../client/petstore/ruby/lib/petstore/api/default_api.rb | 2 +- .../client/petstore/ruby/lib/petstore/api/fake_api.rb | 2 +- .../ruby/lib/petstore/api/fake_classname_tags123_api.rb | 2 +- .../client/petstore/ruby/lib/petstore/api/pet_api.rb | 2 +- .../client/petstore/ruby/lib/petstore/api/store_api.rb | 2 +- .../client/petstore/ruby/lib/petstore/api/user_api.rb | 2 +- .../openapi3/client/petstore/ruby/lib/petstore/api_client.rb | 2 +- .../openapi3/client/petstore/ruby/lib/petstore/api_error.rb | 2 +- .../client/petstore/ruby/lib/petstore/configuration.rb | 2 +- .../ruby/lib/petstore/models/additional_properties_class.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/animal.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/api_response.rb | 2 +- .../lib/petstore/models/array_of_array_of_number_only.rb | 2 +- .../ruby/lib/petstore/models/array_of_number_only.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/array_test.rb | 2 +- .../petstore/ruby/lib/petstore/models/capitalization.rb | 2 +- .../openapi3/client/petstore/ruby/lib/petstore/models/cat.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/cat_all_of.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/category.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/class_model.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/client.rb | 2 +- .../openapi3/client/petstore/ruby/lib/petstore/models/dog.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/dog_all_of.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/enum_arrays.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/enum_class.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/enum_test.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/file.rb | 2 +- .../ruby/lib/petstore/models/file_schema_test_class.rb | 2 +- .../openapi3/client/petstore/ruby/lib/petstore/models/foo.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/format_test.rb | 2 +- .../petstore/ruby/lib/petstore/models/has_only_read_only.rb | 2 +- .../petstore/ruby/lib/petstore/models/health_check_result.rb | 2 +- .../petstore/ruby/lib/petstore/models/inline_object.rb | 2 +- .../petstore/ruby/lib/petstore/models/inline_object1.rb | 2 +- .../petstore/ruby/lib/petstore/models/inline_object2.rb | 2 +- .../petstore/ruby/lib/petstore/models/inline_object3.rb | 2 +- .../petstore/ruby/lib/petstore/models/inline_object4.rb | 2 +- .../petstore/ruby/lib/petstore/models/inline_object5.rb | 2 +- .../ruby/lib/petstore/models/inline_response_default.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/list.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/map_test.rb | 2 +- .../mixed_properties_and_additional_properties_class.rb | 2 +- .../petstore/ruby/lib/petstore/models/model200_response.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/model_return.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/name.rb | 2 +- .../petstore/ruby/lib/petstore/models/nullable_class.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/number_only.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/order.rb | 2 +- .../petstore/ruby/lib/petstore/models/outer_composite.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/outer_enum.rb | 2 +- .../ruby/lib/petstore/models/outer_enum_default_value.rb | 2 +- .../petstore/ruby/lib/petstore/models/outer_enum_integer.rb | 2 +- .../lib/petstore/models/outer_enum_integer_default_value.rb | 2 +- .../openapi3/client/petstore/ruby/lib/petstore/models/pet.rb | 2 +- .../petstore/ruby/lib/petstore/models/read_only_first.rb | 2 +- .../petstore/ruby/lib/petstore/models/special_model_name.rb | 2 +- .../openapi3/client/petstore/ruby/lib/petstore/models/tag.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/user.rb | 2 +- .../openapi3/client/petstore/ruby/lib/petstore/version.rb | 2 +- samples/openapi3/client/petstore/ruby/petstore.gemspec | 2 +- .../client/petstore/ruby/spec/api/another_fake_api_spec.rb | 2 +- .../client/petstore/ruby/spec/api/default_api_spec.rb | 2 +- .../openapi3/client/petstore/ruby/spec/api/fake_api_spec.rb | 2 +- .../ruby/spec/api/fake_classname_tags123_api_spec.rb | 2 +- .../openapi3/client/petstore/ruby/spec/api/pet_api_spec.rb | 2 +- .../openapi3/client/petstore/ruby/spec/api/store_api_spec.rb | 2 +- .../openapi3/client/petstore/ruby/spec/api/user_api_spec.rb | 2 +- .../openapi3/client/petstore/ruby/spec/api_client_spec.rb | 2 +- .../openapi3/client/petstore/ruby/spec/configuration_spec.rb | 2 +- .../ruby/spec/models/additional_properties_class_spec.rb | 2 +- .../openapi3/client/petstore/ruby/spec/models/animal_spec.rb | 2 +- .../client/petstore/ruby/spec/models/api_response_spec.rb | 2 +- .../ruby/spec/models/array_of_array_of_number_only_spec.rb | 2 +- .../petstore/ruby/spec/models/array_of_number_only_spec.rb | 2 +- .../client/petstore/ruby/spec/models/array_test_spec.rb | 2 +- .../client/petstore/ruby/spec/models/capitalization_spec.rb | 2 +- .../client/petstore/ruby/spec/models/cat_all_of_spec.rb | 2 +- .../openapi3/client/petstore/ruby/spec/models/cat_spec.rb | 2 +- .../client/petstore/ruby/spec/models/category_spec.rb | 2 +- .../client/petstore/ruby/spec/models/class_model_spec.rb | 2 +- .../openapi3/client/petstore/ruby/spec/models/client_spec.rb | 2 +- .../client/petstore/ruby/spec/models/dog_all_of_spec.rb | 2 +- .../openapi3/client/petstore/ruby/spec/models/dog_spec.rb | 2 +- .../client/petstore/ruby/spec/models/enum_arrays_spec.rb | 2 +- .../client/petstore/ruby/spec/models/enum_class_spec.rb | 2 +- .../client/petstore/ruby/spec/models/enum_test_spec.rb | 2 +- .../petstore/ruby/spec/models/file_schema_test_class_spec.rb | 2 +- .../openapi3/client/petstore/ruby/spec/models/file_spec.rb | 2 +- .../openapi3/client/petstore/ruby/spec/models/foo_spec.rb | 2 +- .../client/petstore/ruby/spec/models/format_test_spec.rb | 2 +- .../petstore/ruby/spec/models/has_only_read_only_spec.rb | 2 +- .../petstore/ruby/spec/models/health_check_result_spec.rb | 2 +- .../client/petstore/ruby/spec/models/inline_object1_spec.rb | 2 +- .../client/petstore/ruby/spec/models/inline_object2_spec.rb | 2 +- .../client/petstore/ruby/spec/models/inline_object3_spec.rb | 2 +- .../client/petstore/ruby/spec/models/inline_object4_spec.rb | 2 +- .../client/petstore/ruby/spec/models/inline_object5_spec.rb | 2 +- .../client/petstore/ruby/spec/models/inline_object_spec.rb | 2 +- .../ruby/spec/models/inline_response_default_spec.rb | 2 +- .../openapi3/client/petstore/ruby/spec/models/list_spec.rb | 2 +- .../client/petstore/ruby/spec/models/map_test_spec.rb | 2 +- .../mixed_properties_and_additional_properties_class_spec.rb | 2 +- .../petstore/ruby/spec/models/model200_response_spec.rb | 2 +- .../client/petstore/ruby/spec/models/model_return_spec.rb | 2 +- .../openapi3/client/petstore/ruby/spec/models/name_spec.rb | 2 +- .../client/petstore/ruby/spec/models/nullable_class_spec.rb | 2 +- .../client/petstore/ruby/spec/models/number_only_spec.rb | 2 +- .../openapi3/client/petstore/ruby/spec/models/order_spec.rb | 2 +- .../client/petstore/ruby/spec/models/outer_composite_spec.rb | 2 +- .../ruby/spec/models/outer_enum_default_value_spec.rb | 2 +- .../spec/models/outer_enum_integer_default_value_spec.rb | 2 +- .../petstore/ruby/spec/models/outer_enum_integer_spec.rb | 2 +- .../client/petstore/ruby/spec/models/outer_enum_spec.rb | 2 +- .../openapi3/client/petstore/ruby/spec/models/pet_spec.rb | 2 +- .../client/petstore/ruby/spec/models/read_only_first_spec.rb | 2 +- .../petstore/ruby/spec/models/special_model_name_spec.rb | 2 +- .../openapi3/client/petstore/ruby/spec/models/tag_spec.rb | 2 +- .../openapi3/client/petstore/ruby/spec/models/user_spec.rb | 2 +- samples/openapi3/client/petstore/ruby/spec/spec_helper.rb | 2 +- samples/schema/petstore/mysql/.openapi-generator/VERSION | 2 +- .../petstore/go-gin-api-server/.openapi-generator/VERSION | 2 +- .../server/petstore/java-msf4j/.openapi-generator/VERSION | 2 +- .../jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION | 2 +- .../server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION | 2 +- .../jaxrs-cxf-non-spring-app/.openapi-generator/VERSION | 2 +- samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-datelib-j8/.openapi-generator/VERSION | 2 +- .../server/petstore/jaxrs-jersey/.openapi-generator/VERSION | 2 +- .../jaxrs-resteasy/default/.openapi-generator/VERSION | 2 +- .../jaxrs-resteasy/eap-java8/.openapi-generator/VERSION | 2 +- .../jaxrs-resteasy/eap-joda/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-spec-interface/.openapi-generator/VERSION | 2 +- .../server/petstore/jaxrs-spec/.openapi-generator/VERSION | 2 +- .../jaxrs/jersey1-useTags/.openapi-generator/VERSION | 2 +- .../server/petstore/jaxrs/jersey1/.openapi-generator/VERSION | 2 +- .../jaxrs/jersey2-useTags/.openapi-generator/VERSION | 2 +- .../server/petstore/jaxrs/jersey2/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-server/ktor/.openapi-generator/VERSION | 2 +- samples/server/petstore/kotlin-server/ktor/README.md | 2 +- .../kotlin-springboot-reactive/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-springboot/.openapi-generator/VERSION | 2 +- samples/server/petstore/php-lumen/.openapi-generator/VERSION | 2 +- .../php-silex/OpenAPIServer/.openapi-generator/VERSION | 2 +- samples/server/petstore/php-slim/.openapi-generator/VERSION | 2 +- .../php-symfony/SymfonyBundle-php/.openapi-generator/VERSION | 2 +- samples/server/petstore/php-ze-ph/.openapi-generator/VERSION | 2 +- .../output/multipart-v3/.openapi-generator/VERSION | 2 +- .../rust-server/output/openapi-v3/.openapi-generator/VERSION | 2 +- .../rust-server/output/ops-v3/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../output/rust-server-test/.openapi-generator/VERSION | 2 +- .../petstore/spring-mvc-j8-async/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../spring-mvc-j8-localdatetime/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../server/petstore/spring-mvc/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../springboot-beanvalidation/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../springboot-delegate-j8/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-delegate/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../springboot-implicitHeaders/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-reactive/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../springboot-useoptional/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-virtualan/.openapi-generator/VERSION | 2 +- .../java/org/openapitools/virtualan/api/AnotherFakeApi.java | 2 +- .../main/java/org/openapitools/virtualan/api/FakeApi.java | 2 +- .../org/openapitools/virtualan/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/virtualan/api/PetApi.java | 2 +- .../main/java/org/openapitools/virtualan/api/StoreApi.java | 2 +- .../main/java/org/openapitools/virtualan/api/UserApi.java | 2 +- .../server/petstore/springboot/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- 796 files changed, 798 insertions(+), 797 deletions(-) diff --git a/README.md b/README.md index 815236441e5..52f285a3678 100644 --- a/README.md +++ b/README.md @@ -101,8 +101,9 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20 OpenAPI Generator Version | Release Date | Notes ---------------------------- | ------------ | ----- 5.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.0.0-SNAPSHOT/)| 13.05.2020 | Major release with breaking changes (no fallback) -4.1.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.1.0-SNAPSHOT/)| 31.07.2019 | Minor release (breaking changes with fallbacks) -[4.1.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.1.0) (latest stable release) | 09.07.2019 | Patch release (bug fixes, minor enhancements, etc) +4.2.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.2.0-SNAPSHOT/)| 09.10.2019 | Minor release (breaking changes with fallbacks) +4.1.1 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.1.1-SNAPSHOT/)| 23.08.2019 | Patch release (bug fixes, enhancements) +[4.1.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.1.0) (latest stable release) | 09.08.2019 | Minor release (breaking changes with fallbacks) OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0 diff --git a/modules/openapi-generator-cli/pom.xml b/modules/openapi-generator-cli/pom.xml index eb0e05cb9db..380bfee8f3d 100644 --- a/modules/openapi-generator-cli/pom.xml +++ b/modules/openapi-generator-cli/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 4.1.0 + 4.1.1-SNAPSHOT ../.. diff --git a/modules/openapi-generator-core/pom.xml b/modules/openapi-generator-core/pom.xml index b4201d1cc86..930400f3b2c 100644 --- a/modules/openapi-generator-core/pom.xml +++ b/modules/openapi-generator-core/pom.xml @@ -6,7 +6,7 @@ openapi-generator-project org.openapitools - 4.1.0 + 4.1.1-SNAPSHOT ../.. diff --git a/modules/openapi-generator-gradle-plugin/gradle.properties b/modules/openapi-generator-gradle-plugin/gradle.properties index d9177251532..a4deb47d1ae 100644 --- a/modules/openapi-generator-gradle-plugin/gradle.properties +++ b/modules/openapi-generator-gradle-plugin/gradle.properties @@ -1,5 +1,5 @@ # RELEASE_VERSION -openApiGeneratorVersion=4.1.0 +openApiGeneratorVersion=4.1.1-SNAPSHOT # /RELEASE_VERSION # BEGIN placeholders diff --git a/modules/openapi-generator-gradle-plugin/pom.xml b/modules/openapi-generator-gradle-plugin/pom.xml index f380f5dec07..e2448112d5f 100644 --- a/modules/openapi-generator-gradle-plugin/pom.xml +++ b/modules/openapi-generator-gradle-plugin/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 4.1.0 + 4.1.1-SNAPSHOT ../.. diff --git a/modules/openapi-generator-maven-plugin/examples/java-client.xml b/modules/openapi-generator-maven-plugin/examples/java-client.xml index 6c58a46213f..f7f5df89de0 100644 --- a/modules/openapi-generator-maven-plugin/examples/java-client.xml +++ b/modules/openapi-generator-maven-plugin/examples/java-client.xml @@ -13,7 +13,7 @@ org.openapitools openapi-generator-maven-plugin - 4.1.0 + 4.1.1-SNAPSHOT diff --git a/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml b/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml index c128373f444..6652de2d265 100644 --- a/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml +++ b/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml @@ -19,7 +19,7 @@ org.openapitools openapi-generator-maven-plugin - 4.1.0 + 4.1.1-SNAPSHOT diff --git a/modules/openapi-generator-maven-plugin/pom.xml b/modules/openapi-generator-maven-plugin/pom.xml index c07e74574d0..9fc0a05b107 100644 --- a/modules/openapi-generator-maven-plugin/pom.xml +++ b/modules/openapi-generator-maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.openapitools openapi-generator-project - 4.1.0 + 4.1.1-SNAPSHOT ../.. diff --git a/modules/openapi-generator-online/pom.xml b/modules/openapi-generator-online/pom.xml index 7d503422b91..391574c24d7 100644 --- a/modules/openapi-generator-online/pom.xml +++ b/modules/openapi-generator-online/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 4.1.0 + 4.1.1-SNAPSHOT ../.. diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index d04857c4b51..e417dad64cd 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 4.1.0 + 4.1.1-SNAPSHOT ../.. diff --git a/pom.xml b/pom.xml index 5bc866f4d3a..95bc5ec7058 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ pom openapi-generator-project - 4.1.0 + 4.1.1-SNAPSHOT https://github.com/openapitools/openapi-generator diff --git a/samples/client/petstore/R/.openapi-generator/VERSION b/samples/client/petstore/R/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/R/.openapi-generator/VERSION +++ b/samples/client/petstore/R/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/apex/.openapi-generator/VERSION b/samples/client/petstore/apex/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/apex/.openapi-generator/VERSION +++ b/samples/client/petstore/apex/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/elixir/.openapi-generator/VERSION b/samples/client/petstore/elixir/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/elixir/.openapi-generator/VERSION +++ b/samples/client/petstore/elixir/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION b/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION +++ b/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION b/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/groovy/.openapi-generator/VERSION b/samples/client/petstore/groovy/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/groovy/.openapi-generator/VERSION +++ b/samples/client/petstore/groovy/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION b/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION +++ b/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/feign/.openapi-generator/VERSION b/samples/client/petstore/java/feign/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/java/feign/.openapi-generator/VERSION +++ b/samples/client/petstore/java/feign/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/feign10x/.openapi-generator/VERSION b/samples/client/petstore/java/feign10x/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/java/feign10x/.openapi-generator/VERSION +++ b/samples/client/petstore/java/feign10x/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION b/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION +++ b/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey1/.openapi-generator/VERSION b/samples/client/petstore/java/jersey1/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/java/jersey1/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey1/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java6/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2-java6/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/java/jersey2-java6/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey2-java6/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/java/jersey2/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey2/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/native/.openapi-generator/VERSION b/samples/client/petstore/java/native/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/java/native/.openapi-generator/VERSION +++ b/samples/client/petstore/java/native/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION b/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION +++ b/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/resteasy/.openapi-generator/VERSION b/samples/client/petstore/java/resteasy/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/java/resteasy/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resteasy/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION b/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/java/retrofit/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play24/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2-play24/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/java/retrofit2-play24/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2-play24/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play25/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2-play25/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/java/retrofit2-play25/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2-play25/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2rx/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/java/retrofit2rx/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2rx/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/vertx/.openapi-generator/VERSION b/samples/client/petstore/java/vertx/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/java/vertx/.openapi-generator/VERSION +++ b/samples/client/petstore/java/vertx/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/webclient/.openapi-generator/VERSION b/samples/client/petstore/java/webclient/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/java/webclient/.openapi-generator/VERSION +++ b/samples/client/petstore/java/webclient/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript-es6/.openapi-generator/VERSION b/samples/client/petstore/javascript-es6/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/javascript-es6/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-es6/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION b/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript-promise/.openapi-generator/VERSION b/samples/client/petstore/javascript-promise/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/javascript-promise/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-promise/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript-promise/src/ApiClient.js b/samples/client/petstore/javascript-promise/src/ApiClient.js index 8deee926549..1734d524fb0 100644 --- a/samples/client/petstore/javascript-promise/src/ApiClient.js +++ b/samples/client/petstore/javascript-promise/src/ApiClient.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js b/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js index 378918f435d..a7f790440a0 100644 --- a/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js +++ b/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/api/FakeApi.js b/samples/client/petstore/javascript-promise/src/api/FakeApi.js index bccf87b9f33..d5a4c353453 100644 --- a/samples/client/petstore/javascript-promise/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise/src/api/FakeApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js b/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js index 382507fb3f2..19561a368b4 100644 --- a/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js +++ b/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/api/PetApi.js b/samples/client/petstore/javascript-promise/src/api/PetApi.js index 268dc614e3e..e38d94bbacd 100644 --- a/samples/client/petstore/javascript-promise/src/api/PetApi.js +++ b/samples/client/petstore/javascript-promise/src/api/PetApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/api/StoreApi.js b/samples/client/petstore/javascript-promise/src/api/StoreApi.js index afc4eae0b59..8301399541d 100644 --- a/samples/client/petstore/javascript-promise/src/api/StoreApi.js +++ b/samples/client/petstore/javascript-promise/src/api/StoreApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/api/UserApi.js b/samples/client/petstore/javascript-promise/src/api/UserApi.js index 5e7f7403fac..53eb96980ca 100644 --- a/samples/client/petstore/javascript-promise/src/api/UserApi.js +++ b/samples/client/petstore/javascript-promise/src/api/UserApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/index.js b/samples/client/petstore/javascript-promise/src/index.js index d172e7c3e00..a92a4ab5a22 100644 --- a/samples/client/petstore/javascript-promise/src/index.js +++ b/samples/client/petstore/javascript-promise/src/index.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesAnyType.js b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesAnyType.js index 73b58a733b1..f6bd3640800 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesAnyType.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesAnyType.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesArray.js b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesArray.js index 3a1f4ecc9d8..d36ecc495ed 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesArray.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesArray.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesBoolean.js b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesBoolean.js index 5306f6bd01d..7d063336200 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesBoolean.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesBoolean.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesClass.js b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesClass.js index bd62237ca20..37161bd8c3b 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesClass.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesInteger.js b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesInteger.js index 8f678419e25..d9e860e6470 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesInteger.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesInteger.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesNumber.js b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesNumber.js index 651c8894aa8..f299469e450 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesNumber.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesNumber.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesObject.js b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesObject.js index b5180bbe828..49f7aef8b32 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesObject.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesObject.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesString.js b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesString.js index 9181dac6014..68a58595cb9 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesString.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesString.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Animal.js b/samples/client/petstore/javascript-promise/src/model/Animal.js index 4477ebc5a97..0c4edc9a380 100644 --- a/samples/client/petstore/javascript-promise/src/model/Animal.js +++ b/samples/client/petstore/javascript-promise/src/model/Animal.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ApiResponse.js b/samples/client/petstore/javascript-promise/src/model/ApiResponse.js index c7d3ebad562..efd7fdf421d 100644 --- a/samples/client/petstore/javascript-promise/src/model/ApiResponse.js +++ b/samples/client/petstore/javascript-promise/src/model/ApiResponse.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ArrayOfArrayOfNumberOnly.js b/samples/client/petstore/javascript-promise/src/model/ArrayOfArrayOfNumberOnly.js index ab73a6916d3..fdf87fde4eb 100644 --- a/samples/client/petstore/javascript-promise/src/model/ArrayOfArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-promise/src/model/ArrayOfArrayOfNumberOnly.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ArrayOfNumberOnly.js b/samples/client/petstore/javascript-promise/src/model/ArrayOfNumberOnly.js index b82c3649035..2b24c19bfea 100644 --- a/samples/client/petstore/javascript-promise/src/model/ArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-promise/src/model/ArrayOfNumberOnly.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ArrayTest.js b/samples/client/petstore/javascript-promise/src/model/ArrayTest.js index 4e4a96d0853..60600762ce1 100644 --- a/samples/client/petstore/javascript-promise/src/model/ArrayTest.js +++ b/samples/client/petstore/javascript-promise/src/model/ArrayTest.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Capitalization.js b/samples/client/petstore/javascript-promise/src/model/Capitalization.js index 30232f689dc..bdba5b0cc38 100644 --- a/samples/client/petstore/javascript-promise/src/model/Capitalization.js +++ b/samples/client/petstore/javascript-promise/src/model/Capitalization.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Cat.js b/samples/client/petstore/javascript-promise/src/model/Cat.js index 415bd14582b..f5f9ebf49a7 100644 --- a/samples/client/petstore/javascript-promise/src/model/Cat.js +++ b/samples/client/petstore/javascript-promise/src/model/Cat.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/CatAllOf.js b/samples/client/petstore/javascript-promise/src/model/CatAllOf.js index 6b26f6e753b..b64eee29e11 100644 --- a/samples/client/petstore/javascript-promise/src/model/CatAllOf.js +++ b/samples/client/petstore/javascript-promise/src/model/CatAllOf.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Category.js b/samples/client/petstore/javascript-promise/src/model/Category.js index 20f56275204..a8fa9b082f0 100644 --- a/samples/client/petstore/javascript-promise/src/model/Category.js +++ b/samples/client/petstore/javascript-promise/src/model/Category.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ClassModel.js b/samples/client/petstore/javascript-promise/src/model/ClassModel.js index b8ecf485e69..13e05a6f361 100644 --- a/samples/client/petstore/javascript-promise/src/model/ClassModel.js +++ b/samples/client/petstore/javascript-promise/src/model/ClassModel.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Client.js b/samples/client/petstore/javascript-promise/src/model/Client.js index 42cabd2a038..aa4ca0493f5 100644 --- a/samples/client/petstore/javascript-promise/src/model/Client.js +++ b/samples/client/petstore/javascript-promise/src/model/Client.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Dog.js b/samples/client/petstore/javascript-promise/src/model/Dog.js index 21820fddb02..138d5d13fb0 100644 --- a/samples/client/petstore/javascript-promise/src/model/Dog.js +++ b/samples/client/petstore/javascript-promise/src/model/Dog.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/DogAllOf.js b/samples/client/petstore/javascript-promise/src/model/DogAllOf.js index 4110fbfd302..5d6a9a1072d 100644 --- a/samples/client/petstore/javascript-promise/src/model/DogAllOf.js +++ b/samples/client/petstore/javascript-promise/src/model/DogAllOf.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/EnumArrays.js b/samples/client/petstore/javascript-promise/src/model/EnumArrays.js index b8b3dc37570..8580dfd308f 100644 --- a/samples/client/petstore/javascript-promise/src/model/EnumArrays.js +++ b/samples/client/petstore/javascript-promise/src/model/EnumArrays.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/EnumClass.js b/samples/client/petstore/javascript-promise/src/model/EnumClass.js index d1e33b4d8ef..9c335fdfbb0 100644 --- a/samples/client/petstore/javascript-promise/src/model/EnumClass.js +++ b/samples/client/petstore/javascript-promise/src/model/EnumClass.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/EnumTest.js b/samples/client/petstore/javascript-promise/src/model/EnumTest.js index 0083ab49b06..038926ccdb8 100644 --- a/samples/client/petstore/javascript-promise/src/model/EnumTest.js +++ b/samples/client/petstore/javascript-promise/src/model/EnumTest.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/File.js b/samples/client/petstore/javascript-promise/src/model/File.js index 0d270851df6..8042cfad4b9 100644 --- a/samples/client/petstore/javascript-promise/src/model/File.js +++ b/samples/client/petstore/javascript-promise/src/model/File.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/FileSchemaTestClass.js b/samples/client/petstore/javascript-promise/src/model/FileSchemaTestClass.js index 9461ed31715..e29880db9ae 100644 --- a/samples/client/petstore/javascript-promise/src/model/FileSchemaTestClass.js +++ b/samples/client/petstore/javascript-promise/src/model/FileSchemaTestClass.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/FormatTest.js b/samples/client/petstore/javascript-promise/src/model/FormatTest.js index 050a26eccb3..5772988329a 100644 --- a/samples/client/petstore/javascript-promise/src/model/FormatTest.js +++ b/samples/client/petstore/javascript-promise/src/model/FormatTest.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/HasOnlyReadOnly.js b/samples/client/petstore/javascript-promise/src/model/HasOnlyReadOnly.js index 9b2205f028a..3fe20b3023a 100644 --- a/samples/client/petstore/javascript-promise/src/model/HasOnlyReadOnly.js +++ b/samples/client/petstore/javascript-promise/src/model/HasOnlyReadOnly.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/List.js b/samples/client/petstore/javascript-promise/src/model/List.js index 288cd0f9162..7aa75478844 100644 --- a/samples/client/petstore/javascript-promise/src/model/List.js +++ b/samples/client/petstore/javascript-promise/src/model/List.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/MapTest.js b/samples/client/petstore/javascript-promise/src/model/MapTest.js index 6d50eff8350..d04243f15df 100644 --- a/samples/client/petstore/javascript-promise/src/model/MapTest.js +++ b/samples/client/petstore/javascript-promise/src/model/MapTest.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/MixedPropertiesAndAdditionalPropertiesClass.js b/samples/client/petstore/javascript-promise/src/model/MixedPropertiesAndAdditionalPropertiesClass.js index 4c5ab29b9e6..c5461ad5476 100644 --- a/samples/client/petstore/javascript-promise/src/model/MixedPropertiesAndAdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-promise/src/model/MixedPropertiesAndAdditionalPropertiesClass.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Model200Response.js b/samples/client/petstore/javascript-promise/src/model/Model200Response.js index e5c9e8c5e77..078f612468a 100644 --- a/samples/client/petstore/javascript-promise/src/model/Model200Response.js +++ b/samples/client/petstore/javascript-promise/src/model/Model200Response.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ModelReturn.js b/samples/client/petstore/javascript-promise/src/model/ModelReturn.js index eddfd298fd2..f2c210aeb0d 100644 --- a/samples/client/petstore/javascript-promise/src/model/ModelReturn.js +++ b/samples/client/petstore/javascript-promise/src/model/ModelReturn.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Name.js b/samples/client/petstore/javascript-promise/src/model/Name.js index 80eeb127d2a..8e2caf658e2 100644 --- a/samples/client/petstore/javascript-promise/src/model/Name.js +++ b/samples/client/petstore/javascript-promise/src/model/Name.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/NumberOnly.js b/samples/client/petstore/javascript-promise/src/model/NumberOnly.js index a71b576260e..3d99a053817 100644 --- a/samples/client/petstore/javascript-promise/src/model/NumberOnly.js +++ b/samples/client/petstore/javascript-promise/src/model/NumberOnly.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Order.js b/samples/client/petstore/javascript-promise/src/model/Order.js index 699e9fc6737..4b4250c6a74 100644 --- a/samples/client/petstore/javascript-promise/src/model/Order.js +++ b/samples/client/petstore/javascript-promise/src/model/Order.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/OuterComposite.js b/samples/client/petstore/javascript-promise/src/model/OuterComposite.js index faf1409f5ba..99e0a5c5d97 100644 --- a/samples/client/petstore/javascript-promise/src/model/OuterComposite.js +++ b/samples/client/petstore/javascript-promise/src/model/OuterComposite.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/OuterEnum.js b/samples/client/petstore/javascript-promise/src/model/OuterEnum.js index 5cf00a1d8d8..03931bc7232 100644 --- a/samples/client/petstore/javascript-promise/src/model/OuterEnum.js +++ b/samples/client/petstore/javascript-promise/src/model/OuterEnum.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Pet.js b/samples/client/petstore/javascript-promise/src/model/Pet.js index 114ccfd7b10..0c1fdcd196e 100644 --- a/samples/client/petstore/javascript-promise/src/model/Pet.js +++ b/samples/client/petstore/javascript-promise/src/model/Pet.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ReadOnlyFirst.js b/samples/client/petstore/javascript-promise/src/model/ReadOnlyFirst.js index 51720fc94d0..72c17a9f3e0 100644 --- a/samples/client/petstore/javascript-promise/src/model/ReadOnlyFirst.js +++ b/samples/client/petstore/javascript-promise/src/model/ReadOnlyFirst.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/SpecialModelName.js b/samples/client/petstore/javascript-promise/src/model/SpecialModelName.js index 3b9f1780970..f1fc92e8f31 100644 --- a/samples/client/petstore/javascript-promise/src/model/SpecialModelName.js +++ b/samples/client/petstore/javascript-promise/src/model/SpecialModelName.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Tag.js b/samples/client/petstore/javascript-promise/src/model/Tag.js index 2bfb449378e..953b2938d3f 100644 --- a/samples/client/petstore/javascript-promise/src/model/Tag.js +++ b/samples/client/petstore/javascript-promise/src/model/Tag.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/TypeHolderDefault.js b/samples/client/petstore/javascript-promise/src/model/TypeHolderDefault.js index 10413cd990b..187d7930a9e 100644 --- a/samples/client/petstore/javascript-promise/src/model/TypeHolderDefault.js +++ b/samples/client/petstore/javascript-promise/src/model/TypeHolderDefault.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/TypeHolderExample.js b/samples/client/petstore/javascript-promise/src/model/TypeHolderExample.js index dc1e94db3ae..504ba75bfcc 100644 --- a/samples/client/petstore/javascript-promise/src/model/TypeHolderExample.js +++ b/samples/client/petstore/javascript-promise/src/model/TypeHolderExample.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/User.js b/samples/client/petstore/javascript-promise/src/model/User.js index c593bbd335f..1cb456b754f 100644 --- a/samples/client/petstore/javascript-promise/src/model/User.js +++ b/samples/client/petstore/javascript-promise/src/model/User.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/XmlItem.js b/samples/client/petstore/javascript-promise/src/model/XmlItem.js index d10fa246a7d..1d3419997f0 100644 --- a/samples/client/petstore/javascript-promise/src/model/XmlItem.js +++ b/samples/client/petstore/javascript-promise/src/model/XmlItem.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/.openapi-generator/VERSION b/samples/client/petstore/javascript/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/javascript/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript/src/ApiClient.js b/samples/client/petstore/javascript/src/ApiClient.js index 70484795ba4..e7e8ba7491d 100644 --- a/samples/client/petstore/javascript/src/ApiClient.js +++ b/samples/client/petstore/javascript/src/ApiClient.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/api/AnotherFakeApi.js b/samples/client/petstore/javascript/src/api/AnotherFakeApi.js index a205bd82cb8..6b31599a377 100644 --- a/samples/client/petstore/javascript/src/api/AnotherFakeApi.js +++ b/samples/client/petstore/javascript/src/api/AnotherFakeApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/api/FakeApi.js b/samples/client/petstore/javascript/src/api/FakeApi.js index fbc5aef79d6..fc77d90b910 100644 --- a/samples/client/petstore/javascript/src/api/FakeApi.js +++ b/samples/client/petstore/javascript/src/api/FakeApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js b/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js index 957408b720e..ffa2dc40733 100644 --- a/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js +++ b/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/api/PetApi.js b/samples/client/petstore/javascript/src/api/PetApi.js index 6c6f509fc14..17255a361b0 100644 --- a/samples/client/petstore/javascript/src/api/PetApi.js +++ b/samples/client/petstore/javascript/src/api/PetApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/api/StoreApi.js b/samples/client/petstore/javascript/src/api/StoreApi.js index aaa4b5f23ec..f51e3b64a5d 100644 --- a/samples/client/petstore/javascript/src/api/StoreApi.js +++ b/samples/client/petstore/javascript/src/api/StoreApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/api/UserApi.js b/samples/client/petstore/javascript/src/api/UserApi.js index 7d40aa0f0f7..0999e8ab4d3 100644 --- a/samples/client/petstore/javascript/src/api/UserApi.js +++ b/samples/client/petstore/javascript/src/api/UserApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/index.js b/samples/client/petstore/javascript/src/index.js index d172e7c3e00..a92a4ab5a22 100644 --- a/samples/client/petstore/javascript/src/index.js +++ b/samples/client/petstore/javascript/src/index.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/AdditionalPropertiesAnyType.js b/samples/client/petstore/javascript/src/model/AdditionalPropertiesAnyType.js index 73b58a733b1..f6bd3640800 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesAnyType.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesAnyType.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/AdditionalPropertiesArray.js b/samples/client/petstore/javascript/src/model/AdditionalPropertiesArray.js index 3a1f4ecc9d8..d36ecc495ed 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesArray.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesArray.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/AdditionalPropertiesBoolean.js b/samples/client/petstore/javascript/src/model/AdditionalPropertiesBoolean.js index 5306f6bd01d..7d063336200 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesBoolean.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesBoolean.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/AdditionalPropertiesClass.js b/samples/client/petstore/javascript/src/model/AdditionalPropertiesClass.js index bd62237ca20..37161bd8c3b 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesClass.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/AdditionalPropertiesInteger.js b/samples/client/petstore/javascript/src/model/AdditionalPropertiesInteger.js index 8f678419e25..d9e860e6470 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesInteger.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesInteger.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/AdditionalPropertiesNumber.js b/samples/client/petstore/javascript/src/model/AdditionalPropertiesNumber.js index 651c8894aa8..f299469e450 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesNumber.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesNumber.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/AdditionalPropertiesObject.js b/samples/client/petstore/javascript/src/model/AdditionalPropertiesObject.js index b5180bbe828..49f7aef8b32 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesObject.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesObject.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/AdditionalPropertiesString.js b/samples/client/petstore/javascript/src/model/AdditionalPropertiesString.js index 9181dac6014..68a58595cb9 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesString.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesString.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Animal.js b/samples/client/petstore/javascript/src/model/Animal.js index 4477ebc5a97..0c4edc9a380 100644 --- a/samples/client/petstore/javascript/src/model/Animal.js +++ b/samples/client/petstore/javascript/src/model/Animal.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ApiResponse.js b/samples/client/petstore/javascript/src/model/ApiResponse.js index c7d3ebad562..efd7fdf421d 100644 --- a/samples/client/petstore/javascript/src/model/ApiResponse.js +++ b/samples/client/petstore/javascript/src/model/ApiResponse.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ArrayOfArrayOfNumberOnly.js b/samples/client/petstore/javascript/src/model/ArrayOfArrayOfNumberOnly.js index ab73a6916d3..fdf87fde4eb 100644 --- a/samples/client/petstore/javascript/src/model/ArrayOfArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript/src/model/ArrayOfArrayOfNumberOnly.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ArrayOfNumberOnly.js b/samples/client/petstore/javascript/src/model/ArrayOfNumberOnly.js index b82c3649035..2b24c19bfea 100644 --- a/samples/client/petstore/javascript/src/model/ArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript/src/model/ArrayOfNumberOnly.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ArrayTest.js b/samples/client/petstore/javascript/src/model/ArrayTest.js index 4e4a96d0853..60600762ce1 100644 --- a/samples/client/petstore/javascript/src/model/ArrayTest.js +++ b/samples/client/petstore/javascript/src/model/ArrayTest.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Capitalization.js b/samples/client/petstore/javascript/src/model/Capitalization.js index 30232f689dc..bdba5b0cc38 100644 --- a/samples/client/petstore/javascript/src/model/Capitalization.js +++ b/samples/client/petstore/javascript/src/model/Capitalization.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Cat.js b/samples/client/petstore/javascript/src/model/Cat.js index 415bd14582b..f5f9ebf49a7 100644 --- a/samples/client/petstore/javascript/src/model/Cat.js +++ b/samples/client/petstore/javascript/src/model/Cat.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/CatAllOf.js b/samples/client/petstore/javascript/src/model/CatAllOf.js index 6b26f6e753b..b64eee29e11 100644 --- a/samples/client/petstore/javascript/src/model/CatAllOf.js +++ b/samples/client/petstore/javascript/src/model/CatAllOf.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Category.js b/samples/client/petstore/javascript/src/model/Category.js index 20f56275204..a8fa9b082f0 100644 --- a/samples/client/petstore/javascript/src/model/Category.js +++ b/samples/client/petstore/javascript/src/model/Category.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ClassModel.js b/samples/client/petstore/javascript/src/model/ClassModel.js index b8ecf485e69..13e05a6f361 100644 --- a/samples/client/petstore/javascript/src/model/ClassModel.js +++ b/samples/client/petstore/javascript/src/model/ClassModel.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Client.js b/samples/client/petstore/javascript/src/model/Client.js index 42cabd2a038..aa4ca0493f5 100644 --- a/samples/client/petstore/javascript/src/model/Client.js +++ b/samples/client/petstore/javascript/src/model/Client.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Dog.js b/samples/client/petstore/javascript/src/model/Dog.js index 21820fddb02..138d5d13fb0 100644 --- a/samples/client/petstore/javascript/src/model/Dog.js +++ b/samples/client/petstore/javascript/src/model/Dog.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/DogAllOf.js b/samples/client/petstore/javascript/src/model/DogAllOf.js index 4110fbfd302..5d6a9a1072d 100644 --- a/samples/client/petstore/javascript/src/model/DogAllOf.js +++ b/samples/client/petstore/javascript/src/model/DogAllOf.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/EnumArrays.js b/samples/client/petstore/javascript/src/model/EnumArrays.js index b8b3dc37570..8580dfd308f 100644 --- a/samples/client/petstore/javascript/src/model/EnumArrays.js +++ b/samples/client/petstore/javascript/src/model/EnumArrays.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/EnumClass.js b/samples/client/petstore/javascript/src/model/EnumClass.js index d1e33b4d8ef..9c335fdfbb0 100644 --- a/samples/client/petstore/javascript/src/model/EnumClass.js +++ b/samples/client/petstore/javascript/src/model/EnumClass.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/EnumTest.js b/samples/client/petstore/javascript/src/model/EnumTest.js index 0083ab49b06..038926ccdb8 100644 --- a/samples/client/petstore/javascript/src/model/EnumTest.js +++ b/samples/client/petstore/javascript/src/model/EnumTest.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/File.js b/samples/client/petstore/javascript/src/model/File.js index 0d270851df6..8042cfad4b9 100644 --- a/samples/client/petstore/javascript/src/model/File.js +++ b/samples/client/petstore/javascript/src/model/File.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/FileSchemaTestClass.js b/samples/client/petstore/javascript/src/model/FileSchemaTestClass.js index 9461ed31715..e29880db9ae 100644 --- a/samples/client/petstore/javascript/src/model/FileSchemaTestClass.js +++ b/samples/client/petstore/javascript/src/model/FileSchemaTestClass.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/FormatTest.js b/samples/client/petstore/javascript/src/model/FormatTest.js index 050a26eccb3..5772988329a 100644 --- a/samples/client/petstore/javascript/src/model/FormatTest.js +++ b/samples/client/petstore/javascript/src/model/FormatTest.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/HasOnlyReadOnly.js b/samples/client/petstore/javascript/src/model/HasOnlyReadOnly.js index 9b2205f028a..3fe20b3023a 100644 --- a/samples/client/petstore/javascript/src/model/HasOnlyReadOnly.js +++ b/samples/client/petstore/javascript/src/model/HasOnlyReadOnly.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/List.js b/samples/client/petstore/javascript/src/model/List.js index 288cd0f9162..7aa75478844 100644 --- a/samples/client/petstore/javascript/src/model/List.js +++ b/samples/client/petstore/javascript/src/model/List.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/MapTest.js b/samples/client/petstore/javascript/src/model/MapTest.js index 6d50eff8350..d04243f15df 100644 --- a/samples/client/petstore/javascript/src/model/MapTest.js +++ b/samples/client/petstore/javascript/src/model/MapTest.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js b/samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js index 4c5ab29b9e6..c5461ad5476 100644 --- a/samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Model200Response.js b/samples/client/petstore/javascript/src/model/Model200Response.js index e5c9e8c5e77..078f612468a 100644 --- a/samples/client/petstore/javascript/src/model/Model200Response.js +++ b/samples/client/petstore/javascript/src/model/Model200Response.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ModelReturn.js b/samples/client/petstore/javascript/src/model/ModelReturn.js index eddfd298fd2..f2c210aeb0d 100644 --- a/samples/client/petstore/javascript/src/model/ModelReturn.js +++ b/samples/client/petstore/javascript/src/model/ModelReturn.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Name.js b/samples/client/petstore/javascript/src/model/Name.js index 80eeb127d2a..8e2caf658e2 100644 --- a/samples/client/petstore/javascript/src/model/Name.js +++ b/samples/client/petstore/javascript/src/model/Name.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/NumberOnly.js b/samples/client/petstore/javascript/src/model/NumberOnly.js index a71b576260e..3d99a053817 100644 --- a/samples/client/petstore/javascript/src/model/NumberOnly.js +++ b/samples/client/petstore/javascript/src/model/NumberOnly.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Order.js b/samples/client/petstore/javascript/src/model/Order.js index 699e9fc6737..4b4250c6a74 100644 --- a/samples/client/petstore/javascript/src/model/Order.js +++ b/samples/client/petstore/javascript/src/model/Order.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/OuterComposite.js b/samples/client/petstore/javascript/src/model/OuterComposite.js index faf1409f5ba..99e0a5c5d97 100644 --- a/samples/client/petstore/javascript/src/model/OuterComposite.js +++ b/samples/client/petstore/javascript/src/model/OuterComposite.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/OuterEnum.js b/samples/client/petstore/javascript/src/model/OuterEnum.js index 5cf00a1d8d8..03931bc7232 100644 --- a/samples/client/petstore/javascript/src/model/OuterEnum.js +++ b/samples/client/petstore/javascript/src/model/OuterEnum.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Pet.js b/samples/client/petstore/javascript/src/model/Pet.js index 114ccfd7b10..0c1fdcd196e 100644 --- a/samples/client/petstore/javascript/src/model/Pet.js +++ b/samples/client/petstore/javascript/src/model/Pet.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ReadOnlyFirst.js b/samples/client/petstore/javascript/src/model/ReadOnlyFirst.js index 51720fc94d0..72c17a9f3e0 100644 --- a/samples/client/petstore/javascript/src/model/ReadOnlyFirst.js +++ b/samples/client/petstore/javascript/src/model/ReadOnlyFirst.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/SpecialModelName.js b/samples/client/petstore/javascript/src/model/SpecialModelName.js index 3b9f1780970..f1fc92e8f31 100644 --- a/samples/client/petstore/javascript/src/model/SpecialModelName.js +++ b/samples/client/petstore/javascript/src/model/SpecialModelName.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Tag.js b/samples/client/petstore/javascript/src/model/Tag.js index 2bfb449378e..953b2938d3f 100644 --- a/samples/client/petstore/javascript/src/model/Tag.js +++ b/samples/client/petstore/javascript/src/model/Tag.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/TypeHolderDefault.js b/samples/client/petstore/javascript/src/model/TypeHolderDefault.js index 10413cd990b..187d7930a9e 100644 --- a/samples/client/petstore/javascript/src/model/TypeHolderDefault.js +++ b/samples/client/petstore/javascript/src/model/TypeHolderDefault.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/TypeHolderExample.js b/samples/client/petstore/javascript/src/model/TypeHolderExample.js index dc1e94db3ae..504ba75bfcc 100644 --- a/samples/client/petstore/javascript/src/model/TypeHolderExample.js +++ b/samples/client/petstore/javascript/src/model/TypeHolderExample.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/User.js b/samples/client/petstore/javascript/src/model/User.js index c593bbd335f..1cb456b754f 100644 --- a/samples/client/petstore/javascript/src/model/User.js +++ b/samples/client/petstore/javascript/src/model/User.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/XmlItem.js b/samples/client/petstore/javascript/src/model/XmlItem.js index d10fa246a7d..1d3419997f0 100644 --- a/samples/client/petstore/javascript/src/model/XmlItem.js +++ b/samples/client/petstore/javascript/src/model/XmlItem.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/kotlin-string/.openapi-generator/VERSION b/samples/client/petstore/kotlin-string/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/kotlin-string/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-string/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION b/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin/.openapi-generator/VERSION b/samples/client/petstore/kotlin/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/kotlin/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/perl/.openapi-generator/VERSION b/samples/client/petstore/perl/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/perl/.openapi-generator/VERSION +++ b/samples/client/petstore/perl/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION +++ b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php index b78f0f310be..03826caff9a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index 0b25c56556e..d3f96368a9d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php index 38f93ed9579..1259483af5d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php index 369e578510e..5c269cbede8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php index c9d394c6bc3..8040fe95e96 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php index 12f4fe98096..058ef039c2e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php index b8ec60f9e99..93c6fe56f7f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php index 5bc1ac15acd..b8897384203 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php b/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php index 4e4091726a1..0448f78fafd 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesAnyType.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesAnyType.php index 3b8b4612de0..8087b6fc4d0 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesAnyType.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesAnyType.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesArray.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesArray.php index b9f80292c72..fa670102eb8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesArray.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesArray.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesBoolean.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesBoolean.php index 0935afc6265..c582ca020a5 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesBoolean.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesBoolean.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php index 0dc0123415e..365158b215c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesInteger.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesInteger.php index 2c812b25e69..e308b7a70a7 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesInteger.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesInteger.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesNumber.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesNumber.php index fd79e507053..3c46324e9f0 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesNumber.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesNumber.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesObject.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesObject.php index 55d41382509..667f2bb0003 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesObject.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesObject.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesString.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesString.php index cbd82cbfa07..8333432433d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesString.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesString.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php index b5b1b280553..ddfa967fe31 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php index d438ba42885..30f673754f9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php index 29186e6bb52..70c86d8d19d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php index aa47c6b47da..1015e748089 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php index 32d87926070..b9eca45a71c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php index 3529cefaa16..0cd8bbc0f5e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php index bba97a6ca7f..a4beb8007e5 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php index ea9af0e3c38..760ad2a81aa 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php index 9bcb8e9cd82..6a34329d7be 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php index 57925775113..4834bda0344 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php index 1eea5d0899c..6e7930ab292 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php index 227eb0aaf7b..b7c9762765f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php index a70ae53fbce..a7c17fe156b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php index 938c787b0ef..289f1d86db6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php index f14dc2bff3e..839b4b16754 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php index 7e454f62866..56d3ff0421b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php index 85fc4184a0c..7654a9107e8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php index fdad10d4362..0c359e2a240 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php index 312bdf9cd6c..af8b9dd060c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php index ad8c4cac371..700378d0a22 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php index e039e474d2f..c1923d9d291 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index 624813bf0ed..7522a791178 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php index 04199bad530..be08a19c799 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php index 68e093dc88b..b5fece9a78d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php index b8925b7eccb..08fc12f5b08 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php index c20a8d23a2c..d183cdd53fe 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php index 809c9c62431..6c29d9067fb 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php index 79f96d52fd9..83efd3332b8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php index 677ccb106f1..6e656b15335 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php index 657654ce9e8..3efa6e1f5ce 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php index f341400c11b..5f565a4bffd 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php index b66ccee7cfe..4fcaff7b54f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php index 6925a9ef155..652f37b69fc 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php index 64e88049d75..7bb118029cd 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php index 79132e8b0c5..43507bf63de 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderDefault.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderDefault.php index 2cab44106d3..e7042d471c5 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderDefault.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderDefault.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderExample.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderExample.php index 82926a0c645..9ccc3c47e4e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderExample.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderExample.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php index 669360fee55..6744b9c21f9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/XmlItem.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/XmlItem.php index a2a690ad4d4..c1f72e97ca1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/XmlItem.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/XmlItem.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index 1dfe2db9f62..e2faef5275e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php index 53ee52ccbc3..7ff12ef9614 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php index beaf7ec3478..c28d4a2fecc 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php index 3831b1e2dfd..2697a21342e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php index bfdcc5d6e86..2d04e353fe3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php index 4799a949fa5..fe51ce2f3ef 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php index 6c4ec889b2a..6ee055793ad 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesAnyTypeTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesAnyTypeTest.php index 127df023097..9d4fe764e90 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesAnyTypeTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesAnyTypeTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesArrayTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesArrayTest.php index 91cad352f78..a19d6419129 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesArrayTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesArrayTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesBooleanTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesBooleanTest.php index 9228e312e30..38c092033e0 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesBooleanTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesBooleanTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php index ad95a50939a..22370b43a0b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesIntegerTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesIntegerTest.php index 562b5e6a22f..3dea9a4c9c9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesIntegerTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesIntegerTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesNumberTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesNumberTest.php index b502d7d989d..235cd1b2033 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesNumberTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesNumberTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesObjectTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesObjectTest.php index 973bed6dc92..23d4b25baf7 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesObjectTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesObjectTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesStringTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesStringTest.php index 0d739feed19..310107ce66c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesStringTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesStringTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php index c5342238425..598ba353ef5 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php index 89656b032c4..ff127b64901 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php index 1080f7a6b93..a80c4a54437 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php index 3aac20d5349..7c52127e1ad 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php index 56c06699e5f..322fdbc1554 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php index d72763b1754..02d5965efb0 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php index 515164ea4be..f5574208ccb 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php index 8eaba70e32b..1b7bbab7839 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php index 1f3c3072053..70be8dbb25e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php index 6ff7e3b413f..063847ceb90 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php index 86715c7394e..c4a9eaee088 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php index c5d7e6b5a34..17c4ce9e975 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php index 0d504dbd2cd..bbdf71bcb63 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php index 092f5f2a3aa..4c0b5b97fef 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php index c5e6c977355..7f83f3312bf 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php index 4cf96be1a90..76d1f2fb675 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php index 9224e29fdbd..5c042591be1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php index ca5a8391324..e67751dd861 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php index c7f054bb5d8..7cedfeed44a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php index 781e9ea05b6..25df1e7911c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php index 988f84325b1..14a38f611a1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php index e9c0be20dbd..c59fa9106a4 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php index f1642dde446..b88485f7f44 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php index 09780d92b52..43843dba2b1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php index f434b7022fe..e93a5e46d18 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php index 4bb7896b085..f3fb739ffad 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php index 1dfde7afc1f..fef2a5102d8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php index d75e55996a3..9536eb775bf 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php index 13a8caae0c5..137d9c605d1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php index f4dc59e1003..b16b2c37a9b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php index a0a132187b4..33b7848030d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php index 2af7be4caf6..1fce252c5dc 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php index 6ecf877b9e1..ebf93790131 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php index 56eeb12d857..bae67b14a32 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/TypeHolderDefaultTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/TypeHolderDefaultTest.php index 0cdc184355d..37d48bb4936 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/TypeHolderDefaultTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/TypeHolderDefaultTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/TypeHolderExampleTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/TypeHolderExampleTest.php index a677e810f7d..44ded9d7088 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/TypeHolderExampleTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/TypeHolderExampleTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php index 8ba90d5289e..6a8cb63d036 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/XmlItemTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/XmlItemTest.php index 9ffd08c51df..067c711b4e4 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/XmlItemTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/XmlItemTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/client/petstore/python-asyncio/.openapi-generator/VERSION b/samples/client/petstore/python-asyncio/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/python-asyncio/.openapi-generator/VERSION +++ b/samples/client/petstore/python-asyncio/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python-tornado/.openapi-generator/VERSION b/samples/client/petstore/python-tornado/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/python-tornado/.openapi-generator/VERSION +++ b/samples/client/petstore/python-tornado/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python/.openapi-generator/VERSION b/samples/client/petstore/python/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/python/.openapi-generator/VERSION +++ b/samples/client/petstore/python/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION b/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java index ac5ee6b513c..2ebd1da3282 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java index 311fb8b6386..ee09f8dc738 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java index 50ae11724df..56610a8f611 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud/.openapi-generator/VERSION b/samples/client/petstore/spring-cloud/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/spring-cloud/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-cloud/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java index 43e52b7af01..862e4695882 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java index 033f7a02ac0..d14b18696a7 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java index 6d29de21e77..370af6c2e5a 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-stubs/.openapi-generator/VERSION b/samples/client/petstore/spring-stubs/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/spring-stubs/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-stubs/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java index fcd4c943704..68659995e73 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java index 1137beea308..41bc02d2d81 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java index 011a76a9432..83c2c9019e2 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/typescript-angular-v2/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v2/default/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-angular-v2/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v2/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v2/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v2/npm/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v2/npm/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v2/with-interfaces/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v4.3/npm/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v4.3/npm/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v4/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v4/npm/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v4/npm/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angularjs/.openapi-generator/VERSION b/samples/client/petstore/typescript-angularjs/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-angularjs/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angularjs/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION b/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/meta-codegen/lib/pom.xml b/samples/meta-codegen/lib/pom.xml index 9885a55a759..38d08719b84 100644 --- a/samples/meta-codegen/lib/pom.xml +++ b/samples/meta-codegen/lib/pom.xml @@ -121,7 +121,7 @@ UTF-8 - 4.1.0 + 4.1.1-SNAPSHOT 1.0.0 4.8.1 diff --git a/samples/meta-codegen/usage/.openapi-generator/VERSION b/samples/meta-codegen/usage/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/meta-codegen/usage/.openapi-generator/VERSION +++ b/samples/meta-codegen/usage/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION b/samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php index 61aae7c8ca7..d1a2b166a67 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php index e139ca407c5..54324571301 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index 1ded149c734..185418cadfb 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php index 5debe2f84c6..71e93259e10 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php index 4e1d147a0c5..084e7b62874 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php index 1814d637702..f4d241d28a4 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php index 61bd517389a..c6104c9f588 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ApiException.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ApiException.php index b8ec60f9e99..93c6fe56f7f 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ApiException.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ApiException.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Configuration.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Configuration.php index 752e5c32089..6d082d9ecbd 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Configuration.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Configuration.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php index 4e4091726a1..0448f78fafd 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php index f3d1b3cace4..f315059c99c 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php index b5b1b280553..ddfa967fe31 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php index d438ba42885..30f673754f9 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php index 29186e6bb52..70c86d8d19d 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php index aa47c6b47da..1015e748089 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php index 32d87926070..b9eca45a71c 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php index 3529cefaa16..0cd8bbc0f5e 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php index bba97a6ca7f..a4beb8007e5 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php index ea9af0e3c38..760ad2a81aa 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php index 9bcb8e9cd82..6a34329d7be 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php index 57925775113..4834bda0344 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php index 1eea5d0899c..6e7930ab292 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php index 227eb0aaf7b..b7c9762765f 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php index a70ae53fbce..a7c17fe156b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php index 938c787b0ef..289f1d86db6 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php index f14dc2bff3e..839b4b16754 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php index 0352fc1d9f5..bf2c564cc6d 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php index 85fc4184a0c..7654a9107e8 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php index fdad10d4362..0c359e2a240 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php index d139d6e6414..1e6b27ee6c4 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php index 4cf542fdcf6..d13a1f13423 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php index ad8c4cac371..700378d0a22 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php index 5bf520267ad..a78add5c5a8 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php index 1edeb0e020c..3bb2e1a6ccc 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php index 98ef9162986..5dac3e1787e 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php index b7ec1d59dbc..2c55b6e99f4 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php index 9a2f14f946d..8d57b3a3323 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php index ffbb883a0bd..2c99c30605a 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php index efb8180e1e6..e78018d6d54 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php index 2eddfee7775..4b17d92d13e 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php index e039e474d2f..c1923d9d291 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index 624813bf0ed..7522a791178 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php index 04199bad530..be08a19c799 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php index 68e093dc88b..b5fece9a78d 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php index b8925b7eccb..08fc12f5b08 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php index c20a8d23a2c..d183cdd53fe 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php index 809c9c62431..6c29d9067fb 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php index 32cc64c466e..ad2ff948639 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php index 79f96d52fd9..83efd3332b8 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php index 677ccb106f1..6e656b15335 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php index 657654ce9e8..3efa6e1f5ce 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php index f341400c11b..5f565a4bffd 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php index c5f35dd7fee..42a2fcac673 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php index 3d43c34ad30..ba96a75c33c 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php index 13e45306848..15846b65121 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php index b66ccee7cfe..4fcaff7b54f 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php index 6925a9ef155..652f37b69fc 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php index 0ecfe2ff32e..862e3899122 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php index 79132e8b0c5..43507bf63de 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php index 669360fee55..6744b9c21f9 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index 1dfe2db9f62..e2faef5275e 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php index 53ee52ccbc3..7ff12ef9614 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/DefaultApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/DefaultApiTest.php index 1bbe5f64572..87bcc51b1c0 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/DefaultApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/DefaultApiTest.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php index 38d33da5526..738ce73466c 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php index 3831b1e2dfd..2697a21342e 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php index bfdcc5d6e86..2d04e353fe3 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php index 4799a949fa5..fe51ce2f3ef 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php index 6c4ec889b2a..6ee055793ad 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php index a7c9b44a882..7200c186bcb 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php index c5342238425..598ba353ef5 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php index 89656b032c4..ff127b64901 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php index 1080f7a6b93..a80c4a54437 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php index 3aac20d5349..7c52127e1ad 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php index 56c06699e5f..322fdbc1554 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php index d72763b1754..02d5965efb0 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php index 515164ea4be..f5574208ccb 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php index 8eaba70e32b..1b7bbab7839 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php index 1f3c3072053..70be8dbb25e 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php index 6ff7e3b413f..063847ceb90 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php index 86715c7394e..c4a9eaee088 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php index c5d7e6b5a34..17c4ce9e975 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php index 0d504dbd2cd..bbdf71bcb63 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php index 092f5f2a3aa..4c0b5b97fef 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php index c5e6c977355..7f83f3312bf 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php index 07c7239ec80..128b563d3db 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php index 9224e29fdbd..5c042591be1 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php index ca5a8391324..e67751dd861 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FooTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FooTest.php index a0d49bae6b3..cab54545d64 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FooTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FooTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php index 03dfc42c80c..4d9b55277bd 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php index 781e9ea05b6..25df1e7911c 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HealthCheckResultTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HealthCheckResultTest.php index 3568f79ee19..e8e9bc75e3c 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HealthCheckResultTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HealthCheckResultTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject1Test.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject1Test.php index ac78be001ec..5984370f0ac 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject1Test.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject1Test.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject2Test.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject2Test.php index 191d616ecdc..078bd308ae1 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject2Test.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject2Test.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject3Test.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject3Test.php index 8c2ca111f1a..f63c1117365 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject3Test.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject3Test.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject4Test.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject4Test.php index 03638106245..0a31cf34651 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject4Test.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject4Test.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject5Test.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject5Test.php index 602886f5a64..c1d60bfd93b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject5Test.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject5Test.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObjectTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObjectTest.php index 329a88f46d9..1069f575761 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObjectTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObjectTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineResponseDefaultTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineResponseDefaultTest.php index bce3085de51..c4553c0dd82 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineResponseDefaultTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineResponseDefaultTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php index 988f84325b1..14a38f611a1 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php index e9c0be20dbd..c59fa9106a4 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php index f1642dde446..b88485f7f44 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php index 09780d92b52..43843dba2b1 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php index f434b7022fe..e93a5e46d18 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php index 4bb7896b085..f3fb739ffad 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NullableClassTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NullableClassTest.php index d6c47a8d485..9ead82fa849 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NullableClassTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NullableClassTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php index 1dfde7afc1f..fef2a5102d8 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php index d75e55996a3..9536eb775bf 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php index 13a8caae0c5..137d9c605d1 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumDefaultValueTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumDefaultValueTest.php index 739033dc951..3ea20e311e0 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumDefaultValueTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumDefaultValueTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerDefaultValueTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerDefaultValueTest.php index 1cb9689868b..e18d0d5db5c 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerDefaultValueTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerDefaultValueTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerTest.php index 139ff211f5b..8950d7f102b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php index f4dc59e1003..b16b2c37a9b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php index a0a132187b4..33b7848030d 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php index 2af7be4caf6..1fce252c5dc 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php index 6ecf877b9e1..ebf93790131 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php index 56eeb12d857..bae67b14a32 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php index 8ba90d5289e..6a8cb63d036 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.0-SNAPSHOT + * OpenAPI Generator version: 4.1.1-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/python/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/openapi3/client/petstore/python/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/python/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/VERSION b/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore.rb index 12ff44084b3..50ae5e03d0d 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb index 1765337e463..e828d7208b4 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb index 5c872a2cf8b..517cd52709f 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb index 5e10e0a0fa2..9d04817774d 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb index 9c4a1178e55..efc6c0d29c6 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb index f235041dfd7..1046df37b6d 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb index 42291902d9a..9e577bbf534 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb index 265a387653a..51cee2bc4e8 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_client.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_client.rb index 1b41a5a2c45..da74bafbc6c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_client.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_error.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_error.rb index 9eab46a89b7..06edcc78dc7 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_error.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/configuration.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/configuration.rb index 02264ad9516..a6f5ceefe47 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/configuration.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb index a4b791a17f7..d1e15cc183a 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/animal.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/animal.rb index 396199ca411..4bb43b9b3f2 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/animal.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/animal.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb index 998250d20ae..b97381b8f3c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb index 99aa9482fa3..6524faab1bb 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb index e7da1699d45..2cb6117756c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb index 121bff2f022..6e8b6c9c415 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb index 02567bdfd45..9e0b353acb0 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat.rb index 51ab33355e3..0e371fdab38 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb index a971e6f5566..220f108d8cc 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/category.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/category.rb index 344ca690654..8089f254d4f 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/category.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/category.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb index 01b2b965d60..8aa5d5272f2 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/client.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/client.rb index 830ab1d0f00..e70206c160d 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/client.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog.rb index 07c31216bc3..19203ab642c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb index 18cf6197720..e96ac015802 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb index 1f12cb43b9c..5b565597132 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb index 406b0dccc95..e105ff447a8 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb index 6db05c48aaa..00e245e8a70 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file.rb index 459e4deba8f..6bce09460dc 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb index c01bb104a3e..7bb95e34fd2 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/foo.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/foo.rb index 0546ad92695..32c01cb0a69 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/foo.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/foo.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb index 010a1d0efad..0b1472d0e00 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb index 6d24ac174c5..e916d10b16c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb index 7d31c85a1d3..3ec740ccf7f 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb index 3fc98931783..f7319904db9 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb index e61b19c09b0..2b0281d553e 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb index 50514beacec..5312efc42a0 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb index 15245d845c6..073e4822d76 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb index 72c7595b858..1048510ded5 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb index fdff4997056..4782507a78c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb index fa811479dc0..336486e966a 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/list.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/list.rb index ab8318101b5..db861f23f77 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/list.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb index 68509874a7d..c8465b1823c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index f82bdde7721..7e5ed178810 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb index d87939a4b8a..552de582c69 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb index 32b75d1f088..3aaa464c8e3 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/name.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/name.rb index 665fc352764..30250644183 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/name.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb index eab0edde201..92efb7fdaeb 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb index 8b6da24af4b..553ca99beb3 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/order.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/order.rb index bcfc925dbf3..c790d702702 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/order.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/order.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb index 1cfbf6659a7..dd05f8ade30 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb index c7d622d9703..d24a7b353ff 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb index 38e51df938c..f6b631e7749 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb index 70788d1e873..92a0b518e32 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb index 0d074b8b9f5..a7542f4cac4 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/pet.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/pet.rb index 20a476bbe9f..59cbcadc5a6 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/pet.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/pet.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb index 012f382be79..beccaccac43 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb index b2bc0dc84a6..f16178a214c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/tag.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/tag.rb index 6d79193b09a..700c27baf17 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/tag.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/tag.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/user.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/user.rb index 5b97445cc16..be6a8e9350a 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/user.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/user.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/version.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/version.rb index 29645445838..37b31e0899a 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/version.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec b/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec index 6fe25dceb0c..348b1213f44 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec +++ b/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb index 7fc8ef59bdc..ab755e9edf8 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/default_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/default_api_spec.rb index 132532dde17..61dceb031d7 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/default_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/default_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb index f0d6a13636f..3c9cce607b8 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb index 12c2278ca20..7a279d9efa9 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb index a202df82415..b47e785aabe 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/store_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/store_api_spec.rb index 61b633b4085..0792a31a847 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/store_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/store_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/user_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/user_api_spec.rb index 248006835ed..327075b8368 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/user_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/user_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api_client_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api_client_spec.rb index a9fd5b4ba1e..f66015c816e 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api_client_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/configuration_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/configuration_spec.rb index 08263fa509b..08a875cffef 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/configuration_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb index a6885692f64..00a004c2fb0 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/animal_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/animal_spec.rb index 08155ef3949..c6610d36e11 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/animal_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/animal_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/api_response_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/api_response_spec.rb index 991bb81df72..700bdaa2aec 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/api_response_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/api_response_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb index 372539c55cb..ef282fa6b89 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb index 759a272f686..ecc5ad52c4e 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_test_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_test_spec.rb index c3819c9a9f6..42c8c835113 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_test_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_test_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb index 98059918537..a2273bae192 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb index 49859a0524f..c27179120c5 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_spec.rb index 0ee7d2a7f68..b0e1093fefb 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/category_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/category_spec.rb index 1f9f8897fde..a437816f7a3 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/category_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/category_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/class_model_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/class_model_spec.rb index 589f3d1f121..28e126def6c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/class_model_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/class_model_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/client_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/client_spec.rb index b246962e2ba..0a2446b6bb0 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/client_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb index 6cba24ecd94..45fb6a3c422 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_spec.rb index d13a6864497..46da564fab5 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb index 993d8f3a3ee..2ea117c042e 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb index 50c56e53df8..abd0f551148 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb index 903b7f9c9ef..d26e2693d27 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb index c59870f674f..d8ff3c21006 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_spec.rb index 38513a9593e..50c1c6c4e15 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/foo_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/foo_spec.rb index 829f18ac0d9..f7915c8d68e 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/foo_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/foo_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/format_test_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/format_test_spec.rb index 3b015816707..9f1785bcbe2 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/format_test_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/format_test_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb index f1e7908be13..24392afa873 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/health_check_result_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/health_check_result_spec.rb index d94dfae3e1a..2a1aaac7826 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/health_check_result_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/health_check_result_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object1_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object1_spec.rb index 40d5f80b322..6fd340cd5c4 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object1_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object1_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object2_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object2_spec.rb index d9ee4e8d6bd..cedf2d70a10 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object2_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object2_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object3_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object3_spec.rb index 2fb2d0acd0a..c092d479678 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object3_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object3_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object4_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object4_spec.rb index 467108f38b7..50fde4ba0e9 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object4_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object4_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object5_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object5_spec.rb index 76b646c1949..eab00d67881 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object5_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object5_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object_spec.rb index ccb47629bd3..15b6e33b8c8 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_response_default_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_response_default_spec.rb index 859051fae22..4433c9e1d48 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_response_default_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_response_default_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/list_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/list_spec.rb index 305f503079d..b1829647634 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/list_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/list_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/map_test_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/map_test_spec.rb index 6be8c3aff53..729dc35145c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/map_test_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/map_test_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb index d9070acf516..bd675e88e7f 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb index 6502d960cb8..701e9891fb8 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/model_return_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/model_return_spec.rb index e4fc442810c..f4bdd9253ce 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/model_return_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/model_return_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/name_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/name_spec.rb index 362d499d125..6f8633c7563 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/name_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/name_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/nullable_class_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/nullable_class_spec.rb index b7a8c99c1b5..f508ba98b4f 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/nullable_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/nullable_class_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/number_only_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/number_only_spec.rb index 440a2d377d7..093452f4608 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/number_only_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/number_only_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/order_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/order_spec.rb index 45788b835ab..9f7cb8f767e 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/order_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/order_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb index a7c25a114cc..fb670b2977e 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_default_value_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_default_value_spec.rb index 80c852db9fb..72d3c549667 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_default_value_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_default_value_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_default_value_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_default_value_spec.rb index 0be262b5dfc..310e4ee6fda 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_default_value_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_default_value_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_spec.rb index 9696979e03c..3e69113a392 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb index f6de5c89911..d196aa079e9 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/pet_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/pet_spec.rb index b0c7076815b..74ea31c6959 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/pet_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/pet_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb index d8a42302760..960d289dde7 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb index 43eb2ec61ec..c8264386763 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/tag_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/tag_spec.rb index abb8380ff3a..72cf2dd5115 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/tag_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/tag_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/user_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/user_spec.rb index d313a360bbb..d64a11e2b48 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/user_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/user_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/spec_helper.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/spec_helper.rb index dc8611b437d..6b9663ca664 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/spec_helper.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/.openapi-generator/VERSION b/samples/openapi3/client/petstore/ruby/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/openapi3/client/petstore/ruby/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/ruby/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore.rb b/samples/openapi3/client/petstore/ruby/lib/petstore.rb index 12ff44084b3..50ae5e03d0d 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/another_fake_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/another_fake_api.rb index 1765337e463..e828d7208b4 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/another_fake_api.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api/another_fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/default_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/default_api.rb index 5c872a2cf8b..517cd52709f 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/default_api.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api/default_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb index 5e10e0a0fa2..9d04817774d 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb index 9c4a1178e55..efc6c0d29c6 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/pet_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/pet_api.rb index f235041dfd7..1046df37b6d 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/pet_api.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api/pet_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/store_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/store_api.rb index 42291902d9a..9e577bbf534 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/store_api.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api/store_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/user_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/user_api.rb index 265a387653a..51cee2bc4e8 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/user_api.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api/user_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api_client.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api_client.rb index 829c7e3c5bf..6abea99e7ff 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api_client.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api_error.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api_error.rb index 9eab46a89b7..06edcc78dc7 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api_error.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/configuration.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/configuration.rb index 73a5712c90d..ead5913764b 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb index a4b791a17f7..d1e15cc183a 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/animal.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/animal.rb index 396199ca411..4bb43b9b3f2 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/animal.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/animal.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/api_response.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/api_response.rb index 998250d20ae..b97381b8f3c 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/api_response.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/api_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb index 99aa9482fa3..6524faab1bb 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb index e7da1699d45..2cb6117756c 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_test.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_test.rb index 121bff2f022..6e8b6c9c415 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_test.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/capitalization.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/capitalization.rb index 02567bdfd45..9e0b353acb0 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/capitalization.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/capitalization.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat.rb index 51ab33355e3..0e371fdab38 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat_all_of.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat_all_of.rb index a971e6f5566..220f108d8cc 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat_all_of.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/category.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/category.rb index 344ca690654..8089f254d4f 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/category.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/category.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/class_model.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/class_model.rb index 01b2b965d60..8aa5d5272f2 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/class_model.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/class_model.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/client.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/client.rb index 830ab1d0f00..e70206c160d 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/client.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog.rb index 07c31216bc3..19203ab642c 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog_all_of.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog_all_of.rb index 18cf6197720..e96ac015802 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog_all_of.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_arrays.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_arrays.rb index 1f12cb43b9c..5b565597132 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_arrays.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_arrays.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_class.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_class.rb index 406b0dccc95..e105ff447a8 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_class.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_test.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_test.rb index 6db05c48aaa..00e245e8a70 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_test.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/file.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/file.rb index 459e4deba8f..6bce09460dc 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/file.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/file.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb index c01bb104a3e..7bb95e34fd2 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/foo.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/foo.rb index 0546ad92695..32c01cb0a69 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/foo.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/foo.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/format_test.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/format_test.rb index 010a1d0efad..0b1472d0e00 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/format_test.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/format_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb index 6d24ac174c5..e916d10b16c 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/health_check_result.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/health_check_result.rb index 7d31c85a1d3..3ec740ccf7f 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/health_check_result.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/health_check_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object.rb index 3fc98931783..f7319904db9 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object1.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object1.rb index e61b19c09b0..2b0281d553e 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object1.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object1.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object2.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object2.rb index 50514beacec..5312efc42a0 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object2.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object2.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object3.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object3.rb index 15245d845c6..073e4822d76 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object3.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object3.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object4.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object4.rb index 72c7595b858..1048510ded5 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object4.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object4.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object5.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object5.rb index fdff4997056..4782507a78c 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object5.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object5.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_response_default.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_response_default.rb index fa811479dc0..336486e966a 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_response_default.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_response_default.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/list.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/list.rb index ab8318101b5..db861f23f77 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/list.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/map_test.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/map_test.rb index 68509874a7d..c8465b1823c 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/map_test.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/map_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index f82bdde7721..7e5ed178810 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/model200_response.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/model200_response.rb index d87939a4b8a..552de582c69 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/model200_response.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/model200_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/model_return.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/model_return.rb index 32b75d1f088..3aaa464c8e3 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/model_return.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/model_return.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/name.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/name.rb index 665fc352764..30250644183 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/name.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/nullable_class.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/nullable_class.rb index eab0edde201..92efb7fdaeb 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/nullable_class.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/nullable_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/number_only.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/number_only.rb index 8b6da24af4b..553ca99beb3 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/number_only.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/order.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/order.rb index bcfc925dbf3..c790d702702 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/order.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/order.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_composite.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_composite.rb index 1cfbf6659a7..dd05f8ade30 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_composite.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_composite.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum.rb index c7d622d9703..d24a7b353ff 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb index 38e51df938c..f6b631e7749 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb index 70788d1e873..92a0b518e32 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb index 0d074b8b9f5..a7542f4cac4 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/pet.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/pet.rb index 20a476bbe9f..59cbcadc5a6 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/pet.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/pet.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/read_only_first.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/read_only_first.rb index 012f382be79..beccaccac43 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/read_only_first.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/read_only_first.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/special_model_name.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/special_model_name.rb index b2bc0dc84a6..f16178a214c 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/special_model_name.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/special_model_name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/tag.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/tag.rb index 6d79193b09a..700c27baf17 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/tag.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/tag.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/user.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/user.rb index 5b97445cc16..be6a8e9350a 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/user.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/user.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/version.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/version.rb index 29645445838..37b31e0899a 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/version.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/petstore.gemspec b/samples/openapi3/client/petstore/ruby/petstore.gemspec index 902141a5ce5..e6fe7aa474b 100644 --- a/samples/openapi3/client/petstore/ruby/petstore.gemspec +++ b/samples/openapi3/client/petstore/ruby/petstore.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/another_fake_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/another_fake_api_spec.rb index 7fc8ef59bdc..ab755e9edf8 100644 --- a/samples/openapi3/client/petstore/ruby/spec/api/another_fake_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/api/another_fake_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/default_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/default_api_spec.rb index 132532dde17..61dceb031d7 100644 --- a/samples/openapi3/client/petstore/ruby/spec/api/default_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/api/default_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/fake_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/fake_api_spec.rb index f0d6a13636f..3c9cce607b8 100644 --- a/samples/openapi3/client/petstore/ruby/spec/api/fake_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/api/fake_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/fake_classname_tags123_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/fake_classname_tags123_api_spec.rb index 12c2278ca20..7a279d9efa9 100644 --- a/samples/openapi3/client/petstore/ruby/spec/api/fake_classname_tags123_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/api/fake_classname_tags123_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/pet_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/pet_api_spec.rb index a202df82415..b47e785aabe 100644 --- a/samples/openapi3/client/petstore/ruby/spec/api/pet_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/api/pet_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/store_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/store_api_spec.rb index 61b633b4085..0792a31a847 100644 --- a/samples/openapi3/client/petstore/ruby/spec/api/store_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/api/store_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/user_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/user_api_spec.rb index 248006835ed..327075b8368 100644 --- a/samples/openapi3/client/petstore/ruby/spec/api/user_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/api/user_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/api_client_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api_client_spec.rb index 274d78c14cc..468e5f36afc 100644 --- a/samples/openapi3/client/petstore/ruby/spec/api_client_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/configuration_spec.rb b/samples/openapi3/client/petstore/ruby/spec/configuration_spec.rb index 08263fa509b..08a875cffef 100644 --- a/samples/openapi3/client/petstore/ruby/spec/configuration_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/additional_properties_class_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/additional_properties_class_spec.rb index a6885692f64..00a004c2fb0 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/additional_properties_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/additional_properties_class_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/animal_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/animal_spec.rb index 08155ef3949..c6610d36e11 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/animal_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/animal_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/api_response_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/api_response_spec.rb index 991bb81df72..700bdaa2aec 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/api_response_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/api_response_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/array_of_array_of_number_only_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/array_of_array_of_number_only_spec.rb index 372539c55cb..ef282fa6b89 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/array_of_array_of_number_only_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/array_of_array_of_number_only_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/array_of_number_only_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/array_of_number_only_spec.rb index 759a272f686..ecc5ad52c4e 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/array_of_number_only_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/array_of_number_only_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/array_test_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/array_test_spec.rb index c3819c9a9f6..42c8c835113 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/array_test_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/array_test_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/capitalization_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/capitalization_spec.rb index 98059918537..a2273bae192 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/capitalization_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/capitalization_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/cat_all_of_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/cat_all_of_spec.rb index 49859a0524f..c27179120c5 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/cat_all_of_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/cat_all_of_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/cat_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/cat_spec.rb index 0ee7d2a7f68..b0e1093fefb 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/cat_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/cat_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/category_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/category_spec.rb index 1f9f8897fde..a437816f7a3 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/category_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/category_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/class_model_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/class_model_spec.rb index 589f3d1f121..28e126def6c 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/class_model_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/class_model_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/client_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/client_spec.rb index b246962e2ba..0a2446b6bb0 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/client_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/dog_all_of_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/dog_all_of_spec.rb index 6cba24ecd94..45fb6a3c422 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/dog_all_of_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/dog_all_of_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/dog_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/dog_spec.rb index d13a6864497..46da564fab5 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/dog_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/dog_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/enum_arrays_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/enum_arrays_spec.rb index 993d8f3a3ee..2ea117c042e 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/enum_arrays_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/enum_arrays_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/enum_class_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/enum_class_spec.rb index 50c56e53df8..abd0f551148 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/enum_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/enum_class_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/enum_test_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/enum_test_spec.rb index 903b7f9c9ef..d26e2693d27 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/enum_test_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/enum_test_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/file_schema_test_class_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/file_schema_test_class_spec.rb index c59870f674f..d8ff3c21006 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/file_schema_test_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/file_schema_test_class_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/file_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/file_spec.rb index 38513a9593e..50c1c6c4e15 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/file_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/file_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/foo_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/foo_spec.rb index 829f18ac0d9..f7915c8d68e 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/foo_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/foo_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/format_test_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/format_test_spec.rb index 3b015816707..9f1785bcbe2 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/format_test_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/format_test_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/has_only_read_only_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/has_only_read_only_spec.rb index f1e7908be13..24392afa873 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/has_only_read_only_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/has_only_read_only_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/health_check_result_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/health_check_result_spec.rb index d94dfae3e1a..2a1aaac7826 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/health_check_result_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/health_check_result_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_object1_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/inline_object1_spec.rb index 40d5f80b322..6fd340cd5c4 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/inline_object1_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/inline_object1_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_object2_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/inline_object2_spec.rb index d9ee4e8d6bd..cedf2d70a10 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/inline_object2_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/inline_object2_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_object3_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/inline_object3_spec.rb index 2fb2d0acd0a..c092d479678 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/inline_object3_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/inline_object3_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_object4_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/inline_object4_spec.rb index 467108f38b7..50fde4ba0e9 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/inline_object4_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/inline_object4_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_object5_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/inline_object5_spec.rb index 76b646c1949..eab00d67881 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/inline_object5_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/inline_object5_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_object_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/inline_object_spec.rb index ccb47629bd3..15b6e33b8c8 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/inline_object_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/inline_object_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_response_default_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/inline_response_default_spec.rb index 859051fae22..4433c9e1d48 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/inline_response_default_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/inline_response_default_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/list_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/list_spec.rb index 305f503079d..b1829647634 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/list_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/list_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/map_test_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/map_test_spec.rb index 6be8c3aff53..729dc35145c 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/map_test_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/map_test_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/mixed_properties_and_additional_properties_class_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/mixed_properties_and_additional_properties_class_spec.rb index d9070acf516..bd675e88e7f 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/mixed_properties_and_additional_properties_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/mixed_properties_and_additional_properties_class_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/model200_response_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/model200_response_spec.rb index 6502d960cb8..701e9891fb8 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/model200_response_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/model200_response_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/model_return_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/model_return_spec.rb index e4fc442810c..f4bdd9253ce 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/model_return_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/model_return_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/name_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/name_spec.rb index 362d499d125..6f8633c7563 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/name_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/name_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/nullable_class_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/nullable_class_spec.rb index b7a8c99c1b5..f508ba98b4f 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/nullable_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/nullable_class_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/number_only_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/number_only_spec.rb index 440a2d377d7..093452f4608 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/number_only_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/number_only_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/order_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/order_spec.rb index 45788b835ab..9f7cb8f767e 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/order_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/order_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/outer_composite_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/outer_composite_spec.rb index a7c25a114cc..fb670b2977e 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/outer_composite_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/outer_composite_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_default_value_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_default_value_spec.rb index 80c852db9fb..72d3c549667 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_default_value_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_default_value_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_default_value_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_default_value_spec.rb index 0be262b5dfc..310e4ee6fda 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_default_value_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_default_value_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_spec.rb index 9696979e03c..3e69113a392 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_spec.rb index f6de5c89911..d196aa079e9 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/pet_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/pet_spec.rb index b0c7076815b..74ea31c6959 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/pet_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/pet_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/read_only_first_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/read_only_first_spec.rb index d8a42302760..960d289dde7 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/read_only_first_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/read_only_first_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/special_model_name_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/special_model_name_spec.rb index 43eb2ec61ec..c8264386763 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/special_model_name_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/special_model_name_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/tag_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/tag_spec.rb index abb8380ff3a..72cf2dd5115 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/tag_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/tag_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/user_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/user_spec.rb index d313a360bbb..d64a11e2b48 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/user_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/user_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/spec_helper.rb b/samples/openapi3/client/petstore/ruby/spec/spec_helper.rb index dc8611b437d..6b9663ca664 100644 --- a/samples/openapi3/client/petstore/ruby/spec/spec_helper.rb +++ b/samples/openapi3/client/petstore/ruby/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.0-SNAPSHOT +OpenAPI Generator version: 4.1.1-SNAPSHOT =end diff --git a/samples/schema/petstore/mysql/.openapi-generator/VERSION b/samples/schema/petstore/mysql/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/schema/petstore/mysql/.openapi-generator/VERSION +++ b/samples/schema/petstore/mysql/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION b/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-msf4j/.openapi-generator/VERSION b/samples/server/petstore/java-msf4j/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/java-msf4j/.openapi-generator/VERSION +++ b/samples/server/petstore/java-msf4j/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION b/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin-server/ktor/README.md b/samples/server/petstore/kotlin-server/ktor/README.md index c5ad5592661..b0c381f68a7 100644 --- a/samples/server/petstore/kotlin-server/ktor/README.md +++ b/samples/server/petstore/kotlin-server/ktor/README.md @@ -2,7 +2,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -Generated by OpenAPI Generator 4.1.0-SNAPSHOT. +Generated by OpenAPI Generator 4.1.1-SNAPSHOT. ## Requires diff --git a/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-lumen/.openapi-generator/VERSION b/samples/server/petstore/php-lumen/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/php-lumen/.openapi-generator/VERSION +++ b/samples/server/petstore/php-lumen/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-silex/OpenAPIServer/.openapi-generator/VERSION b/samples/server/petstore/php-silex/OpenAPIServer/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/php-silex/OpenAPIServer/.openapi-generator/VERSION +++ b/samples/server/petstore/php-silex/OpenAPIServer/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-slim/.openapi-generator/VERSION b/samples/server/petstore/php-slim/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/php-slim/.openapi-generator/VERSION +++ b/samples/server/petstore/php-slim/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION b/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-ze-ph/.openapi-generator/VERSION b/samples/server/petstore/php-ze-ph/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/php-ze-ph/.openapi-generator/VERSION +++ b/samples/server/petstore/php-ze-ph/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java index 200571e46f5..9e2703747a3 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java index 50a795a4834..a7858258322 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 4001c758942..831a3ef7016 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java index e28e479cb12..d4bdba6d8d1 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java index 7ad7e7a8e77..b4ec8f4ed00 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java index bbec568a4a1..59364abcfbc 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java index 491911c3bd8..01e92d3abec 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java index 67b6c917770..3773cff1b62 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 2296062bc26..1ba2000a46b 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java index 1eed442687b..f9def84ffc9 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java index 52d5b5eb80b..88c0d12e9b6 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java index 208c959c9a1..5c0e0aff2a8 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/spring-mvc/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java index 3208591b152..ae56d42d508 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java index 5162b022f20..318dd09fa7e 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 4ff2855742b..9e44a58698b 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java index 370eb74089c..1d3c60abb94 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java index 8dad1488c66..b052ab392c0 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java index 95c11daa288..ece84b50e5c 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java index 3208591b152..ae56d42d508 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java index 5162b022f20..318dd09fa7e 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 4ff2855742b..9e44a58698b 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java index 370eb74089c..1d3c60abb94 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java index 8dad1488c66..b052ab392c0 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java index 95c11daa288..ece84b50e5c 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index f59b48e0d80..eb024c9ea0f 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java index e305846684c..9a0eed03978 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 6cc14a31808..fd2741a860b 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java index d54f8f5502f..572b10c9311 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java index 9ed8c53d429..8942a0faf2b 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java index 3cfd9cf707c..39eb0d9a6c0 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION b/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java index 3208591b152..ae56d42d508 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index 5162b022f20..318dd09fa7e 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 4ff2855742b..9e44a58698b 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java index 370eb74089c..1d3c60abb94 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java index 8dad1488c66..b052ab392c0 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java index 95c11daa288..ece84b50e5c 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java index 63e4f575496..c7a9cad5f89 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index cf22349d94d..5be814af9b4 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 4b9b6a8beff..a65c7cbac74 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index 00a35ef3810..eb29a6c04e8 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java index edfe60f324d..2d7dcf179f7 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java index b45e6afcc42..63961ea1188 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION b/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java index 353f2ed77b1..7f97ef68a9d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java index e5b842a97be..07695c6ec81 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 121b8b7c401..826924b7655 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java index 96c92eee137..495d1027398 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java index 38dfb5cf45c..5fac0dddba5 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java index 3fab112c70d..6ead7c75e2f 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION b/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java index 491911c3bd8..01e92d3abec 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index 98dfec25137..eaa3162bec9 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 2296062bc26..1ba2000a46b 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java index 227710d64cd..487002c0e1e 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java index 52d5b5eb80b..88c0d12e9b6 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java index 208c959c9a1..5c0e0aff2a8 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION b/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java index 00a115c4e42..87185f50d1b 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java index afaba765c2c..73ae14b0900 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java index c4615f35bd1..46c60a1d118 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java index a8bc0a1f3b6..b5804d2e066 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java index c34b3740c8d..d224f1ffef2 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java index 1b0bed4ed86..8545012843c 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/.openapi-generator/VERSION b/samples/server/petstore/springboot/.openapi-generator/VERSION index 83a328a9227..2f81801b794 100644 --- a/samples/server/petstore/springboot/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java index 491911c3bd8..01e92d3abec 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java index 4962c13375f..57721a746fe 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 2296062bc26..1ba2000a46b 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index 1eed442687b..f9def84ffc9 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java index 52d5b5eb80b..88c0d12e9b6 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java index 208c959c9a1..5c0e0aff2a8 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.0-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ From ac85c8f901f921f8ee6f4b294bc4e16d1e17f066 Mon Sep 17 00:00:00 2001 From: Gustaf Barkeling Date: Sat, 10 Aug 2019 09:45:41 +0100 Subject: [PATCH 72/75] Fix #3604 by adding undefined as return type to headers and credentials methods in runtime.ts (#3605) --- .../src/main/resources/typescript-fetch/runtime.mustache | 4 ++-- .../petstore/typescript-fetch/builds/default/src/runtime.ts | 4 ++-- .../typescript-fetch/builds/es6-target/src/runtime.ts | 4 ++-- .../builds/multiple-parameters/src/runtime.ts | 4 ++-- .../typescript-fetch/builds/with-interfaces/src/runtime.ts | 4 ++-- .../typescript-fetch/builds/with-npm-version/src/runtime.ts | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache index 942f65369c8..0b42e5e8629 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache @@ -171,11 +171,11 @@ export class Configuration { return undefined; } - get headers(): HTTPHeaders { + get headers(): HTTPHeaders | undefined { return this.configuration.headers; } - get credentials(): RequestCredentials { + get credentials(): RequestCredentials | undefined { return this.configuration.credentials; } } diff --git a/samples/client/petstore/typescript-fetch/builds/default/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/default/src/runtime.ts index 48e54ca6eb2..eec2074ab69 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/src/runtime.ts @@ -182,11 +182,11 @@ export class Configuration { return undefined; } - get headers(): HTTPHeaders { + get headers(): HTTPHeaders | undefined { return this.configuration.headers; } - get credentials(): RequestCredentials { + get credentials(): RequestCredentials | undefined { return this.configuration.credentials; } } diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts index 48e54ca6eb2..eec2074ab69 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/src/runtime.ts @@ -182,11 +182,11 @@ export class Configuration { return undefined; } - get headers(): HTTPHeaders { + get headers(): HTTPHeaders | undefined { return this.configuration.headers; } - get credentials(): RequestCredentials { + get credentials(): RequestCredentials | undefined { return this.configuration.credentials; } } diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/runtime.ts index 48e54ca6eb2..eec2074ab69 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/src/runtime.ts @@ -182,11 +182,11 @@ export class Configuration { return undefined; } - get headers(): HTTPHeaders { + get headers(): HTTPHeaders | undefined { return this.configuration.headers; } - get credentials(): RequestCredentials { + get credentials(): RequestCredentials | undefined { return this.configuration.credentials; } } diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/runtime.ts index 48e54ca6eb2..eec2074ab69 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/src/runtime.ts @@ -182,11 +182,11 @@ export class Configuration { return undefined; } - get headers(): HTTPHeaders { + get headers(): HTTPHeaders | undefined { return this.configuration.headers; } - get credentials(): RequestCredentials { + get credentials(): RequestCredentials | undefined { return this.configuration.credentials; } } diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts index 48e54ca6eb2..eec2074ab69 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/src/runtime.ts @@ -182,11 +182,11 @@ export class Configuration { return undefined; } - get headers(): HTTPHeaders { + get headers(): HTTPHeaders | undefined { return this.configuration.headers; } - get credentials(): RequestCredentials { + get credentials(): RequestCredentials | undefined { return this.configuration.credentials; } } From 42d6420400a036fd2215a7b19f57e3292fdf394d Mon Sep 17 00:00:00 2001 From: Michal Foksa Date: Sun, 11 Aug 2019 04:15:40 +0200 Subject: [PATCH 73/75] Feature/mustache lambda tests (#3447) * Mustache lambda tests * If lambda key is already taken in additionalProperties, throw an exception. * Test whether common lambdas are registered in additionalProperties. --- .../openapitools/codegen/DefaultCodegen.java | 9 +-- .../codegen/DefaultCodegenTest.java | 37 +++++++++-- .../mustache/CamelCaseLambdaTest.java | 63 +++++++++++++++++++ .../mustache/IndentedLambdaTest.java | 35 +++++++++++ .../templating/mustache/LambdaTest.java | 44 +++++++++++++ .../mustache/LowercaseLambdaTest.java | 49 +++++++++++++++ .../mustache/OnChangeLambdaTest.java | 42 +++++++++++++ .../mustache/TitlecaseLambdaTest.java | 28 +++++++++ .../mustache/UppercaseLambdaTest.java | 18 ++++++ 9 files changed, 315 insertions(+), 10 deletions(-) create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/CamelCaseLambdaTest.java create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/IndentedLambdaTest.java create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/LambdaTest.java create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/LowercaseLambdaTest.java create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/OnChangeLambdaTest.java create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/TitlecaseLambdaTest.java create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/UppercaseLambdaTest.java diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 90ae91674c1..94b29ee1bac 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -240,13 +240,10 @@ public class DefaultCodegen implements CodegenConfig { } if (additionalProperties.containsKey("lambda")) { - LOGGER.warn("A property named 'lambda' already exists. Mustache lambdas renamed from 'lambda' to '_lambda'. " + - "You'll likely need to use a custom template, " + - "see https://github.com/OpenAPITools/openapi-generator/blob/master/docs/templating.md. "); - additionalProperties.put("_lambda", lambdas); - } else { - additionalProperties.put("lambda", lambdas); + LOGGER.error("A property called 'lambda' already exists in additionalProperties"); + throw new RuntimeException("A property called 'lambda' already exists in additionalProperties"); } + additionalProperties.put("lambda", lambdas); } // override with any special post-processing for all models diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java index 167177017f5..9dbb5bb5c13 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java @@ -18,6 +18,8 @@ package org.openapitools.codegen; import com.google.common.collect.Sets; +import com.samskivert.mustache.Mustache.Lambda; + import io.swagger.parser.OpenAPIParser; import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.OpenAPI; @@ -30,14 +32,19 @@ import io.swagger.v3.oas.models.parameters.RequestBody; import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.oas.models.responses.ApiResponses; import io.swagger.v3.parser.core.models.ParseOptions; -import org.openapitools.codegen.languages.features.CXFServerFeatures; + +import org.openapitools.codegen.templating.mustache.CamelCaseLambda; +import org.openapitools.codegen.templating.mustache.IndentedLambda; +import org.openapitools.codegen.templating.mustache.LowercaseLambda; +import org.openapitools.codegen.templating.mustache.TitlecaseLambda; +import org.openapitools.codegen.templating.mustache.UppercaseLambda; import org.openapitools.codegen.utils.ModelUtils; import org.testng.Assert; import org.testng.annotations.Test; -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.assertTrue; + import java.util.*; import java.util.stream.Collectors; @@ -888,6 +895,7 @@ public class DefaultCodegenTest { Assert.assertEquals(codegenModel.vars.size(), 1); } + @Test public void modelWithSuffixDoNotContainInheritedVars() { DefaultCodegen codegen = new DefaultCodegen(); @@ -903,4 +911,25 @@ public class DefaultCodegenTest { Assert.assertEquals(codegenModel.vars.size(), 1); } + @Test + @SuppressWarnings("unchecked") + public void commonLambdasRegistrationTest() { + + DefaultCodegen codegen = new DefaultCodegen(); + Object lambdasObj = codegen.additionalProperties.get("lambda"); + + assertNotNull(lambdasObj, "Expecting lambda in additionalProperties"); + + Map lambdas = (Map) lambdasObj; + + assertTrue(lambdas.get("lowercase") instanceof LowercaseLambda, "Expecting LowercaseLambda class"); + assertTrue(lambdas.get("uppercase") instanceof UppercaseLambda, "Expecting UppercaseLambda class"); + assertTrue(lambdas.get("titlecase") instanceof TitlecaseLambda, "Expecting TitlecaseLambda class"); + assertTrue(lambdas.get("camelcase") instanceof CamelCaseLambda, "Expecting CamelCaseLambda class"); + assertTrue(lambdas.get("indented") instanceof IndentedLambda, "Expecting IndentedLambda class"); + assertTrue(lambdas.get("indented_8") instanceof IndentedLambda, "Expecting IndentedLambda class"); + assertTrue(lambdas.get("indented_12") instanceof IndentedLambda, "Expecting IndentedLambda class"); + assertTrue(lambdas.get("indented_16") instanceof IndentedLambda, "Expecting IndentedLambda class"); + } + } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/CamelCaseLambdaTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/CamelCaseLambdaTest.java new file mode 100644 index 00000000000..f984adcb0f8 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/CamelCaseLambdaTest.java @@ -0,0 +1,63 @@ +package org.openapitools.codegen.templating.mustache; + +import static org.mockito.AdditionalAnswers.returnsFirstArg; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.when; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Map; + +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.openapitools.codegen.CodegenConfig; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class CamelCaseLambdaTest extends LambdaTest { + + @Mock + CodegenConfig generator; + + @BeforeMethod + public void setup() { + MockitoAnnotations.initMocks(this); + } + + @Test + public void camelCaseTest() { + // Given + Map ctx = context("camelcase", new CamelCaseLambda()); + + // When & Then + test("inputText", "{{#camelcase}}Input-text{{/camelcase}}", ctx); + } + + @Test + public void camelCaseReservedWordTest() { + // Given + Map ctx = context("camelcase", new CamelCaseLambda().generator(generator)); + + when(generator.sanitizeName(anyString())).then(returnsFirstArg()); + when(generator.reservedWords()).thenReturn(new HashSet(Arrays.asList("reservedWord"))); + when(generator.escapeReservedWord("reservedWord")).thenReturn("escapedReservedWord"); + + // When & Then + test("escapedReservedWord", "{{#camelcase}}reserved-word{{/camelcase}}", ctx); + } + + @Test + public void camelCaseEscapeParamTest() { + // Given + Map ctx = context("camelcase", new CamelCaseLambda() + .generator(generator).escapeAsParamName(true)); + + when(generator.sanitizeName(anyString())).then(returnsFirstArg()); + when(generator.reservedWords()).thenReturn(new HashSet()); + when(generator.toParamName("inputText")).thenReturn("inputTextAsParam"); + + // When & Then + test("inputTextAsParam", "{{#camelcase}}Input_text{{/camelcase}}", ctx); + } + +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/IndentedLambdaTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/IndentedLambdaTest.java new file mode 100644 index 00000000000..51a4eeda0a3 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/IndentedLambdaTest.java @@ -0,0 +1,35 @@ +package org.openapitools.codegen.templating.mustache; + +import java.util.Map; + +import org.testng.annotations.Test; + +public class IndentedLambdaTest extends LambdaTest { + + String lineSeparator = System.lineSeparator(); + + @Test + public void defaultIndentTest() { + // Given + Map ctx = context("indented", new IndentedLambda()); + String lineSeparator = System.lineSeparator(); + + // When & Then + // IndentedLambda applies indentation from second line on of a template. + test("first line" + lineSeparator + " second line", + "{{#indented}}first line" + lineSeparator +"second line{{/indented}}", ctx); + } + + @Test + public void indentedCountTest() { + // Given + Map ctx = context("indented", new IndentedLambda(8, " ")); + + // When & Then + // IndentedLambda applies indentation from second line on of a template. + test("first line" + lineSeparator + " second line", + "{{#indented}}first line" + lineSeparator +"second line{{/indented}}", ctx); + } + + +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/LambdaTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/LambdaTest.java new file mode 100644 index 00000000000..fbaed952eff --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/LambdaTest.java @@ -0,0 +1,44 @@ +package org.openapitools.codegen.templating.mustache; + +import static org.testng.Assert.assertEquals; + +import java.util.HashMap; +import java.util.Map; + +import com.samskivert.mustache.Mustache; + +/** + * Simple framework to test Mustache Lambdas. It avoids + *
compiler->compile->execute->assert
+ * boilerplate code. + * + * Inspired by Jmustache SharedTests.java + * + */ +public abstract class LambdaTest { + + protected String execute(String template, Object ctx) { + return execute(Mustache.compiler(), template, ctx); + } + + protected String execute(Mustache.Compiler compiler, String template, Object ctx) { + return compiler.compile(template).execute(ctx); + } + + protected void test(String expected, String template, Map ctx) { + test(Mustache.compiler(), expected, template, ctx); + } + + protected void test(Mustache.Compiler compiler, String expected,String template, Map ctx) { + assertEquals(execute(compiler, template, ctx), expected); + } + + protected static Map context(Object... data) { + Map ctx = new HashMap(); + for (int ii = 0; ii < data.length; ii += 2) { + ctx.put(data[ii].toString(), data[ii + 1]); + } + return ctx; + } + +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/LowercaseLambdaTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/LowercaseLambdaTest.java new file mode 100644 index 00000000000..87ade0caa70 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/LowercaseLambdaTest.java @@ -0,0 +1,49 @@ +package org.openapitools.codegen.templating.mustache; + +import static org.mockito.AdditionalAnswers.returnsFirstArg; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.when; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Map; + +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.openapitools.codegen.CodegenConfig; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class LowercaseLambdaTest extends LambdaTest { + + @Mock + CodegenConfig generator; + + @BeforeMethod + public void setup() { + MockitoAnnotations.initMocks(this); + } + + @Test + public void lowercaseTest() { + // Given + Map ctx = context("lowercase", new LowercaseLambda()); + + // When & Then + test("input text", "{{#lowercase}}InPut Text{{/lowercase}}", ctx); + } + + @Test + public void lowercaseReservedWordTest() { + // Given + Map ctx = context("lowercase", new LowercaseLambda().generator(generator)); + + when(generator.sanitizeName(anyString())).then(returnsFirstArg()); + when(generator.reservedWords()).thenReturn(new HashSet(Arrays.asList("reserved"))); + when(generator.escapeReservedWord("reserved")).thenReturn("escaped-reserved"); + + // When & Then + test("escaped-reserved", "{{#lowercase}}rEservEd{{/lowercase}}", ctx); + } + +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/OnChangeLambdaTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/OnChangeLambdaTest.java new file mode 100644 index 00000000000..175524c0d28 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/OnChangeLambdaTest.java @@ -0,0 +1,42 @@ +package org.openapitools.codegen.templating.mustache; + +import java.util.Map; + +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class OnChangeLambdaTest extends LambdaTest { + + private Map ctx; + + // OnChangeLambda holds internal state it is important that context is + // reinitialize before each test. + @BeforeMethod + public void setup() { + ctx = context("onchange", new OnChangeLambda()); + } + + @Test + public void firstValueIsReturnedTest() { + // Given + + // When & Then + test("first", "{{#onchange}}first{{/onchange}}", ctx); + } + + @Test + public void repeatingValueReturnedOnFirstOccurrenceTest() { + // Given + + // When & Then + test("First", "{{#onchange}}First{{/onchange}}", ctx); + test("", "{{#onchange}}First{{/onchange}}", ctx); + + test("Another", "{{#onchange}}Another{{/onchange}}", ctx); + test("", "{{#onchange}}Another{{/onchange}}", ctx); + test("", "{{#onchange}}Another{{/onchange}}", ctx); + + test("First", "{{#onchange}}First{{/onchange}}", ctx); + } + +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/TitlecaseLambdaTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/TitlecaseLambdaTest.java new file mode 100644 index 00000000000..2b3f632e9dd --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/TitlecaseLambdaTest.java @@ -0,0 +1,28 @@ +package org.openapitools.codegen.templating.mustache; + +import java.util.Map; + +import org.testng.annotations.Test; + +public class TitlecaseLambdaTest extends LambdaTest { + + @Test + public void titlecaseTest() { + // Given + Map ctx = context("titlecase", new TitlecaseLambda()); + + // When & Then + test("Once Upon A Time", "{{#titlecase}}once upon a time{{/titlecase}}", ctx); + } + + @Test + public void titlecaseWithDelimiterTest() { + // Given + Map ctx = context("titlecase", new TitlecaseLambda("-")); + + // When & Then + test("Once-Upon-A-Time", "{{#titlecase}}once-upon-a-time{{/titlecase}}", ctx); + } + + +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/UppercaseLambdaTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/UppercaseLambdaTest.java new file mode 100644 index 00000000000..ebd12454ce6 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/templating/mustache/UppercaseLambdaTest.java @@ -0,0 +1,18 @@ +package org.openapitools.codegen.templating.mustache; + +import java.util.Map; + +import org.testng.annotations.Test; + +public class UppercaseLambdaTest extends LambdaTest { + + @Test + public void uppercaseTest() { + // Given + Map ctx = context("uppercase", new UppercaseLambda()); + + // When & Then + test("INPUT TEXT", "{{#uppercase}}InPut Text{{/uppercase}}", ctx); + } + +} From 22d022b2d562c8c82f8d036fdf437c810acb57cc Mon Sep 17 00:00:00 2001 From: "Juang, Yi-Lin" Date: Sun, 11 Aug 2019 10:57:36 +0800 Subject: [PATCH 74/75] [aspnetcore] Add TypeConverter for enum string conversion (#3557) * Add TypeConverter for enum --- .../languages/AspNetCoreServerCodegen.java | 1 + .../aspnetcore/2.1/enumClass.mustache | 3 +- .../resources/aspnetcore/2.1/model.mustache | 2 ++ .../aspnetcore/2.1/typeConverter.mustache | 33 +++++++++++++++++++ .../aspnetcore/.openapi-generator/VERSION | 2 +- .../Org.OpenAPITools/Controllers/PetApi.cs | 32 ++++++++---------- .../Org.OpenAPITools/Controllers/StoreApi.cs | 24 ++++++-------- .../Org.OpenAPITools/Controllers/UserApi.cs | 23 +++++-------- .../Converters/CustomEnumConverter.cs | 33 +++++++++++++++++++ .../Org.OpenAPITools/Models/ApiResponse.cs | 8 +++-- .../src/Org.OpenAPITools/Models/Category.cs | 8 +++-- .../src/Org.OpenAPITools/Models/Order.cs | 29 ++++++++-------- .../src/Org.OpenAPITools/Models/Pet.cs | 9 +++-- .../src/Org.OpenAPITools/Models/Tag.cs | 8 +++-- .../src/Org.OpenAPITools/Models/User.cs | 14 ++++---- 15 files changed, 149 insertions(+), 80 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/aspnetcore/2.1/typeConverter.mustache create mode 100644 samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java index d7d1f3e6da4..a1d0889b25c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java @@ -327,6 +327,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen { supportingFiles.add(new SupportingFile("Solution.mustache", "", packageName + ".sln")); supportingFiles.add(new SupportingFile("gitignore", packageFolder, ".gitignore")); supportingFiles.add(new SupportingFile("validateModel.mustache", packageFolder + File.separator + "Attributes", "ValidateModelStateAttribute.cs")); + supportingFiles.add(new SupportingFile("typeConverter.mustache", packageFolder + File.separator + "Converters", "CustomEnumConverter.cs")); supportingFiles.add(new SupportingFile("Project.csproj.mustache", packageFolder, packageName + ".csproj")); if (!isLibrary) { supportingFiles.add(new SupportingFile("Dockerfile.mustache", packageFolder, "Dockerfile")); diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/enumClass.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/enumClass.mustache index a8a68b99844..8a932b5ade6 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/enumClass.mustache @@ -5,7 +5,8 @@ {{#description}} /// {{{description}}} {{/description}} - {{#allowableValues}}{{#enumVars}}{{#-first}}{{#isString}}[JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]{{/isString}}{{/-first}}{{/enumVars}}{{/allowableValues}} + {{#allowableValues}}{{#enumVars}}{{#-first}}{{#isString}}[TypeConverter(typeof(CustomEnumConverter<{{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}>))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]{{/isString}}{{/-first}}{{/enumVars}}{{/allowableValues}} public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#allowableValues}}{{#enumVars}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/model.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/model.mustache index e198e2447e7..bf1cb3902fc 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/model.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/model.mustache @@ -3,9 +3,11 @@ using System; using System.Linq; using System.Text; using System.Collections.Generic; +using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using Newtonsoft.Json; +using {{packageName}}.Converters; {{#models}} {{#model}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/typeConverter.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/typeConverter.mustache new file mode 100644 index 00000000000..dadf3a0260d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/typeConverter.mustache @@ -0,0 +1,33 @@ +using System; +using System.ComponentModel; +using System.Globalization; +using Newtonsoft.Json; + +namespace {{packageName}}.Converters +{ + /// + /// Custom string to enum converter + /// + public class CustomEnumConverter : TypeConverter + { + public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) + { + if (sourceType == typeof(string)) + { + return true; + } + return base.CanConvertFrom(context, sourceType); + } + + public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) + { + var s = value as string; + if (string.IsNullOrEmpty(s)) + { + return null; + } + + return JsonConvert.DeserializeObject(@"""" + value.ToString() + @""""); + } + } +} diff --git a/samples/server/petstore/aspnetcore/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore/.openapi-generator/VERSION index 06b5019af3f..83a328a9227 100644 --- a/samples/server/petstore/aspnetcore/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/PetApi.cs index 0df59c9002d..4a382880df2 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/PetApi.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/PetApi.cs @@ -16,8 +16,8 @@ using Swashbuckle.AspNetCore.SwaggerGen; using Newtonsoft.Json; using System.ComponentModel.DataAnnotations; using Org.OpenAPITools.Attributes; -using Org.OpenAPITools.Models; using Microsoft.AspNetCore.Authorization; +using Org.OpenAPITools.Models; namespace Org.OpenAPITools.Controllers { @@ -38,10 +38,10 @@ namespace Org.OpenAPITools.Controllers [SwaggerOperation("AddPet")] public virtual IActionResult AddPet([FromBody]Pet body) { + //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(405); - throw new NotImplementedException(); } @@ -55,12 +55,12 @@ namespace Org.OpenAPITools.Controllers [Route("/v2/pet/{petId}")] [ValidateModelState] [SwaggerOperation("DeletePet")] - public virtual IActionResult DeletePet([FromRoute][Required]long? petId, [FromHeader]string apiKey) + public virtual IActionResult DeletePet([FromRoute][Required]long petId, [FromHeader]string apiKey) { + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); - throw new NotImplementedException(); } @@ -78,12 +78,11 @@ namespace Org.OpenAPITools.Controllers [SwaggerResponse(statusCode: 200, type: typeof(List), description: "successful operation")] public virtual IActionResult FindPetsByStatus([FromQuery][Required()]List status) { + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(200, default(List)); - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); - string exampleJson = null; exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; @@ -109,12 +108,11 @@ namespace Org.OpenAPITools.Controllers [SwaggerResponse(statusCode: 200, type: typeof(List), description: "successful operation")] public virtual IActionResult FindPetsByTags([FromQuery][Required()]List tags) { + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(200, default(List)); - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); - string exampleJson = null; exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; @@ -140,17 +138,15 @@ namespace Org.OpenAPITools.Controllers [ValidateModelState] [SwaggerOperation("GetPetById")] [SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")] - public virtual IActionResult GetPetById([FromRoute][Required]long? petId) + public virtual IActionResult GetPetById([FromRoute][Required]long petId) { + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(200, default(Pet)); - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); - //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); - string exampleJson = null; exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; @@ -175,16 +171,14 @@ namespace Org.OpenAPITools.Controllers [SwaggerOperation("UpdatePet")] public virtual IActionResult UpdatePet([FromBody]Pet body) { + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); - //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); - //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(405); - throw new NotImplementedException(); } @@ -199,12 +193,12 @@ namespace Org.OpenAPITools.Controllers [Route("/v2/pet/{petId}")] [ValidateModelState] [SwaggerOperation("UpdatePetWithForm")] - public virtual IActionResult UpdatePetWithForm([FromRoute][Required]long? petId, [FromForm]string name, [FromForm]string status) + public virtual IActionResult UpdatePetWithForm([FromRoute][Required]long petId, [FromForm]string name, [FromForm]string status) { + //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(405); - throw new NotImplementedException(); } @@ -220,11 +214,11 @@ namespace Org.OpenAPITools.Controllers [ValidateModelState] [SwaggerOperation("UploadFile")] [SwaggerResponse(statusCode: 200, type: typeof(ApiResponse), description: "successful operation")] - public virtual IActionResult UploadFile([FromRoute][Required]long? petId, [FromForm]string additionalMetadata, [FromForm]System.IO.Stream file) + public virtual IActionResult UploadFile([FromRoute][Required]long petId, [FromForm]string additionalMetadata, [FromForm]System.IO.Stream file) { + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(200, default(ApiResponse)); - string exampleJson = null; exampleJson = "{\n \"code\" : 0,\n \"type\" : \"type\",\n \"message\" : \"message\"\n}"; diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/StoreApi.cs index a94c4a7c243..6fb3586c678 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/StoreApi.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/StoreApi.cs @@ -16,8 +16,8 @@ using Swashbuckle.AspNetCore.SwaggerGen; using Newtonsoft.Json; using System.ComponentModel.DataAnnotations; using Org.OpenAPITools.Attributes; -using Org.OpenAPITools.Models; using Microsoft.AspNetCore.Authorization; +using Org.OpenAPITools.Models; namespace Org.OpenAPITools.Controllers { @@ -40,13 +40,12 @@ namespace Org.OpenAPITools.Controllers [SwaggerOperation("DeleteOrder")] public virtual IActionResult DeleteOrder([FromRoute][Required]string orderId) { + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); - //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); - throw new NotImplementedException(); } @@ -60,17 +59,17 @@ namespace Org.OpenAPITools.Controllers [Authorize(Policy = "api_key")] [ValidateModelState] [SwaggerOperation("GetInventory")] - [SwaggerResponse(statusCode: 200, type: typeof(Dictionary), description: "successful operation")] + [SwaggerResponse(statusCode: 200, type: typeof(Dictionary), description: "successful operation")] public virtual IActionResult GetInventory() { - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(Dictionary)); + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode(200, default(Dictionary)); string exampleJson = null; var example = exampleJson != null - ? JsonConvert.DeserializeObject>(exampleJson) - : default(Dictionary); + ? JsonConvert.DeserializeObject>(exampleJson) + : default(Dictionary); //TODO: Change the data returned return new ObjectResult(example); } @@ -88,17 +87,15 @@ namespace Org.OpenAPITools.Controllers [ValidateModelState] [SwaggerOperation("GetOrderById")] [SwaggerResponse(statusCode: 200, type: typeof(Order), description: "successful operation")] - public virtual IActionResult GetOrderById([FromRoute][Required][Range(1, 5)]long? orderId) + public virtual IActionResult GetOrderById([FromRoute][Required][Range(1, 5)]long orderId) { + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(200, default(Order)); - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); - //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); - string exampleJson = null; exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; @@ -123,12 +120,11 @@ namespace Org.OpenAPITools.Controllers [SwaggerResponse(statusCode: 200, type: typeof(Order), description: "successful operation")] public virtual IActionResult PlaceOrder([FromBody]Order body) { + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(200, default(Order)); - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); - string exampleJson = null; exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/UserApi.cs index c3a29ff7aed..45ebf16ac79 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/UserApi.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Controllers/UserApi.cs @@ -16,8 +16,8 @@ using Swashbuckle.AspNetCore.SwaggerGen; using Newtonsoft.Json; using System.ComponentModel.DataAnnotations; using Org.OpenAPITools.Attributes; -using Org.OpenAPITools.Models; using Microsoft.AspNetCore.Authorization; +using Org.OpenAPITools.Models; namespace Org.OpenAPITools.Controllers { @@ -39,10 +39,10 @@ namespace Org.OpenAPITools.Controllers [SwaggerOperation("CreateUser")] public virtual IActionResult CreateUser([FromBody]User body) { + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(0); - throw new NotImplementedException(); } @@ -57,10 +57,10 @@ namespace Org.OpenAPITools.Controllers [SwaggerOperation("CreateUsersWithArrayInput")] public virtual IActionResult CreateUsersWithArrayInput([FromBody]List body) { + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(0); - throw new NotImplementedException(); } @@ -75,10 +75,10 @@ namespace Org.OpenAPITools.Controllers [SwaggerOperation("CreateUsersWithListInput")] public virtual IActionResult CreateUsersWithListInput([FromBody]List body) { + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(0); - throw new NotImplementedException(); } @@ -95,13 +95,12 @@ namespace Org.OpenAPITools.Controllers [SwaggerOperation("DeleteUser")] public virtual IActionResult DeleteUser([FromRoute][Required]string username) { + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); - //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); - throw new NotImplementedException(); } @@ -119,15 +118,13 @@ namespace Org.OpenAPITools.Controllers [SwaggerResponse(statusCode: 200, type: typeof(User), description: "successful operation")] public virtual IActionResult GetUserByName([FromRoute][Required]string username) { + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(200, default(User)); - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); - //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); - string exampleJson = null; exampleJson = "{\n \"firstName\" : \"firstName\",\n \"lastName\" : \"lastName\",\n \"password\" : \"password\",\n \"userStatus\" : 6,\n \"phone\" : \"phone\",\n \"id\" : 0,\n \"email\" : \"email\",\n \"username\" : \"username\"\n}"; exampleJson = "\n 123456789\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n 123\n"; @@ -153,12 +150,11 @@ namespace Org.OpenAPITools.Controllers [SwaggerResponse(statusCode: 200, type: typeof(string), description: "successful operation")] public virtual IActionResult LoginUser([FromQuery][Required()]string username, [FromQuery][Required()]string password) { + //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(200, default(string)); - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); - string exampleJson = null; var example = exampleJson != null @@ -178,10 +174,10 @@ namespace Org.OpenAPITools.Controllers [SwaggerOperation("LogoutUser")] public virtual IActionResult LogoutUser() { + //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(0); - throw new NotImplementedException(); } @@ -199,13 +195,12 @@ namespace Org.OpenAPITools.Controllers [SwaggerOperation("UpdateUser")] public virtual IActionResult UpdateUser([FromRoute][Required]string username, [FromBody]User body) { + //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(400); - //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... // return StatusCode(404); - throw new NotImplementedException(); } } diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs new file mode 100644 index 00000000000..85bd3167b28 --- /dev/null +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs @@ -0,0 +1,33 @@ +using System; +using System.ComponentModel; +using System.Globalization; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Converters +{ + /// + /// Custom string to enum converter + /// + public class CustomEnumConverter : TypeConverter + { + public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) + { + if (sourceType == typeof(string)) + { + return true; + } + return base.CanConvertFrom(context, sourceType); + } + + public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) + { + var s = value as string; + if (string.IsNullOrEmpty(s)) + { + return null; + } + + return JsonConvert.DeserializeObject(@"""" + value.ToString() + @""""); + } + } +} diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/ApiResponse.cs index a1e0948c3b2..5aa1a66468d 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/ApiResponse.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/ApiResponse.cs @@ -12,9 +12,11 @@ using System; using System.Linq; using System.Text; using System.Collections.Generic; +using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using Newtonsoft.Json; +using Org.OpenAPITools.Converters; namespace Org.OpenAPITools.Models { @@ -28,7 +30,7 @@ namespace Org.OpenAPITools.Models /// Gets or Sets Code /// [DataMember(Name="code", EmitDefaultValue=false)] - public int? Code { get; set; } + public int Code { get; set; } /// /// Gets or Sets Type @@ -91,7 +93,7 @@ namespace Org.OpenAPITools.Models return ( Code == other.Code || - Code != null && + Code.Equals(other.Code) ) && ( @@ -116,7 +118,7 @@ namespace Org.OpenAPITools.Models { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Code != null) + hashCode = hashCode * 59 + Code.GetHashCode(); if (Type != null) hashCode = hashCode * 59 + Type.GetHashCode(); diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Category.cs index 820baff9121..79229996094 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Category.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Category.cs @@ -12,9 +12,11 @@ using System; using System.Linq; using System.Text; using System.Collections.Generic; +using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using Newtonsoft.Json; +using Org.OpenAPITools.Converters; namespace Org.OpenAPITools.Models { @@ -28,7 +30,7 @@ namespace Org.OpenAPITools.Models /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Name @@ -84,7 +86,7 @@ namespace Org.OpenAPITools.Models return ( Id == other.Id || - Id != null && + Id.Equals(other.Id) ) && ( @@ -104,7 +106,7 @@ namespace Org.OpenAPITools.Models { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Id != null) + hashCode = hashCode * 59 + Id.GetHashCode(); if (Name != null) hashCode = hashCode * 59 + Name.GetHashCode(); diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Order.cs index 5312b28df3c..c045601e12e 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Order.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Order.cs @@ -12,9 +12,11 @@ using System; using System.Linq; using System.Text; using System.Collections.Generic; +using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using Newtonsoft.Json; +using Org.OpenAPITools.Converters; namespace Org.OpenAPITools.Models { @@ -28,30 +30,31 @@ namespace Org.OpenAPITools.Models /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets PetId /// [DataMember(Name="petId", EmitDefaultValue=false)] - public long? PetId { get; set; } + public long PetId { get; set; } /// /// Gets or Sets Quantity /// [DataMember(Name="quantity", EmitDefaultValue=false)] - public int? Quantity { get; set; } + public int Quantity { get; set; } /// /// Gets or Sets ShipDate /// [DataMember(Name="shipDate", EmitDefaultValue=false)] - public DateTime? ShipDate { get; set; } + public DateTime ShipDate { get; set; } /// /// Order Status /// /// Order Status + [TypeConverter(typeof(CustomEnumConverter))] [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum StatusEnum { @@ -86,7 +89,7 @@ namespace Org.OpenAPITools.Models /// Gets or Sets Complete /// [DataMember(Name="complete", EmitDefaultValue=false)] - public bool? Complete { get; set; } + public bool Complete { get; set; } = false; /// /// Returns the string presentation of the object @@ -140,17 +143,17 @@ namespace Org.OpenAPITools.Models return ( Id == other.Id || - Id != null && + Id.Equals(other.Id) ) && ( PetId == other.PetId || - PetId != null && + PetId.Equals(other.PetId) ) && ( Quantity == other.Quantity || - Quantity != null && + Quantity.Equals(other.Quantity) ) && ( @@ -165,7 +168,7 @@ namespace Org.OpenAPITools.Models ) && ( Complete == other.Complete || - Complete != null && + Complete.Equals(other.Complete) ); } @@ -180,17 +183,17 @@ namespace Org.OpenAPITools.Models { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Id != null) + hashCode = hashCode * 59 + Id.GetHashCode(); - if (PetId != null) + hashCode = hashCode * 59 + PetId.GetHashCode(); - if (Quantity != null) + hashCode = hashCode * 59 + Quantity.GetHashCode(); if (ShipDate != null) hashCode = hashCode * 59 + ShipDate.GetHashCode(); hashCode = hashCode * 59 + Status.GetHashCode(); - if (Complete != null) + hashCode = hashCode * 59 + Complete.GetHashCode(); return hashCode; } diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Pet.cs index 5ed8a481e97..a5bc9faa07e 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Pet.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Pet.cs @@ -12,9 +12,11 @@ using System; using System.Linq; using System.Text; using System.Collections.Generic; +using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using Newtonsoft.Json; +using Org.OpenAPITools.Converters; namespace Org.OpenAPITools.Models { @@ -28,7 +30,7 @@ namespace Org.OpenAPITools.Models /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Category @@ -60,6 +62,7 @@ namespace Org.OpenAPITools.Models /// pet status in the store /// /// pet status in the store + [TypeConverter(typeof(CustomEnumConverter))] [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum StatusEnum { @@ -142,7 +145,7 @@ namespace Org.OpenAPITools.Models return ( Id == other.Id || - Id != null && + Id.Equals(other.Id) ) && ( @@ -184,7 +187,7 @@ namespace Org.OpenAPITools.Models { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Id != null) + hashCode = hashCode * 59 + Id.GetHashCode(); if (Category != null) hashCode = hashCode * 59 + Category.GetHashCode(); diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Tag.cs index 8811f8caa90..223b3ac3af5 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Tag.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Tag.cs @@ -12,9 +12,11 @@ using System; using System.Linq; using System.Text; using System.Collections.Generic; +using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using Newtonsoft.Json; +using Org.OpenAPITools.Converters; namespace Org.OpenAPITools.Models { @@ -28,7 +30,7 @@ namespace Org.OpenAPITools.Models /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Name @@ -84,7 +86,7 @@ namespace Org.OpenAPITools.Models return ( Id == other.Id || - Id != null && + Id.Equals(other.Id) ) && ( @@ -104,7 +106,7 @@ namespace Org.OpenAPITools.Models { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Id != null) + hashCode = hashCode * 59 + Id.GetHashCode(); if (Name != null) hashCode = hashCode * 59 + Name.GetHashCode(); diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/User.cs index f36f2e6a5c2..dc5595815cd 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/User.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/User.cs @@ -12,9 +12,11 @@ using System; using System.Linq; using System.Text; using System.Collections.Generic; +using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using Newtonsoft.Json; +using Org.OpenAPITools.Converters; namespace Org.OpenAPITools.Models { @@ -28,7 +30,7 @@ namespace Org.OpenAPITools.Models /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; set; } + public long Id { get; set; } /// /// Gets or Sets Username @@ -71,7 +73,7 @@ namespace Org.OpenAPITools.Models /// /// User Status [DataMember(Name="userStatus", EmitDefaultValue=false)] - public int? UserStatus { get; set; } + public int UserStatus { get; set; } /// /// Returns the string presentation of the object @@ -127,7 +129,7 @@ namespace Org.OpenAPITools.Models return ( Id == other.Id || - Id != null && + Id.Equals(other.Id) ) && ( @@ -162,7 +164,7 @@ namespace Org.OpenAPITools.Models ) && ( UserStatus == other.UserStatus || - UserStatus != null && + UserStatus.Equals(other.UserStatus) ); } @@ -177,7 +179,7 @@ namespace Org.OpenAPITools.Models { var hashCode = 41; // Suitable nullity checks etc, of course :) - if (Id != null) + hashCode = hashCode * 59 + Id.GetHashCode(); if (Username != null) hashCode = hashCode * 59 + Username.GetHashCode(); @@ -191,7 +193,7 @@ namespace Org.OpenAPITools.Models hashCode = hashCode * 59 + Password.GetHashCode(); if (Phone != null) hashCode = hashCode * 59 + Phone.GetHashCode(); - if (UserStatus != null) + hashCode = hashCode * 59 + UserStatus.GetHashCode(); return hashCode; } From 01222268e8a2feeec5286626247462522efa01df Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 11 Aug 2019 18:56:47 +0800 Subject: [PATCH 75/75] update samples --- modules/openapi-generator-cli/pom.xml | 2 +- modules/openapi-generator-core/pom.xml | 2 +- modules/openapi-generator-gradle-plugin/gradle.properties | 2 +- modules/openapi-generator-gradle-plugin/pom.xml | 2 +- modules/openapi-generator-maven-plugin/pom.xml | 2 +- modules/openapi-generator-online/pom.xml | 2 +- modules/openapi-generator/pom.xml | 2 +- pom.xml | 2 +- samples/client/petstore/R/.openapi-generator/VERSION | 2 +- samples/client/petstore/apex/.openapi-generator/VERSION | 2 +- .../csharp-netcore/OpenAPIClient/.openapi-generator/VERSION | 2 +- .../csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION | 2 +- .../petstore/csharp/OpenAPIClient/.openapi-generator/VERSION | 2 +- samples/client/petstore/elixir/.openapi-generator/VERSION | 2 +- .../petstore/go/go-petstore-withXml/.openapi-generator/VERSION | 2 +- .../client/petstore/go/go-petstore/.openapi-generator/VERSION | 2 +- samples/client/petstore/groovy/.openapi-generator/VERSION | 2 +- .../petstore/haskell-http-client/.openapi-generator/VERSION | 2 +- samples/client/petstore/java/feign/.openapi-generator/VERSION | 2 +- .../client/petstore/java/feign10x/.openapi-generator/VERSION | 2 +- .../petstore/java/google-api-client/.openapi-generator/VERSION | 2 +- samples/client/petstore/java/jersey1/.openapi-generator/VERSION | 2 +- .../petstore/java/jersey2-java6/.openapi-generator/VERSION | 2 +- .../petstore/java/jersey2-java8/.openapi-generator/VERSION | 2 +- samples/client/petstore/java/jersey2/.openapi-generator/VERSION | 2 +- samples/client/petstore/java/native/.openapi-generator/VERSION | 2 +- .../java/okhttp-gson-parcelableModel/.openapi-generator/VERSION | 2 +- .../client/petstore/java/okhttp-gson/.openapi-generator/VERSION | 2 +- .../petstore/java/rest-assured/.openapi-generator/VERSION | 2 +- .../client/petstore/java/resteasy/.openapi-generator/VERSION | 2 +- .../java/resttemplate-withXml/.openapi-generator/VERSION | 2 +- .../petstore/java/resttemplate/.openapi-generator/VERSION | 2 +- .../client/petstore/java/retrofit/.openapi-generator/VERSION | 2 +- .../petstore/java/retrofit2-play24/.openapi-generator/VERSION | 2 +- .../petstore/java/retrofit2-play25/.openapi-generator/VERSION | 2 +- .../petstore/java/retrofit2-play26/.openapi-generator/VERSION | 2 +- .../client/petstore/java/retrofit2/.openapi-generator/VERSION | 2 +- .../client/petstore/java/retrofit2rx/.openapi-generator/VERSION | 2 +- .../petstore/java/retrofit2rx2/.openapi-generator/VERSION | 2 +- samples/client/petstore/java/vertx/.openapi-generator/VERSION | 2 +- .../client/petstore/java/webclient/.openapi-generator/VERSION | 2 +- .../client/petstore/javascript-es6/.openapi-generator/VERSION | 2 +- .../petstore/javascript-promise-es6/.openapi-generator/VERSION | 2 +- .../petstore/javascript-promise/.openapi-generator/VERSION | 2 +- samples/client/petstore/javascript-promise/src/ApiClient.js | 2 +- .../petstore/javascript-promise/src/api/AnotherFakeApi.js | 2 +- samples/client/petstore/javascript-promise/src/api/FakeApi.js | 2 +- .../javascript-promise/src/api/FakeClassnameTags123Api.js | 2 +- samples/client/petstore/javascript-promise/src/api/PetApi.js | 2 +- samples/client/petstore/javascript-promise/src/api/StoreApi.js | 2 +- samples/client/petstore/javascript-promise/src/api/UserApi.js | 2 +- samples/client/petstore/javascript-promise/src/index.js | 2 +- .../javascript-promise/src/model/AdditionalPropertiesAnyType.js | 2 +- .../javascript-promise/src/model/AdditionalPropertiesArray.js | 2 +- .../javascript-promise/src/model/AdditionalPropertiesBoolean.js | 2 +- .../javascript-promise/src/model/AdditionalPropertiesClass.js | 2 +- .../javascript-promise/src/model/AdditionalPropertiesInteger.js | 2 +- .../javascript-promise/src/model/AdditionalPropertiesNumber.js | 2 +- .../javascript-promise/src/model/AdditionalPropertiesObject.js | 2 +- .../javascript-promise/src/model/AdditionalPropertiesString.js | 2 +- samples/client/petstore/javascript-promise/src/model/Animal.js | 2 +- .../client/petstore/javascript-promise/src/model/ApiResponse.js | 2 +- .../javascript-promise/src/model/ArrayOfArrayOfNumberOnly.js | 2 +- .../petstore/javascript-promise/src/model/ArrayOfNumberOnly.js | 2 +- .../client/petstore/javascript-promise/src/model/ArrayTest.js | 2 +- .../petstore/javascript-promise/src/model/Capitalization.js | 2 +- samples/client/petstore/javascript-promise/src/model/Cat.js | 2 +- .../client/petstore/javascript-promise/src/model/CatAllOf.js | 2 +- .../client/petstore/javascript-promise/src/model/Category.js | 2 +- .../client/petstore/javascript-promise/src/model/ClassModel.js | 2 +- samples/client/petstore/javascript-promise/src/model/Client.js | 2 +- samples/client/petstore/javascript-promise/src/model/Dog.js | 2 +- .../client/petstore/javascript-promise/src/model/DogAllOf.js | 2 +- .../client/petstore/javascript-promise/src/model/EnumArrays.js | 2 +- .../client/petstore/javascript-promise/src/model/EnumClass.js | 2 +- .../client/petstore/javascript-promise/src/model/EnumTest.js | 2 +- samples/client/petstore/javascript-promise/src/model/File.js | 2 +- .../javascript-promise/src/model/FileSchemaTestClass.js | 2 +- .../client/petstore/javascript-promise/src/model/FormatTest.js | 2 +- .../petstore/javascript-promise/src/model/HasOnlyReadOnly.js | 2 +- samples/client/petstore/javascript-promise/src/model/List.js | 2 +- samples/client/petstore/javascript-promise/src/model/MapTest.js | 2 +- .../src/model/MixedPropertiesAndAdditionalPropertiesClass.js | 2 +- .../petstore/javascript-promise/src/model/Model200Response.js | 2 +- .../client/petstore/javascript-promise/src/model/ModelReturn.js | 2 +- samples/client/petstore/javascript-promise/src/model/Name.js | 2 +- .../client/petstore/javascript-promise/src/model/NumberOnly.js | 2 +- samples/client/petstore/javascript-promise/src/model/Order.js | 2 +- .../petstore/javascript-promise/src/model/OuterComposite.js | 2 +- .../client/petstore/javascript-promise/src/model/OuterEnum.js | 2 +- samples/client/petstore/javascript-promise/src/model/Pet.js | 2 +- .../petstore/javascript-promise/src/model/ReadOnlyFirst.js | 2 +- .../petstore/javascript-promise/src/model/SpecialModelName.js | 2 +- samples/client/petstore/javascript-promise/src/model/Tag.js | 2 +- .../petstore/javascript-promise/src/model/TypeHolderDefault.js | 2 +- .../petstore/javascript-promise/src/model/TypeHolderExample.js | 2 +- samples/client/petstore/javascript-promise/src/model/User.js | 2 +- samples/client/petstore/javascript-promise/src/model/XmlItem.js | 2 +- samples/client/petstore/javascript/.openapi-generator/VERSION | 2 +- samples/client/petstore/javascript/src/ApiClient.js | 2 +- samples/client/petstore/javascript/src/api/AnotherFakeApi.js | 2 +- samples/client/petstore/javascript/src/api/FakeApi.js | 2 +- .../petstore/javascript/src/api/FakeClassnameTags123Api.js | 2 +- samples/client/petstore/javascript/src/api/PetApi.js | 2 +- samples/client/petstore/javascript/src/api/StoreApi.js | 2 +- samples/client/petstore/javascript/src/api/UserApi.js | 2 +- samples/client/petstore/javascript/src/index.js | 2 +- .../javascript/src/model/AdditionalPropertiesAnyType.js | 2 +- .../petstore/javascript/src/model/AdditionalPropertiesArray.js | 2 +- .../javascript/src/model/AdditionalPropertiesBoolean.js | 2 +- .../petstore/javascript/src/model/AdditionalPropertiesClass.js | 2 +- .../javascript/src/model/AdditionalPropertiesInteger.js | 2 +- .../petstore/javascript/src/model/AdditionalPropertiesNumber.js | 2 +- .../petstore/javascript/src/model/AdditionalPropertiesObject.js | 2 +- .../petstore/javascript/src/model/AdditionalPropertiesString.js | 2 +- samples/client/petstore/javascript/src/model/Animal.js | 2 +- samples/client/petstore/javascript/src/model/ApiResponse.js | 2 +- .../petstore/javascript/src/model/ArrayOfArrayOfNumberOnly.js | 2 +- .../client/petstore/javascript/src/model/ArrayOfNumberOnly.js | 2 +- samples/client/petstore/javascript/src/model/ArrayTest.js | 2 +- samples/client/petstore/javascript/src/model/Capitalization.js | 2 +- samples/client/petstore/javascript/src/model/Cat.js | 2 +- samples/client/petstore/javascript/src/model/CatAllOf.js | 2 +- samples/client/petstore/javascript/src/model/Category.js | 2 +- samples/client/petstore/javascript/src/model/ClassModel.js | 2 +- samples/client/petstore/javascript/src/model/Client.js | 2 +- samples/client/petstore/javascript/src/model/Dog.js | 2 +- samples/client/petstore/javascript/src/model/DogAllOf.js | 2 +- samples/client/petstore/javascript/src/model/EnumArrays.js | 2 +- samples/client/petstore/javascript/src/model/EnumClass.js | 2 +- samples/client/petstore/javascript/src/model/EnumTest.js | 2 +- samples/client/petstore/javascript/src/model/File.js | 2 +- .../client/petstore/javascript/src/model/FileSchemaTestClass.js | 2 +- samples/client/petstore/javascript/src/model/FormatTest.js | 2 +- samples/client/petstore/javascript/src/model/HasOnlyReadOnly.js | 2 +- samples/client/petstore/javascript/src/model/List.js | 2 +- samples/client/petstore/javascript/src/model/MapTest.js | 2 +- .../src/model/MixedPropertiesAndAdditionalPropertiesClass.js | 2 +- .../client/petstore/javascript/src/model/Model200Response.js | 2 +- samples/client/petstore/javascript/src/model/ModelReturn.js | 2 +- samples/client/petstore/javascript/src/model/Name.js | 2 +- samples/client/petstore/javascript/src/model/NumberOnly.js | 2 +- samples/client/petstore/javascript/src/model/Order.js | 2 +- samples/client/petstore/javascript/src/model/OuterComposite.js | 2 +- samples/client/petstore/javascript/src/model/OuterEnum.js | 2 +- samples/client/petstore/javascript/src/model/Pet.js | 2 +- samples/client/petstore/javascript/src/model/ReadOnlyFirst.js | 2 +- .../client/petstore/javascript/src/model/SpecialModelName.js | 2 +- samples/client/petstore/javascript/src/model/Tag.js | 2 +- .../client/petstore/javascript/src/model/TypeHolderDefault.js | 2 +- .../client/petstore/javascript/src/model/TypeHolderExample.js | 2 +- samples/client/petstore/javascript/src/model/User.js | 2 +- samples/client/petstore/javascript/src/model/XmlItem.js | 2 +- .../client/petstore/kotlin-string/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-threetenbp/.openapi-generator/VERSION | 2 +- samples/client/petstore/kotlin/.openapi-generator/VERSION | 2 +- samples/client/petstore/perl/.openapi-generator/VERSION | 2 +- .../petstore/php/OpenAPIClient-php/.openapi-generator/VERSION | 2 +- .../petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php | 2 +- .../php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/ApiException.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Configuration.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/HeaderSelector.php | 2 +- .../OpenAPIClient-php/lib/Model/AdditionalPropertiesAnyType.php | 2 +- .../OpenAPIClient-php/lib/Model/AdditionalPropertiesArray.php | 2 +- .../OpenAPIClient-php/lib/Model/AdditionalPropertiesBoolean.php | 2 +- .../OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php | 2 +- .../OpenAPIClient-php/lib/Model/AdditionalPropertiesInteger.php | 2 +- .../OpenAPIClient-php/lib/Model/AdditionalPropertiesNumber.php | 2 +- .../OpenAPIClient-php/lib/Model/AdditionalPropertiesObject.php | 2 +- .../OpenAPIClient-php/lib/Model/AdditionalPropertiesString.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php | 2 +- .../OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php | 2 +- .../php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php | 2 +- samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Category.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Client.php | 2 +- samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/File.php | 2 +- .../php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php | 2 +- .../php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php | 2 +- .../lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php | 2 +- .../php/OpenAPIClient-php/lib/Model/Model200Response.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ModelList.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Name.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Order.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php | 2 +- samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php | 2 +- .../php/OpenAPIClient-php/lib/Model/SpecialModelName.php | 2 +- samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php | 2 +- .../php/OpenAPIClient-php/lib/Model/TypeHolderDefault.php | 2 +- .../php/OpenAPIClient-php/lib/Model/TypeHolderExample.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/User.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/XmlItem.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php | 2 +- .../php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php | 2 +- .../OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php | 2 +- .../test/Model/AdditionalPropertiesAnyTypeTest.php | 2 +- .../test/Model/AdditionalPropertiesArrayTest.php | 2 +- .../test/Model/AdditionalPropertiesBooleanTest.php | 2 +- .../test/Model/AdditionalPropertiesClassTest.php | 2 +- .../test/Model/AdditionalPropertiesIntegerTest.php | 2 +- .../test/Model/AdditionalPropertiesNumberTest.php | 2 +- .../test/Model/AdditionalPropertiesObjectTest.php | 2 +- .../test/Model/AdditionalPropertiesStringTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ApiResponseTest.php | 2 +- .../test/Model/ArrayOfArrayOfNumberOnlyTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/CapitalizationTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/CatTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ClassModelTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/ClientTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/DogTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/EnumArraysTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php | 2 +- .../OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/FileTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/FormatTestTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php | 2 +- .../Model/MixedPropertiesAndAdditionalPropertiesClassTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/Model200ResponseTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ModelReturnTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/NameTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/NumberOnlyTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/OrderTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/OuterCompositeTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/PetTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/TagTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/TypeHolderDefaultTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/TypeHolderExampleTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/UserTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/XmlItemTest.php | 2 +- .../client/petstore/python-asyncio/.openapi-generator/VERSION | 2 +- .../client/petstore/python-tornado/.openapi-generator/VERSION | 2 +- samples/client/petstore/python/.openapi-generator/VERSION | 2 +- .../petstore/spring-cloud-async/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- samples/client/petstore/spring-cloud/.openapi-generator/VERSION | 2 +- .../spring-cloud/src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- samples/client/petstore/spring-stubs/.openapi-generator/VERSION | 2 +- .../spring-stubs/src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../typescript-angular-v2/default/.openapi-generator/VERSION | 2 +- .../typescript-angular-v2/npm/.openapi-generator/VERSION | 2 +- .../with-interfaces/.openapi-generator/VERSION | 2 +- .../typescript-angular-v4.3/npm/.openapi-generator/VERSION | 2 +- .../typescript-angular-v4/npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../petstore/typescript-angularjs/.openapi-generator/VERSION | 2 +- .../typescript-aurelia/default/.openapi-generator/VERSION | 2 +- .../typescript-axios/builds/default/.openapi-generator/VERSION | 2 +- .../builds/es6-target/.openapi-generator/VERSION | 2 +- .../builds/with-complex-headers/.openapi-generator/VERSION | 2 +- .../builds/with-interfaces/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../builds/with-npm-version/.openapi-generator/VERSION | 2 +- .../typescript-fetch/builds/default/.openapi-generator/VERSION | 2 +- .../builds/es6-target/.openapi-generator/VERSION | 2 +- .../builds/multiple-parameters/.openapi-generator/VERSION | 2 +- .../builds/with-interfaces/.openapi-generator/VERSION | 2 +- .../builds/with-npm-version/.openapi-generator/VERSION | 2 +- .../petstore/typescript-inversify/.openapi-generator/VERSION | 2 +- .../typescript-jquery/default/.openapi-generator/VERSION | 2 +- .../petstore/typescript-jquery/npm/.openapi-generator/VERSION | 2 +- .../petstore/typescript-node/default/.openapi-generator/VERSION | 2 +- .../petstore/typescript-node/npm/.openapi-generator/VERSION | 2 +- .../typescript-rxjs/builds/default/.openapi-generator/VERSION | 2 +- .../builds/es6-target/.openapi-generator/VERSION | 2 +- .../builds/with-interfaces/.openapi-generator/VERSION | 2 +- .../builds/with-npm-version/.openapi-generator/VERSION | 2 +- samples/meta-codegen/lib/pom.xml | 2 +- samples/meta-codegen/usage/.openapi-generator/VERSION | 2 +- .../petstore/php/OpenAPIClient-php/.openapi-generator/VERSION | 2 +- .../petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php | 2 +- .../php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/ApiException.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Configuration.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/HeaderSelector.php | 2 +- .../OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php | 2 +- .../OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php | 2 +- .../php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Category.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Client.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/File.php | 2 +- .../php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php | 2 +- .../php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php | 2 +- .../php/OpenAPIClient-php/lib/Model/HealthCheckResult.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php | 2 +- .../php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php | 2 +- .../lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php | 2 +- .../php/OpenAPIClient-php/lib/Model/Model200Response.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ModelList.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Name.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Order.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php | 2 +- .../php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php | 2 +- .../php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php | 2 +- .../lib/Model/OuterEnumIntegerDefaultValue.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php | 2 +- .../php/OpenAPIClient-php/lib/Model/SpecialModelName.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/User.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php | 2 +- .../php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Api/DefaultApiTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php | 2 +- .../OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php | 2 +- .../test/Model/AdditionalPropertiesClassTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ApiResponseTest.php | 2 +- .../test/Model/ArrayOfArrayOfNumberOnlyTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/CapitalizationTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/CatTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ClassModelTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/ClientTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/DogTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/EnumArraysTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php | 2 +- .../OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/FileTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/FooTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/FormatTestTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/HealthCheckResultTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/InlineObject1Test.php | 2 +- .../php/OpenAPIClient-php/test/Model/InlineObject2Test.php | 2 +- .../php/OpenAPIClient-php/test/Model/InlineObject3Test.php | 2 +- .../php/OpenAPIClient-php/test/Model/InlineObject4Test.php | 2 +- .../php/OpenAPIClient-php/test/Model/InlineObject5Test.php | 2 +- .../php/OpenAPIClient-php/test/Model/InlineObjectTest.php | 2 +- .../OpenAPIClient-php/test/Model/InlineResponseDefaultTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php | 2 +- .../Model/MixedPropertiesAndAdditionalPropertiesClassTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/Model200ResponseTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ModelReturnTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/NameTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/NullableClassTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/NumberOnlyTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/OrderTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/OuterCompositeTest.php | 2 +- .../OpenAPIClient-php/test/Model/OuterEnumDefaultValueTest.php | 2 +- .../test/Model/OuterEnumIntegerDefaultValueTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/OuterEnumIntegerTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/PetTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php | 2 +- .../php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/TagTest.php | 2 +- .../petstore/php/OpenAPIClient-php/test/Model/UserTest.php | 2 +- .../openapi3/client/petstore/python/.openapi-generator/VERSION | 2 +- .../client/petstore/ruby-faraday/.openapi-generator/VERSION | 2 +- samples/openapi3/client/petstore/ruby-faraday/lib/petstore.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/api/default_api.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb | 2 +- .../ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/api/store_api.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/api/user_api.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/api_client.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/api_error.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/configuration.rb | 2 +- .../lib/petstore/models/additional_properties_class.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/animal.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/api_response.rb | 2 +- .../lib/petstore/models/array_of_array_of_number_only.rb | 2 +- .../ruby-faraday/lib/petstore/models/array_of_number_only.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/array_test.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/capitalization.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/cat.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/category.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/class_model.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/client.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/dog.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/enum_class.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/enum_test.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/file.rb | 2 +- .../ruby-faraday/lib/petstore/models/file_schema_test_class.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/foo.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/format_test.rb | 2 +- .../ruby-faraday/lib/petstore/models/has_only_read_only.rb | 2 +- .../ruby-faraday/lib/petstore/models/health_check_result.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/inline_object.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/inline_object1.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/inline_object2.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/inline_object3.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/inline_object4.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/inline_object5.rb | 2 +- .../ruby-faraday/lib/petstore/models/inline_response_default.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/list.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/map_test.rb | 2 +- .../models/mixed_properties_and_additional_properties_class.rb | 2 +- .../ruby-faraday/lib/petstore/models/model200_response.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/model_return.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/name.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/nullable_class.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/number_only.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/order.rb | 2 +- .../ruby-faraday/lib/petstore/models/outer_composite.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/outer_enum.rb | 2 +- .../lib/petstore/models/outer_enum_default_value.rb | 2 +- .../ruby-faraday/lib/petstore/models/outer_enum_integer.rb | 2 +- .../lib/petstore/models/outer_enum_integer_default_value.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/pet.rb | 2 +- .../ruby-faraday/lib/petstore/models/read_only_first.rb | 2 +- .../ruby-faraday/lib/petstore/models/special_model_name.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/tag.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/user.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/version.rb | 2 +- samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec | 2 +- .../petstore/ruby-faraday/spec/api/another_fake_api_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/api/default_api_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/api/fake_api_spec.rb | 2 +- .../ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/api/pet_api_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/api/store_api_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/api/user_api_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/api_client_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/configuration_spec.rb | 2 +- .../spec/models/additional_properties_class_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/animal_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/api_response_spec.rb | 2 +- .../spec/models/array_of_array_of_number_only_spec.rb | 2 +- .../ruby-faraday/spec/models/array_of_number_only_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/array_test_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/capitalization_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/cat_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/category_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/class_model_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/client_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/dog_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/enum_arrays_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/enum_class_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/enum_test_spec.rb | 2 +- .../ruby-faraday/spec/models/file_schema_test_class_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/file_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/foo_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/format_test_spec.rb | 2 +- .../ruby-faraday/spec/models/has_only_read_only_spec.rb | 2 +- .../ruby-faraday/spec/models/health_check_result_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/inline_object1_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/inline_object2_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/inline_object3_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/inline_object4_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/inline_object5_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/inline_object_spec.rb | 2 +- .../ruby-faraday/spec/models/inline_response_default_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/list_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/map_test_spec.rb | 2 +- .../mixed_properties_and_additional_properties_class_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/model200_response_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/model_return_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/name_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/nullable_class_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/number_only_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/order_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/outer_composite_spec.rb | 2 +- .../ruby-faraday/spec/models/outer_enum_default_value_spec.rb | 2 +- .../spec/models/outer_enum_integer_default_value_spec.rb | 2 +- .../ruby-faraday/spec/models/outer_enum_integer_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/pet_spec.rb | 2 +- .../petstore/ruby-faraday/spec/models/read_only_first_spec.rb | 2 +- .../ruby-faraday/spec/models/special_model_name_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/tag_spec.rb | 2 +- .../client/petstore/ruby-faraday/spec/models/user_spec.rb | 2 +- .../openapi3/client/petstore/ruby-faraday/spec/spec_helper.rb | 2 +- .../openapi3/client/petstore/ruby/.openapi-generator/VERSION | 2 +- samples/openapi3/client/petstore/ruby/lib/petstore.rb | 2 +- .../client/petstore/ruby/lib/petstore/api/another_fake_api.rb | 2 +- .../client/petstore/ruby/lib/petstore/api/default_api.rb | 2 +- .../openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb | 2 +- .../ruby/lib/petstore/api/fake_classname_tags123_api.rb | 2 +- .../openapi3/client/petstore/ruby/lib/petstore/api/pet_api.rb | 2 +- .../openapi3/client/petstore/ruby/lib/petstore/api/store_api.rb | 2 +- .../openapi3/client/petstore/ruby/lib/petstore/api/user_api.rb | 2 +- .../openapi3/client/petstore/ruby/lib/petstore/api_client.rb | 2 +- samples/openapi3/client/petstore/ruby/lib/petstore/api_error.rb | 2 +- .../openapi3/client/petstore/ruby/lib/petstore/configuration.rb | 2 +- .../ruby/lib/petstore/models/additional_properties_class.rb | 2 +- .../openapi3/client/petstore/ruby/lib/petstore/models/animal.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/api_response.rb | 2 +- .../ruby/lib/petstore/models/array_of_array_of_number_only.rb | 2 +- .../petstore/ruby/lib/petstore/models/array_of_number_only.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/array_test.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/capitalization.rb | 2 +- .../openapi3/client/petstore/ruby/lib/petstore/models/cat.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/cat_all_of.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/category.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/class_model.rb | 2 +- .../openapi3/client/petstore/ruby/lib/petstore/models/client.rb | 2 +- .../openapi3/client/petstore/ruby/lib/petstore/models/dog.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/dog_all_of.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/enum_arrays.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/enum_class.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/enum_test.rb | 2 +- .../openapi3/client/petstore/ruby/lib/petstore/models/file.rb | 2 +- .../petstore/ruby/lib/petstore/models/file_schema_test_class.rb | 2 +- .../openapi3/client/petstore/ruby/lib/petstore/models/foo.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/format_test.rb | 2 +- .../petstore/ruby/lib/petstore/models/has_only_read_only.rb | 2 +- .../petstore/ruby/lib/petstore/models/health_check_result.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/inline_object.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/inline_object1.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/inline_object2.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/inline_object3.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/inline_object4.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/inline_object5.rb | 2 +- .../ruby/lib/petstore/models/inline_response_default.rb | 2 +- .../openapi3/client/petstore/ruby/lib/petstore/models/list.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/map_test.rb | 2 +- .../models/mixed_properties_and_additional_properties_class.rb | 2 +- .../petstore/ruby/lib/petstore/models/model200_response.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/model_return.rb | 2 +- .../openapi3/client/petstore/ruby/lib/petstore/models/name.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/nullable_class.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/number_only.rb | 2 +- .../openapi3/client/petstore/ruby/lib/petstore/models/order.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/outer_composite.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/outer_enum.rb | 2 +- .../ruby/lib/petstore/models/outer_enum_default_value.rb | 2 +- .../petstore/ruby/lib/petstore/models/outer_enum_integer.rb | 2 +- .../lib/petstore/models/outer_enum_integer_default_value.rb | 2 +- .../openapi3/client/petstore/ruby/lib/petstore/models/pet.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/read_only_first.rb | 2 +- .../petstore/ruby/lib/petstore/models/special_model_name.rb | 2 +- .../openapi3/client/petstore/ruby/lib/petstore/models/tag.rb | 2 +- .../openapi3/client/petstore/ruby/lib/petstore/models/user.rb | 2 +- samples/openapi3/client/petstore/ruby/lib/petstore/version.rb | 2 +- samples/openapi3/client/petstore/ruby/petstore.gemspec | 2 +- .../client/petstore/ruby/spec/api/another_fake_api_spec.rb | 2 +- .../openapi3/client/petstore/ruby/spec/api/default_api_spec.rb | 2 +- samples/openapi3/client/petstore/ruby/spec/api/fake_api_spec.rb | 2 +- .../petstore/ruby/spec/api/fake_classname_tags123_api_spec.rb | 2 +- samples/openapi3/client/petstore/ruby/spec/api/pet_api_spec.rb | 2 +- .../openapi3/client/petstore/ruby/spec/api/store_api_spec.rb | 2 +- samples/openapi3/client/petstore/ruby/spec/api/user_api_spec.rb | 2 +- samples/openapi3/client/petstore/ruby/spec/api_client_spec.rb | 2 +- .../openapi3/client/petstore/ruby/spec/configuration_spec.rb | 2 +- .../ruby/spec/models/additional_properties_class_spec.rb | 2 +- .../openapi3/client/petstore/ruby/spec/models/animal_spec.rb | 2 +- .../client/petstore/ruby/spec/models/api_response_spec.rb | 2 +- .../ruby/spec/models/array_of_array_of_number_only_spec.rb | 2 +- .../petstore/ruby/spec/models/array_of_number_only_spec.rb | 2 +- .../client/petstore/ruby/spec/models/array_test_spec.rb | 2 +- .../client/petstore/ruby/spec/models/capitalization_spec.rb | 2 +- .../client/petstore/ruby/spec/models/cat_all_of_spec.rb | 2 +- samples/openapi3/client/petstore/ruby/spec/models/cat_spec.rb | 2 +- .../openapi3/client/petstore/ruby/spec/models/category_spec.rb | 2 +- .../client/petstore/ruby/spec/models/class_model_spec.rb | 2 +- .../openapi3/client/petstore/ruby/spec/models/client_spec.rb | 2 +- .../client/petstore/ruby/spec/models/dog_all_of_spec.rb | 2 +- samples/openapi3/client/petstore/ruby/spec/models/dog_spec.rb | 2 +- .../client/petstore/ruby/spec/models/enum_arrays_spec.rb | 2 +- .../client/petstore/ruby/spec/models/enum_class_spec.rb | 2 +- .../openapi3/client/petstore/ruby/spec/models/enum_test_spec.rb | 2 +- .../petstore/ruby/spec/models/file_schema_test_class_spec.rb | 2 +- samples/openapi3/client/petstore/ruby/spec/models/file_spec.rb | 2 +- samples/openapi3/client/petstore/ruby/spec/models/foo_spec.rb | 2 +- .../client/petstore/ruby/spec/models/format_test_spec.rb | 2 +- .../client/petstore/ruby/spec/models/has_only_read_only_spec.rb | 2 +- .../petstore/ruby/spec/models/health_check_result_spec.rb | 2 +- .../client/petstore/ruby/spec/models/inline_object1_spec.rb | 2 +- .../client/petstore/ruby/spec/models/inline_object2_spec.rb | 2 +- .../client/petstore/ruby/spec/models/inline_object3_spec.rb | 2 +- .../client/petstore/ruby/spec/models/inline_object4_spec.rb | 2 +- .../client/petstore/ruby/spec/models/inline_object5_spec.rb | 2 +- .../client/petstore/ruby/spec/models/inline_object_spec.rb | 2 +- .../petstore/ruby/spec/models/inline_response_default_spec.rb | 2 +- samples/openapi3/client/petstore/ruby/spec/models/list_spec.rb | 2 +- .../openapi3/client/petstore/ruby/spec/models/map_test_spec.rb | 2 +- .../mixed_properties_and_additional_properties_class_spec.rb | 2 +- .../client/petstore/ruby/spec/models/model200_response_spec.rb | 2 +- .../client/petstore/ruby/spec/models/model_return_spec.rb | 2 +- samples/openapi3/client/petstore/ruby/spec/models/name_spec.rb | 2 +- .../client/petstore/ruby/spec/models/nullable_class_spec.rb | 2 +- .../client/petstore/ruby/spec/models/number_only_spec.rb | 2 +- samples/openapi3/client/petstore/ruby/spec/models/order_spec.rb | 2 +- .../client/petstore/ruby/spec/models/outer_composite_spec.rb | 2 +- .../petstore/ruby/spec/models/outer_enum_default_value_spec.rb | 2 +- .../ruby/spec/models/outer_enum_integer_default_value_spec.rb | 2 +- .../client/petstore/ruby/spec/models/outer_enum_integer_spec.rb | 2 +- .../client/petstore/ruby/spec/models/outer_enum_spec.rb | 2 +- samples/openapi3/client/petstore/ruby/spec/models/pet_spec.rb | 2 +- .../client/petstore/ruby/spec/models/read_only_first_spec.rb | 2 +- .../client/petstore/ruby/spec/models/special_model_name_spec.rb | 2 +- samples/openapi3/client/petstore/ruby/spec/models/tag_spec.rb | 2 +- samples/openapi3/client/petstore/ruby/spec/models/user_spec.rb | 2 +- samples/openapi3/client/petstore/ruby/spec/spec_helper.rb | 2 +- samples/schema/petstore/mysql/.openapi-generator/VERSION | 2 +- .../petstore/go-gin-api-server/.openapi-generator/VERSION | 2 +- samples/server/petstore/java-msf4j/.openapi-generator/VERSION | 2 +- .../jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION | 2 +- .../server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION | 2 +- .../jaxrs-cxf-non-spring-app/.openapi-generator/VERSION | 2 +- samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION | 2 +- .../server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION | 2 +- samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-resteasy/default/.openapi-generator/VERSION | 2 +- .../jaxrs-resteasy/eap-java8/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-spec-interface/.openapi-generator/VERSION | 2 +- samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION | 2 +- .../server/petstore/jaxrs/jersey1/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION | 2 +- .../server/petstore/jaxrs/jersey2/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-server/ktor/.openapi-generator/VERSION | 2 +- samples/server/petstore/kotlin-server/ktor/README.md | 2 +- .../kotlin-springboot-reactive/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-springboot/.openapi-generator/VERSION | 2 +- samples/server/petstore/php-lumen/.openapi-generator/VERSION | 2 +- .../petstore/php-silex/OpenAPIServer/.openapi-generator/VERSION | 2 +- samples/server/petstore/php-slim/.openapi-generator/VERSION | 2 +- .../php-symfony/SymfonyBundle-php/.openapi-generator/VERSION | 2 +- samples/server/petstore/php-ze-ph/.openapi-generator/VERSION | 2 +- .../rust-server/output/multipart-v3/.openapi-generator/VERSION | 2 +- .../rust-server/output/openapi-v3/.openapi-generator/VERSION | 2 +- .../rust-server/output/ops-v3/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../output/rust-server-test/.openapi-generator/VERSION | 2 +- .../petstore/spring-mvc-j8-async/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../spring-mvc-j8-localdatetime/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- samples/server/petstore/spring-mvc/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../spring-mvc/src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../spring-mvc/src/main/java/org/openapitools/api/PetApi.java | 2 +- .../spring-mvc/src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../spring-mvc/src/main/java/org/openapitools/api/UserApi.java | 2 +- .../springboot-beanvalidation/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-delegate-j8/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-delegate/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../springboot-implicitHeaders/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-reactive/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-useoptional/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-virtualan/.openapi-generator/VERSION | 2 +- .../java/org/openapitools/virtualan/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/virtualan/api/FakeApi.java | 2 +- .../org/openapitools/virtualan/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/virtualan/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/virtualan/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/virtualan/api/UserApi.java | 2 +- samples/server/petstore/springboot/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../springboot/src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../springboot/src/main/java/org/openapitools/api/PetApi.java | 2 +- .../springboot/src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../springboot/src/main/java/org/openapitools/api/UserApi.java | 2 +- 793 files changed, 793 insertions(+), 793 deletions(-) diff --git a/modules/openapi-generator-cli/pom.xml b/modules/openapi-generator-cli/pom.xml index 380bfee8f3d..9994a1d0b53 100644 --- a/modules/openapi-generator-cli/pom.xml +++ b/modules/openapi-generator-cli/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 4.1.1-SNAPSHOT + 4.2.0-SNAPSHOT ../.. diff --git a/modules/openapi-generator-core/pom.xml b/modules/openapi-generator-core/pom.xml index 930400f3b2c..a44a089e34c 100644 --- a/modules/openapi-generator-core/pom.xml +++ b/modules/openapi-generator-core/pom.xml @@ -6,7 +6,7 @@ openapi-generator-project org.openapitools - 4.1.1-SNAPSHOT + 4.2.0-SNAPSHOT ../.. diff --git a/modules/openapi-generator-gradle-plugin/gradle.properties b/modules/openapi-generator-gradle-plugin/gradle.properties index a4deb47d1ae..eb80c214f9f 100644 --- a/modules/openapi-generator-gradle-plugin/gradle.properties +++ b/modules/openapi-generator-gradle-plugin/gradle.properties @@ -1,5 +1,5 @@ # RELEASE_VERSION -openApiGeneratorVersion=4.1.1-SNAPSHOT +openApiGeneratorVersion=4.2.0-SNAPSHOT # /RELEASE_VERSION # BEGIN placeholders diff --git a/modules/openapi-generator-gradle-plugin/pom.xml b/modules/openapi-generator-gradle-plugin/pom.xml index e2448112d5f..ec6ee32b4b7 100644 --- a/modules/openapi-generator-gradle-plugin/pom.xml +++ b/modules/openapi-generator-gradle-plugin/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 4.1.1-SNAPSHOT + 4.2.0-SNAPSHOT ../.. diff --git a/modules/openapi-generator-maven-plugin/pom.xml b/modules/openapi-generator-maven-plugin/pom.xml index 9fc0a05b107..f1cb0478357 100644 --- a/modules/openapi-generator-maven-plugin/pom.xml +++ b/modules/openapi-generator-maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.openapitools openapi-generator-project - 4.1.1-SNAPSHOT + 4.2.0-SNAPSHOT ../.. diff --git a/modules/openapi-generator-online/pom.xml b/modules/openapi-generator-online/pom.xml index 391574c24d7..69dc3216ac8 100644 --- a/modules/openapi-generator-online/pom.xml +++ b/modules/openapi-generator-online/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 4.1.1-SNAPSHOT + 4.2.0-SNAPSHOT ../.. diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index e417dad64cd..189b8b35fda 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 4.1.1-SNAPSHOT + 4.2.0-SNAPSHOT ../.. diff --git a/pom.xml b/pom.xml index 95bc5ec7058..a3ee4b75154 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ pom openapi-generator-project - 4.1.1-SNAPSHOT + 4.2.0-SNAPSHOT https://github.com/openapitools/openapi-generator diff --git a/samples/client/petstore/R/.openapi-generator/VERSION b/samples/client/petstore/R/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/R/.openapi-generator/VERSION +++ b/samples/client/petstore/R/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/apex/.openapi-generator/VERSION b/samples/client/petstore/apex/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/apex/.openapi-generator/VERSION +++ b/samples/client/petstore/apex/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/elixir/.openapi-generator/VERSION b/samples/client/petstore/elixir/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/elixir/.openapi-generator/VERSION +++ b/samples/client/petstore/elixir/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION b/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION +++ b/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION b/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/groovy/.openapi-generator/VERSION b/samples/client/petstore/groovy/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/groovy/.openapi-generator/VERSION +++ b/samples/client/petstore/groovy/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION b/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION +++ b/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/feign/.openapi-generator/VERSION b/samples/client/petstore/java/feign/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/java/feign/.openapi-generator/VERSION +++ b/samples/client/petstore/java/feign/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/feign10x/.openapi-generator/VERSION b/samples/client/petstore/java/feign10x/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/java/feign10x/.openapi-generator/VERSION +++ b/samples/client/petstore/java/feign10x/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION b/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION +++ b/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey1/.openapi-generator/VERSION b/samples/client/petstore/java/jersey1/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/java/jersey1/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey1/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java6/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2-java6/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/java/jersey2-java6/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey2-java6/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/java/jersey2/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey2/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/native/.openapi-generator/VERSION b/samples/client/petstore/java/native/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/java/native/.openapi-generator/VERSION +++ b/samples/client/petstore/java/native/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION b/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION +++ b/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/resteasy/.openapi-generator/VERSION b/samples/client/petstore/java/resteasy/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/java/resteasy/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resteasy/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION b/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/java/retrofit/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play24/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2-play24/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/java/retrofit2-play24/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2-play24/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play25/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2-play25/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/java/retrofit2-play25/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2-play25/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2rx/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/java/retrofit2rx/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2rx/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/vertx/.openapi-generator/VERSION b/samples/client/petstore/java/vertx/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/java/vertx/.openapi-generator/VERSION +++ b/samples/client/petstore/java/vertx/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/webclient/.openapi-generator/VERSION b/samples/client/petstore/java/webclient/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/java/webclient/.openapi-generator/VERSION +++ b/samples/client/petstore/java/webclient/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript-es6/.openapi-generator/VERSION b/samples/client/petstore/javascript-es6/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/javascript-es6/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-es6/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION b/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript-promise/.openapi-generator/VERSION b/samples/client/petstore/javascript-promise/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/javascript-promise/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-promise/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript-promise/src/ApiClient.js b/samples/client/petstore/javascript-promise/src/ApiClient.js index 1734d524fb0..8ceab82902e 100644 --- a/samples/client/petstore/javascript-promise/src/ApiClient.js +++ b/samples/client/petstore/javascript-promise/src/ApiClient.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js b/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js index a7f790440a0..5fbadbd951a 100644 --- a/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js +++ b/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/api/FakeApi.js b/samples/client/petstore/javascript-promise/src/api/FakeApi.js index d5a4c353453..a3b1728cd98 100644 --- a/samples/client/petstore/javascript-promise/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise/src/api/FakeApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js b/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js index 19561a368b4..ed619faaaf0 100644 --- a/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js +++ b/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/api/PetApi.js b/samples/client/petstore/javascript-promise/src/api/PetApi.js index e38d94bbacd..ef88bc28670 100644 --- a/samples/client/petstore/javascript-promise/src/api/PetApi.js +++ b/samples/client/petstore/javascript-promise/src/api/PetApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/api/StoreApi.js b/samples/client/petstore/javascript-promise/src/api/StoreApi.js index 8301399541d..a0c9d267603 100644 --- a/samples/client/petstore/javascript-promise/src/api/StoreApi.js +++ b/samples/client/petstore/javascript-promise/src/api/StoreApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/api/UserApi.js b/samples/client/petstore/javascript-promise/src/api/UserApi.js index 53eb96980ca..b99a9f0ff57 100644 --- a/samples/client/petstore/javascript-promise/src/api/UserApi.js +++ b/samples/client/petstore/javascript-promise/src/api/UserApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/index.js b/samples/client/petstore/javascript-promise/src/index.js index a92a4ab5a22..08ef76e396a 100644 --- a/samples/client/petstore/javascript-promise/src/index.js +++ b/samples/client/petstore/javascript-promise/src/index.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesAnyType.js b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesAnyType.js index f6bd3640800..0bf77f5778b 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesAnyType.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesAnyType.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesArray.js b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesArray.js index d36ecc495ed..25d303da033 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesArray.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesArray.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesBoolean.js b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesBoolean.js index 7d063336200..e2beb4db655 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesBoolean.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesBoolean.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesClass.js b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesClass.js index 37161bd8c3b..2813e54a4b5 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesClass.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesInteger.js b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesInteger.js index d9e860e6470..e7164197a47 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesInteger.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesInteger.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesNumber.js b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesNumber.js index f299469e450..f3969088370 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesNumber.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesNumber.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesObject.js b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesObject.js index 49f7aef8b32..4a9b0ef82e2 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesObject.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesObject.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesString.js b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesString.js index 68a58595cb9..8e685ad794b 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesString.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesString.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Animal.js b/samples/client/petstore/javascript-promise/src/model/Animal.js index 0c4edc9a380..b017e7f3ea7 100644 --- a/samples/client/petstore/javascript-promise/src/model/Animal.js +++ b/samples/client/petstore/javascript-promise/src/model/Animal.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ApiResponse.js b/samples/client/petstore/javascript-promise/src/model/ApiResponse.js index efd7fdf421d..c57bf079d68 100644 --- a/samples/client/petstore/javascript-promise/src/model/ApiResponse.js +++ b/samples/client/petstore/javascript-promise/src/model/ApiResponse.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ArrayOfArrayOfNumberOnly.js b/samples/client/petstore/javascript-promise/src/model/ArrayOfArrayOfNumberOnly.js index fdf87fde4eb..4f9917fd3a1 100644 --- a/samples/client/petstore/javascript-promise/src/model/ArrayOfArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-promise/src/model/ArrayOfArrayOfNumberOnly.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ArrayOfNumberOnly.js b/samples/client/petstore/javascript-promise/src/model/ArrayOfNumberOnly.js index 2b24c19bfea..821ea6bf79b 100644 --- a/samples/client/petstore/javascript-promise/src/model/ArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-promise/src/model/ArrayOfNumberOnly.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ArrayTest.js b/samples/client/petstore/javascript-promise/src/model/ArrayTest.js index 60600762ce1..a2b78d0501a 100644 --- a/samples/client/petstore/javascript-promise/src/model/ArrayTest.js +++ b/samples/client/petstore/javascript-promise/src/model/ArrayTest.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Capitalization.js b/samples/client/petstore/javascript-promise/src/model/Capitalization.js index bdba5b0cc38..a41a5373dd6 100644 --- a/samples/client/petstore/javascript-promise/src/model/Capitalization.js +++ b/samples/client/petstore/javascript-promise/src/model/Capitalization.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Cat.js b/samples/client/petstore/javascript-promise/src/model/Cat.js index f5f9ebf49a7..88cc86b5ce1 100644 --- a/samples/client/petstore/javascript-promise/src/model/Cat.js +++ b/samples/client/petstore/javascript-promise/src/model/Cat.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/CatAllOf.js b/samples/client/petstore/javascript-promise/src/model/CatAllOf.js index b64eee29e11..09a00c6b218 100644 --- a/samples/client/petstore/javascript-promise/src/model/CatAllOf.js +++ b/samples/client/petstore/javascript-promise/src/model/CatAllOf.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Category.js b/samples/client/petstore/javascript-promise/src/model/Category.js index a8fa9b082f0..f5cc9d32c31 100644 --- a/samples/client/petstore/javascript-promise/src/model/Category.js +++ b/samples/client/petstore/javascript-promise/src/model/Category.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ClassModel.js b/samples/client/petstore/javascript-promise/src/model/ClassModel.js index 13e05a6f361..4ce4fe42d5c 100644 --- a/samples/client/petstore/javascript-promise/src/model/ClassModel.js +++ b/samples/client/petstore/javascript-promise/src/model/ClassModel.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Client.js b/samples/client/petstore/javascript-promise/src/model/Client.js index aa4ca0493f5..47000e6f0c9 100644 --- a/samples/client/petstore/javascript-promise/src/model/Client.js +++ b/samples/client/petstore/javascript-promise/src/model/Client.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Dog.js b/samples/client/petstore/javascript-promise/src/model/Dog.js index 138d5d13fb0..0d2d6c432d7 100644 --- a/samples/client/petstore/javascript-promise/src/model/Dog.js +++ b/samples/client/petstore/javascript-promise/src/model/Dog.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/DogAllOf.js b/samples/client/petstore/javascript-promise/src/model/DogAllOf.js index 5d6a9a1072d..d9157867d4a 100644 --- a/samples/client/petstore/javascript-promise/src/model/DogAllOf.js +++ b/samples/client/petstore/javascript-promise/src/model/DogAllOf.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/EnumArrays.js b/samples/client/petstore/javascript-promise/src/model/EnumArrays.js index 8580dfd308f..5a3d166ec66 100644 --- a/samples/client/petstore/javascript-promise/src/model/EnumArrays.js +++ b/samples/client/petstore/javascript-promise/src/model/EnumArrays.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/EnumClass.js b/samples/client/petstore/javascript-promise/src/model/EnumClass.js index 9c335fdfbb0..a17ee900772 100644 --- a/samples/client/petstore/javascript-promise/src/model/EnumClass.js +++ b/samples/client/petstore/javascript-promise/src/model/EnumClass.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/EnumTest.js b/samples/client/petstore/javascript-promise/src/model/EnumTest.js index 038926ccdb8..2d993f9e688 100644 --- a/samples/client/petstore/javascript-promise/src/model/EnumTest.js +++ b/samples/client/petstore/javascript-promise/src/model/EnumTest.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/File.js b/samples/client/petstore/javascript-promise/src/model/File.js index 8042cfad4b9..f6455a933d0 100644 --- a/samples/client/petstore/javascript-promise/src/model/File.js +++ b/samples/client/petstore/javascript-promise/src/model/File.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/FileSchemaTestClass.js b/samples/client/petstore/javascript-promise/src/model/FileSchemaTestClass.js index e29880db9ae..2f7a72e03a9 100644 --- a/samples/client/petstore/javascript-promise/src/model/FileSchemaTestClass.js +++ b/samples/client/petstore/javascript-promise/src/model/FileSchemaTestClass.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/FormatTest.js b/samples/client/petstore/javascript-promise/src/model/FormatTest.js index 5772988329a..5c0304d6d49 100644 --- a/samples/client/petstore/javascript-promise/src/model/FormatTest.js +++ b/samples/client/petstore/javascript-promise/src/model/FormatTest.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/HasOnlyReadOnly.js b/samples/client/petstore/javascript-promise/src/model/HasOnlyReadOnly.js index 3fe20b3023a..2df9454f0ee 100644 --- a/samples/client/petstore/javascript-promise/src/model/HasOnlyReadOnly.js +++ b/samples/client/petstore/javascript-promise/src/model/HasOnlyReadOnly.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/List.js b/samples/client/petstore/javascript-promise/src/model/List.js index 7aa75478844..9936619f933 100644 --- a/samples/client/petstore/javascript-promise/src/model/List.js +++ b/samples/client/petstore/javascript-promise/src/model/List.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/MapTest.js b/samples/client/petstore/javascript-promise/src/model/MapTest.js index d04243f15df..f8337f5c4a9 100644 --- a/samples/client/petstore/javascript-promise/src/model/MapTest.js +++ b/samples/client/petstore/javascript-promise/src/model/MapTest.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/MixedPropertiesAndAdditionalPropertiesClass.js b/samples/client/petstore/javascript-promise/src/model/MixedPropertiesAndAdditionalPropertiesClass.js index c5461ad5476..3cee3ee0e62 100644 --- a/samples/client/petstore/javascript-promise/src/model/MixedPropertiesAndAdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-promise/src/model/MixedPropertiesAndAdditionalPropertiesClass.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Model200Response.js b/samples/client/petstore/javascript-promise/src/model/Model200Response.js index 078f612468a..c980b96bb95 100644 --- a/samples/client/petstore/javascript-promise/src/model/Model200Response.js +++ b/samples/client/petstore/javascript-promise/src/model/Model200Response.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ModelReturn.js b/samples/client/petstore/javascript-promise/src/model/ModelReturn.js index f2c210aeb0d..89a0620c273 100644 --- a/samples/client/petstore/javascript-promise/src/model/ModelReturn.js +++ b/samples/client/petstore/javascript-promise/src/model/ModelReturn.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Name.js b/samples/client/petstore/javascript-promise/src/model/Name.js index 8e2caf658e2..6dae98a4594 100644 --- a/samples/client/petstore/javascript-promise/src/model/Name.js +++ b/samples/client/petstore/javascript-promise/src/model/Name.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/NumberOnly.js b/samples/client/petstore/javascript-promise/src/model/NumberOnly.js index 3d99a053817..a17fddd0471 100644 --- a/samples/client/petstore/javascript-promise/src/model/NumberOnly.js +++ b/samples/client/petstore/javascript-promise/src/model/NumberOnly.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Order.js b/samples/client/petstore/javascript-promise/src/model/Order.js index 4b4250c6a74..eab21937f65 100644 --- a/samples/client/petstore/javascript-promise/src/model/Order.js +++ b/samples/client/petstore/javascript-promise/src/model/Order.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/OuterComposite.js b/samples/client/petstore/javascript-promise/src/model/OuterComposite.js index 99e0a5c5d97..d188e82444a 100644 --- a/samples/client/petstore/javascript-promise/src/model/OuterComposite.js +++ b/samples/client/petstore/javascript-promise/src/model/OuterComposite.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/OuterEnum.js b/samples/client/petstore/javascript-promise/src/model/OuterEnum.js index 03931bc7232..6153e467d18 100644 --- a/samples/client/petstore/javascript-promise/src/model/OuterEnum.js +++ b/samples/client/petstore/javascript-promise/src/model/OuterEnum.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Pet.js b/samples/client/petstore/javascript-promise/src/model/Pet.js index 0c1fdcd196e..148254bcbc8 100644 --- a/samples/client/petstore/javascript-promise/src/model/Pet.js +++ b/samples/client/petstore/javascript-promise/src/model/Pet.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ReadOnlyFirst.js b/samples/client/petstore/javascript-promise/src/model/ReadOnlyFirst.js index 72c17a9f3e0..896fb6484d4 100644 --- a/samples/client/petstore/javascript-promise/src/model/ReadOnlyFirst.js +++ b/samples/client/petstore/javascript-promise/src/model/ReadOnlyFirst.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/SpecialModelName.js b/samples/client/petstore/javascript-promise/src/model/SpecialModelName.js index f1fc92e8f31..076020ccc8a 100644 --- a/samples/client/petstore/javascript-promise/src/model/SpecialModelName.js +++ b/samples/client/petstore/javascript-promise/src/model/SpecialModelName.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Tag.js b/samples/client/petstore/javascript-promise/src/model/Tag.js index 953b2938d3f..c7a037dde45 100644 --- a/samples/client/petstore/javascript-promise/src/model/Tag.js +++ b/samples/client/petstore/javascript-promise/src/model/Tag.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/TypeHolderDefault.js b/samples/client/petstore/javascript-promise/src/model/TypeHolderDefault.js index 187d7930a9e..ec6ff961f72 100644 --- a/samples/client/petstore/javascript-promise/src/model/TypeHolderDefault.js +++ b/samples/client/petstore/javascript-promise/src/model/TypeHolderDefault.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/TypeHolderExample.js b/samples/client/petstore/javascript-promise/src/model/TypeHolderExample.js index 504ba75bfcc..5d274e4ac2a 100644 --- a/samples/client/petstore/javascript-promise/src/model/TypeHolderExample.js +++ b/samples/client/petstore/javascript-promise/src/model/TypeHolderExample.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/User.js b/samples/client/petstore/javascript-promise/src/model/User.js index 1cb456b754f..3ed29d72d89 100644 --- a/samples/client/petstore/javascript-promise/src/model/User.js +++ b/samples/client/petstore/javascript-promise/src/model/User.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/XmlItem.js b/samples/client/petstore/javascript-promise/src/model/XmlItem.js index 1d3419997f0..b21e8851b45 100644 --- a/samples/client/petstore/javascript-promise/src/model/XmlItem.js +++ b/samples/client/petstore/javascript-promise/src/model/XmlItem.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/.openapi-generator/VERSION b/samples/client/petstore/javascript/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/javascript/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript/src/ApiClient.js b/samples/client/petstore/javascript/src/ApiClient.js index e7e8ba7491d..cf176f452c9 100644 --- a/samples/client/petstore/javascript/src/ApiClient.js +++ b/samples/client/petstore/javascript/src/ApiClient.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/api/AnotherFakeApi.js b/samples/client/petstore/javascript/src/api/AnotherFakeApi.js index 6b31599a377..b435a8e512d 100644 --- a/samples/client/petstore/javascript/src/api/AnotherFakeApi.js +++ b/samples/client/petstore/javascript/src/api/AnotherFakeApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/api/FakeApi.js b/samples/client/petstore/javascript/src/api/FakeApi.js index fc77d90b910..dddcb3eda4c 100644 --- a/samples/client/petstore/javascript/src/api/FakeApi.js +++ b/samples/client/petstore/javascript/src/api/FakeApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js b/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js index ffa2dc40733..d1783d2e720 100644 --- a/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js +++ b/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/api/PetApi.js b/samples/client/petstore/javascript/src/api/PetApi.js index 17255a361b0..d027031f3cf 100644 --- a/samples/client/petstore/javascript/src/api/PetApi.js +++ b/samples/client/petstore/javascript/src/api/PetApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/api/StoreApi.js b/samples/client/petstore/javascript/src/api/StoreApi.js index f51e3b64a5d..9773f8fdbf0 100644 --- a/samples/client/petstore/javascript/src/api/StoreApi.js +++ b/samples/client/petstore/javascript/src/api/StoreApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/api/UserApi.js b/samples/client/petstore/javascript/src/api/UserApi.js index 0999e8ab4d3..bed6acfd73a 100644 --- a/samples/client/petstore/javascript/src/api/UserApi.js +++ b/samples/client/petstore/javascript/src/api/UserApi.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/index.js b/samples/client/petstore/javascript/src/index.js index a92a4ab5a22..08ef76e396a 100644 --- a/samples/client/petstore/javascript/src/index.js +++ b/samples/client/petstore/javascript/src/index.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/AdditionalPropertiesAnyType.js b/samples/client/petstore/javascript/src/model/AdditionalPropertiesAnyType.js index f6bd3640800..0bf77f5778b 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesAnyType.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesAnyType.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/AdditionalPropertiesArray.js b/samples/client/petstore/javascript/src/model/AdditionalPropertiesArray.js index d36ecc495ed..25d303da033 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesArray.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesArray.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/AdditionalPropertiesBoolean.js b/samples/client/petstore/javascript/src/model/AdditionalPropertiesBoolean.js index 7d063336200..e2beb4db655 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesBoolean.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesBoolean.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/AdditionalPropertiesClass.js b/samples/client/petstore/javascript/src/model/AdditionalPropertiesClass.js index 37161bd8c3b..2813e54a4b5 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesClass.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/AdditionalPropertiesInteger.js b/samples/client/petstore/javascript/src/model/AdditionalPropertiesInteger.js index d9e860e6470..e7164197a47 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesInteger.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesInteger.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/AdditionalPropertiesNumber.js b/samples/client/petstore/javascript/src/model/AdditionalPropertiesNumber.js index f299469e450..f3969088370 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesNumber.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesNumber.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/AdditionalPropertiesObject.js b/samples/client/petstore/javascript/src/model/AdditionalPropertiesObject.js index 49f7aef8b32..4a9b0ef82e2 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesObject.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesObject.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/AdditionalPropertiesString.js b/samples/client/petstore/javascript/src/model/AdditionalPropertiesString.js index 68a58595cb9..8e685ad794b 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesString.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesString.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Animal.js b/samples/client/petstore/javascript/src/model/Animal.js index 0c4edc9a380..b017e7f3ea7 100644 --- a/samples/client/petstore/javascript/src/model/Animal.js +++ b/samples/client/petstore/javascript/src/model/Animal.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ApiResponse.js b/samples/client/petstore/javascript/src/model/ApiResponse.js index efd7fdf421d..c57bf079d68 100644 --- a/samples/client/petstore/javascript/src/model/ApiResponse.js +++ b/samples/client/petstore/javascript/src/model/ApiResponse.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ArrayOfArrayOfNumberOnly.js b/samples/client/petstore/javascript/src/model/ArrayOfArrayOfNumberOnly.js index fdf87fde4eb..4f9917fd3a1 100644 --- a/samples/client/petstore/javascript/src/model/ArrayOfArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript/src/model/ArrayOfArrayOfNumberOnly.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ArrayOfNumberOnly.js b/samples/client/petstore/javascript/src/model/ArrayOfNumberOnly.js index 2b24c19bfea..821ea6bf79b 100644 --- a/samples/client/petstore/javascript/src/model/ArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript/src/model/ArrayOfNumberOnly.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ArrayTest.js b/samples/client/petstore/javascript/src/model/ArrayTest.js index 60600762ce1..a2b78d0501a 100644 --- a/samples/client/petstore/javascript/src/model/ArrayTest.js +++ b/samples/client/petstore/javascript/src/model/ArrayTest.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Capitalization.js b/samples/client/petstore/javascript/src/model/Capitalization.js index bdba5b0cc38..a41a5373dd6 100644 --- a/samples/client/petstore/javascript/src/model/Capitalization.js +++ b/samples/client/petstore/javascript/src/model/Capitalization.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Cat.js b/samples/client/petstore/javascript/src/model/Cat.js index f5f9ebf49a7..88cc86b5ce1 100644 --- a/samples/client/petstore/javascript/src/model/Cat.js +++ b/samples/client/petstore/javascript/src/model/Cat.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/CatAllOf.js b/samples/client/petstore/javascript/src/model/CatAllOf.js index b64eee29e11..09a00c6b218 100644 --- a/samples/client/petstore/javascript/src/model/CatAllOf.js +++ b/samples/client/petstore/javascript/src/model/CatAllOf.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Category.js b/samples/client/petstore/javascript/src/model/Category.js index a8fa9b082f0..f5cc9d32c31 100644 --- a/samples/client/petstore/javascript/src/model/Category.js +++ b/samples/client/petstore/javascript/src/model/Category.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ClassModel.js b/samples/client/petstore/javascript/src/model/ClassModel.js index 13e05a6f361..4ce4fe42d5c 100644 --- a/samples/client/petstore/javascript/src/model/ClassModel.js +++ b/samples/client/petstore/javascript/src/model/ClassModel.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Client.js b/samples/client/petstore/javascript/src/model/Client.js index aa4ca0493f5..47000e6f0c9 100644 --- a/samples/client/petstore/javascript/src/model/Client.js +++ b/samples/client/petstore/javascript/src/model/Client.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Dog.js b/samples/client/petstore/javascript/src/model/Dog.js index 138d5d13fb0..0d2d6c432d7 100644 --- a/samples/client/petstore/javascript/src/model/Dog.js +++ b/samples/client/petstore/javascript/src/model/Dog.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/DogAllOf.js b/samples/client/petstore/javascript/src/model/DogAllOf.js index 5d6a9a1072d..d9157867d4a 100644 --- a/samples/client/petstore/javascript/src/model/DogAllOf.js +++ b/samples/client/petstore/javascript/src/model/DogAllOf.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/EnumArrays.js b/samples/client/petstore/javascript/src/model/EnumArrays.js index 8580dfd308f..5a3d166ec66 100644 --- a/samples/client/petstore/javascript/src/model/EnumArrays.js +++ b/samples/client/petstore/javascript/src/model/EnumArrays.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/EnumClass.js b/samples/client/petstore/javascript/src/model/EnumClass.js index 9c335fdfbb0..a17ee900772 100644 --- a/samples/client/petstore/javascript/src/model/EnumClass.js +++ b/samples/client/petstore/javascript/src/model/EnumClass.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/EnumTest.js b/samples/client/petstore/javascript/src/model/EnumTest.js index 038926ccdb8..2d993f9e688 100644 --- a/samples/client/petstore/javascript/src/model/EnumTest.js +++ b/samples/client/petstore/javascript/src/model/EnumTest.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/File.js b/samples/client/petstore/javascript/src/model/File.js index 8042cfad4b9..f6455a933d0 100644 --- a/samples/client/petstore/javascript/src/model/File.js +++ b/samples/client/petstore/javascript/src/model/File.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/FileSchemaTestClass.js b/samples/client/petstore/javascript/src/model/FileSchemaTestClass.js index e29880db9ae..2f7a72e03a9 100644 --- a/samples/client/petstore/javascript/src/model/FileSchemaTestClass.js +++ b/samples/client/petstore/javascript/src/model/FileSchemaTestClass.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/FormatTest.js b/samples/client/petstore/javascript/src/model/FormatTest.js index 5772988329a..5c0304d6d49 100644 --- a/samples/client/petstore/javascript/src/model/FormatTest.js +++ b/samples/client/petstore/javascript/src/model/FormatTest.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/HasOnlyReadOnly.js b/samples/client/petstore/javascript/src/model/HasOnlyReadOnly.js index 3fe20b3023a..2df9454f0ee 100644 --- a/samples/client/petstore/javascript/src/model/HasOnlyReadOnly.js +++ b/samples/client/petstore/javascript/src/model/HasOnlyReadOnly.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/List.js b/samples/client/petstore/javascript/src/model/List.js index 7aa75478844..9936619f933 100644 --- a/samples/client/petstore/javascript/src/model/List.js +++ b/samples/client/petstore/javascript/src/model/List.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/MapTest.js b/samples/client/petstore/javascript/src/model/MapTest.js index d04243f15df..f8337f5c4a9 100644 --- a/samples/client/petstore/javascript/src/model/MapTest.js +++ b/samples/client/petstore/javascript/src/model/MapTest.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js b/samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js index c5461ad5476..3cee3ee0e62 100644 --- a/samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Model200Response.js b/samples/client/petstore/javascript/src/model/Model200Response.js index 078f612468a..c980b96bb95 100644 --- a/samples/client/petstore/javascript/src/model/Model200Response.js +++ b/samples/client/petstore/javascript/src/model/Model200Response.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ModelReturn.js b/samples/client/petstore/javascript/src/model/ModelReturn.js index f2c210aeb0d..89a0620c273 100644 --- a/samples/client/petstore/javascript/src/model/ModelReturn.js +++ b/samples/client/petstore/javascript/src/model/ModelReturn.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Name.js b/samples/client/petstore/javascript/src/model/Name.js index 8e2caf658e2..6dae98a4594 100644 --- a/samples/client/petstore/javascript/src/model/Name.js +++ b/samples/client/petstore/javascript/src/model/Name.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/NumberOnly.js b/samples/client/petstore/javascript/src/model/NumberOnly.js index 3d99a053817..a17fddd0471 100644 --- a/samples/client/petstore/javascript/src/model/NumberOnly.js +++ b/samples/client/petstore/javascript/src/model/NumberOnly.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Order.js b/samples/client/petstore/javascript/src/model/Order.js index 4b4250c6a74..eab21937f65 100644 --- a/samples/client/petstore/javascript/src/model/Order.js +++ b/samples/client/petstore/javascript/src/model/Order.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/OuterComposite.js b/samples/client/petstore/javascript/src/model/OuterComposite.js index 99e0a5c5d97..d188e82444a 100644 --- a/samples/client/petstore/javascript/src/model/OuterComposite.js +++ b/samples/client/petstore/javascript/src/model/OuterComposite.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/OuterEnum.js b/samples/client/petstore/javascript/src/model/OuterEnum.js index 03931bc7232..6153e467d18 100644 --- a/samples/client/petstore/javascript/src/model/OuterEnum.js +++ b/samples/client/petstore/javascript/src/model/OuterEnum.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Pet.js b/samples/client/petstore/javascript/src/model/Pet.js index 0c1fdcd196e..148254bcbc8 100644 --- a/samples/client/petstore/javascript/src/model/Pet.js +++ b/samples/client/petstore/javascript/src/model/Pet.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ReadOnlyFirst.js b/samples/client/petstore/javascript/src/model/ReadOnlyFirst.js index 72c17a9f3e0..896fb6484d4 100644 --- a/samples/client/petstore/javascript/src/model/ReadOnlyFirst.js +++ b/samples/client/petstore/javascript/src/model/ReadOnlyFirst.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/SpecialModelName.js b/samples/client/petstore/javascript/src/model/SpecialModelName.js index f1fc92e8f31..076020ccc8a 100644 --- a/samples/client/petstore/javascript/src/model/SpecialModelName.js +++ b/samples/client/petstore/javascript/src/model/SpecialModelName.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Tag.js b/samples/client/petstore/javascript/src/model/Tag.js index 953b2938d3f..c7a037dde45 100644 --- a/samples/client/petstore/javascript/src/model/Tag.js +++ b/samples/client/petstore/javascript/src/model/Tag.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/TypeHolderDefault.js b/samples/client/petstore/javascript/src/model/TypeHolderDefault.js index 187d7930a9e..ec6ff961f72 100644 --- a/samples/client/petstore/javascript/src/model/TypeHolderDefault.js +++ b/samples/client/petstore/javascript/src/model/TypeHolderDefault.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/TypeHolderExample.js b/samples/client/petstore/javascript/src/model/TypeHolderExample.js index 504ba75bfcc..5d274e4ac2a 100644 --- a/samples/client/petstore/javascript/src/model/TypeHolderExample.js +++ b/samples/client/petstore/javascript/src/model/TypeHolderExample.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/User.js b/samples/client/petstore/javascript/src/model/User.js index 1cb456b754f..3ed29d72d89 100644 --- a/samples/client/petstore/javascript/src/model/User.js +++ b/samples/client/petstore/javascript/src/model/User.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/XmlItem.js b/samples/client/petstore/javascript/src/model/XmlItem.js index 1d3419997f0..b21e8851b45 100644 --- a/samples/client/petstore/javascript/src/model/XmlItem.js +++ b/samples/client/petstore/javascript/src/model/XmlItem.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/kotlin-string/.openapi-generator/VERSION b/samples/client/petstore/kotlin-string/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/kotlin-string/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-string/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION b/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin/.openapi-generator/VERSION b/samples/client/petstore/kotlin/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/kotlin/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/perl/.openapi-generator/VERSION b/samples/client/petstore/perl/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/perl/.openapi-generator/VERSION +++ b/samples/client/petstore/perl/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION +++ b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php index 03826caff9a..ef1bff4b99c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index d3f96368a9d..3f1b787a0a8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php index 1259483af5d..b25fd69069f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php index 5c269cbede8..81e6bd6b629 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php index 8040fe95e96..9c765f2d0d6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php index 058ef039c2e..f7f38f7c8eb 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php index 93c6fe56f7f..6db91777210 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php index b8897384203..e40a7758da5 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php b/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php index 0448f78fafd..4adf9aba84c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesAnyType.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesAnyType.php index 8087b6fc4d0..cd3ffebf82a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesAnyType.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesAnyType.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesArray.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesArray.php index fa670102eb8..5fbff73798a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesArray.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesArray.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesBoolean.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesBoolean.php index c582ca020a5..0aae2a4433f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesBoolean.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesBoolean.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php index 365158b215c..e8371d21997 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesInteger.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesInteger.php index e308b7a70a7..bb2a810a14d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesInteger.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesInteger.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesNumber.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesNumber.php index 3c46324e9f0..b857eb5693d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesNumber.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesNumber.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesObject.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesObject.php index 667f2bb0003..841e9b95c06 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesObject.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesObject.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesString.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesString.php index 8333432433d..678a69ed1b1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesString.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesString.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php index ddfa967fe31..ec4e8cbe34e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php index 30f673754f9..47c25f4415b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php index 70c86d8d19d..bf3eedd8207 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php index 1015e748089..3b9dae89a9c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php index b9eca45a71c..2ca2e7603a9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php index 0cd8bbc0f5e..8cf27800717 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php index a4beb8007e5..f8e9796bea8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php index 760ad2a81aa..341ea6af9ef 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php index 6a34329d7be..1d5575e0b23 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php index 4834bda0344..cffb5ef289e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php index 6e7930ab292..7abdfe35ee3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php index b7c9762765f..fe9f05b1c8b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php index a7c17fe156b..44302832092 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php index 289f1d86db6..722dcd9f306 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php index 839b4b16754..b8d0beaf917 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php index 56d3ff0421b..4ec5b633c18 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php index 7654a9107e8..0d7e229a885 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php index 0c359e2a240..d199354f734 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php index af8b9dd060c..d677f766698 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php index 700378d0a22..b4576165ddb 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php index c1923d9d291..737718d5d1a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index 7522a791178..bb79ae32986 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php index be08a19c799..bd417582bd4 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php index b5fece9a78d..044f98f6f0b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php index 08fc12f5b08..788418bfd41 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php index d183cdd53fe..33dc1ea1632 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php index 6c29d9067fb..e7a3ec4990c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php index 83efd3332b8..b137503a749 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php index 6e656b15335..0937f1b7b73 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php index 3efa6e1f5ce..6c289b0e375 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php index 5f565a4bffd..d9e07714fe8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php index 4fcaff7b54f..ab5c5ee0a39 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php index 652f37b69fc..b34abb7b77d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php index 7bb118029cd..e1495174a7f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php index 43507bf63de..1392dd720d9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderDefault.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderDefault.php index e7042d471c5..7d5476e6540 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderDefault.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderDefault.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderExample.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderExample.php index 9ccc3c47e4e..352003bd73d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderExample.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/TypeHolderExample.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php index 6744b9c21f9..21e47342396 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/XmlItem.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/XmlItem.php index c1f72e97ca1..a9d4bc3ba09 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/XmlItem.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/XmlItem.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index e2faef5275e..a391d352917 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php index 7ff12ef9614..dfa7692a343 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php index c28d4a2fecc..9e1861a7eb1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php index 2697a21342e..919affe6a09 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php index 2d04e353fe3..20ee41ad6d0 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php index fe51ce2f3ef..c81b5b2a95d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php index 6ee055793ad..edb2ab00390 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesAnyTypeTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesAnyTypeTest.php index 9d4fe764e90..920dfd13886 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesAnyTypeTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesAnyTypeTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesArrayTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesArrayTest.php index a19d6419129..e46caff4c82 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesArrayTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesArrayTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesBooleanTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesBooleanTest.php index 38c092033e0..6c19b5678d9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesBooleanTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesBooleanTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php index 22370b43a0b..a013b4d4976 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesIntegerTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesIntegerTest.php index 3dea9a4c9c9..752bc12baba 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesIntegerTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesIntegerTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesNumberTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesNumberTest.php index 235cd1b2033..d1a51551b19 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesNumberTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesNumberTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesObjectTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesObjectTest.php index 23d4b25baf7..49bf14a22a8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesObjectTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesObjectTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesStringTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesStringTest.php index 310107ce66c..79257932404 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesStringTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesStringTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php index 598ba353ef5..f328a851772 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php index ff127b64901..d96ba911dcc 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php index a80c4a54437..ca9f587dfc1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php index 7c52127e1ad..dc1599f1897 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php index 322fdbc1554..592d0019aac 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php index 02d5965efb0..bdbf1b69969 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php index f5574208ccb..34694656c3d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php index 1b7bbab7839..83e2a690596 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php index 70be8dbb25e..a956506aa3e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php index 063847ceb90..7e1785a115a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php index c4a9eaee088..db8503bf61f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php index 17c4ce9e975..ed543d02f19 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php index bbdf71bcb63..14cb9f0c92c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php index 4c0b5b97fef..7f1e141ab0e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php index 7f83f3312bf..89e172fadcb 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php index 76d1f2fb675..eeec9696f7f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php index 5c042591be1..efb35877071 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php index e67751dd861..7d4e65364f9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php index 7cedfeed44a..7a649d745f5 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php index 25df1e7911c..af17f383884 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php index 14a38f611a1..9fdbe8c734b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php index c59fa9106a4..09f927eef92 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php index b88485f7f44..4899a278bf1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php index 43843dba2b1..deabe3d5615 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php index e93a5e46d18..e483eef4ea5 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php index f3fb739ffad..1e6ab51ba0a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php index fef2a5102d8..f7fbb1b06d5 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php index 9536eb775bf..9dc5c0e54e8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php index 137d9c605d1..402755cdc69 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php index b16b2c37a9b..bd7390b8234 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php index 33b7848030d..5a07a832e09 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php index 1fce252c5dc..53a9beeabce 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php index ebf93790131..546bcab81a6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php index bae67b14a32..ef7450b8500 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/TypeHolderDefaultTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/TypeHolderDefaultTest.php index 37d48bb4936..159d16d7a4c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/TypeHolderDefaultTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/TypeHolderDefaultTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/TypeHolderExampleTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/TypeHolderExampleTest.php index 44ded9d7088..fc51e21b5f1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/TypeHolderExampleTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/TypeHolderExampleTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php index 6a8cb63d036..d6f64a12c47 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/XmlItemTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/XmlItemTest.php index 067c711b4e4..e3cfdeb5747 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/XmlItemTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/XmlItemTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/python-asyncio/.openapi-generator/VERSION b/samples/client/petstore/python-asyncio/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/python-asyncio/.openapi-generator/VERSION +++ b/samples/client/petstore/python-asyncio/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python-tornado/.openapi-generator/VERSION b/samples/client/petstore/python-tornado/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/python-tornado/.openapi-generator/VERSION +++ b/samples/client/petstore/python-tornado/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python/.openapi-generator/VERSION b/samples/client/petstore/python/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/python/.openapi-generator/VERSION +++ b/samples/client/petstore/python/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION b/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java index 2ebd1da3282..d40a47b4c40 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java index ee09f8dc738..523bfc4559f 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java index 56610a8f611..f2c7ddfa415 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud/.openapi-generator/VERSION b/samples/client/petstore/spring-cloud/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/spring-cloud/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-cloud/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java index 862e4695882..792bc14b991 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java index d14b18696a7..b7fb4c498d3 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java index 370af6c2e5a..f8dc43bcf16 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-stubs/.openapi-generator/VERSION b/samples/client/petstore/spring-stubs/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/spring-stubs/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-stubs/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java index 68659995e73..96e2c2468dd 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java index 41bc02d2d81..ad743438b59 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java index 83c2c9019e2..5f235e3006d 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/typescript-angular-v2/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v2/default/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-angular-v2/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v2/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v2/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v2/npm/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v2/npm/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v2/with-interfaces/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v4.3/npm/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v4.3/npm/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v4/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v4/npm/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v4/npm/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angularjs/.openapi-generator/VERSION b/samples/client/petstore/typescript-angularjs/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-angularjs/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angularjs/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION b/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/meta-codegen/lib/pom.xml b/samples/meta-codegen/lib/pom.xml index 38d08719b84..b6005565c41 100644 --- a/samples/meta-codegen/lib/pom.xml +++ b/samples/meta-codegen/lib/pom.xml @@ -121,7 +121,7 @@ UTF-8 - 4.1.1-SNAPSHOT + 4.2.0-SNAPSHOT 1.0.0 4.8.1 diff --git a/samples/meta-codegen/usage/.openapi-generator/VERSION b/samples/meta-codegen/usage/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/meta-codegen/usage/.openapi-generator/VERSION +++ b/samples/meta-codegen/usage/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION b/samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php index d1a2b166a67..8a4d3831608 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php index 54324571301..f685cf7d868 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index 185418cadfb..e15ba5f9bb3 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php index 71e93259e10..2a345ee40fc 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php index 084e7b62874..d64fd33cc5f 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php index f4d241d28a4..0191431ed93 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php index c6104c9f588..da93b09407b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ApiException.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ApiException.php index 93c6fe56f7f..6db91777210 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ApiException.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ApiException.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Configuration.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Configuration.php index 6d082d9ecbd..15d952580e8 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Configuration.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Configuration.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php index 0448f78fafd..4adf9aba84c 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php index f315059c99c..8d56cb65404 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php index ddfa967fe31..ec4e8cbe34e 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php index 30f673754f9..47c25f4415b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php index 70c86d8d19d..bf3eedd8207 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php index 1015e748089..3b9dae89a9c 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php index b9eca45a71c..2ca2e7603a9 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php index 0cd8bbc0f5e..8cf27800717 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php index a4beb8007e5..f8e9796bea8 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php index 760ad2a81aa..341ea6af9ef 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php index 6a34329d7be..1d5575e0b23 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php index 4834bda0344..cffb5ef289e 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php index 6e7930ab292..7abdfe35ee3 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php index b7c9762765f..fe9f05b1c8b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php index a7c17fe156b..44302832092 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php index 289f1d86db6..722dcd9f306 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php index 839b4b16754..b8d0beaf917 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php index bf2c564cc6d..9a390f35667 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php index 7654a9107e8..0d7e229a885 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/File.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php index 0c359e2a240..d199354f734 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php index 1e6b27ee6c4..e5ead162272 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php index d13a1f13423..aba41fcce9f 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php index 700378d0a22..b4576165ddb 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php index a78add5c5a8..db192136805 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php index 3bb2e1a6ccc..5710444d4fc 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php index 5dac3e1787e..62ba22db48a 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject1.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php index 2c55b6e99f4..1caeccee0da 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject2.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php index 8d57b3a3323..b55dfd64ada 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject3.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php index 2c99c30605a..29e952fa372 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject4.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php index e78018d6d54..1ef3fe246e7 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineObject5.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php index 4b17d92d13e..f01c690cd00 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php index c1923d9d291..737718d5d1a 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index 7522a791178..bb79ae32986 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php index be08a19c799..bd417582bd4 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php index b5fece9a78d..044f98f6f0b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php index 08fc12f5b08..788418bfd41 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php index d183cdd53fe..33dc1ea1632 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php index 6c29d9067fb..e7a3ec4990c 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php index ad2ff948639..652c7ca3c69 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php index 83efd3332b8..b137503a749 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php index 6e656b15335..0937f1b7b73 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php index 3efa6e1f5ce..6c289b0e375 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php index 5f565a4bffd..d9e07714fe8 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php index 42a2fcac673..650a5f2ba0f 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php index ba96a75c33c..2826549f471 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php index 15846b65121..5228d57b1cf 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php index 4fcaff7b54f..ab5c5ee0a39 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php index 652f37b69fc..b34abb7b77d 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php index 862e3899122..eeee6e5a6d5 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php index 43507bf63de..1392dd720d9 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php index 6744b9c21f9..21e47342396 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Model/User.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index e2faef5275e..a391d352917 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php index 7ff12ef9614..dfa7692a343 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/DefaultApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/DefaultApiTest.php index 87bcc51b1c0..e9aacd4c3bd 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/DefaultApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/DefaultApiTest.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php index 738ce73466c..7993e84c92e 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php index 2697a21342e..919affe6a09 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php index 2d04e353fe3..20ee41ad6d0 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php index fe51ce2f3ef..c81b5b2a95d 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php index 6ee055793ad..edb2ab00390 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php @@ -17,7 +17,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php index 7200c186bcb..89436f230de 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php index 598ba353ef5..f328a851772 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php index ff127b64901..d96ba911dcc 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php index a80c4a54437..ca9f587dfc1 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php index 7c52127e1ad..dc1599f1897 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php index 322fdbc1554..592d0019aac 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php index 02d5965efb0..bdbf1b69969 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php index f5574208ccb..34694656c3d 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php index 1b7bbab7839..83e2a690596 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php index 70be8dbb25e..a956506aa3e 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php index 063847ceb90..7e1785a115a 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php index c4a9eaee088..db8503bf61f 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php index 17c4ce9e975..ed543d02f19 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php index bbdf71bcb63..14cb9f0c92c 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php index 4c0b5b97fef..7f1e141ab0e 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php index 7f83f3312bf..89e172fadcb 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php index 128b563d3db..0ca67c0ecf9 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php index 5c042591be1..efb35877071 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php index e67751dd861..7d4e65364f9 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FooTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FooTest.php index cab54545d64..ebcbcf22fe7 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FooTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FooTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php index 4d9b55277bd..a7ba445aa29 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php index 25df1e7911c..af17f383884 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HealthCheckResultTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HealthCheckResultTest.php index e8e9bc75e3c..4ca14ecc101 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HealthCheckResultTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/HealthCheckResultTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject1Test.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject1Test.php index 5984370f0ac..ed92bbd2e9b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject1Test.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject1Test.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject2Test.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject2Test.php index 078bd308ae1..9fb81feebd0 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject2Test.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject2Test.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject3Test.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject3Test.php index f63c1117365..9f7a4bd1279 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject3Test.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject3Test.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject4Test.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject4Test.php index 0a31cf34651..dcaa435fc1b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject4Test.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject4Test.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject5Test.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject5Test.php index c1d60bfd93b..aa1b7fceec1 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject5Test.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObject5Test.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObjectTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObjectTest.php index 1069f575761..c484492a5f9 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObjectTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineObjectTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineResponseDefaultTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineResponseDefaultTest.php index c4553c0dd82..e01739732e6 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineResponseDefaultTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/InlineResponseDefaultTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php index 14a38f611a1..9fdbe8c734b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php index c59fa9106a4..09f927eef92 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php index b88485f7f44..4899a278bf1 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php index 43843dba2b1..deabe3d5615 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php index e93a5e46d18..e483eef4ea5 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php index f3fb739ffad..1e6ab51ba0a 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NullableClassTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NullableClassTest.php index 9ead82fa849..7bec29ffc80 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NullableClassTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NullableClassTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php index fef2a5102d8..f7fbb1b06d5 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php index 9536eb775bf..9dc5c0e54e8 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php index 137d9c605d1..402755cdc69 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumDefaultValueTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumDefaultValueTest.php index 3ea20e311e0..4436e5c21cb 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumDefaultValueTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumDefaultValueTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerDefaultValueTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerDefaultValueTest.php index e18d0d5db5c..31cc924628d 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerDefaultValueTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerDefaultValueTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerTest.php index 8950d7f102b..0244038de60 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php index b16b2c37a9b..bd7390b8234 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php index 33b7848030d..5a07a832e09 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php index 1fce252c5dc..53a9beeabce 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php index ebf93790131..546bcab81a6 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php index bae67b14a32..ef7450b8500 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php index 6a8cb63d036..d6f64a12c47 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php @@ -18,7 +18,7 @@ * The version of the OpenAPI document: 1.0.0 * * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 4.1.1-SNAPSHOT + * OpenAPI Generator version: 4.2.0-SNAPSHOT */ /** diff --git a/samples/openapi3/client/petstore/python/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/openapi3/client/petstore/python/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/python/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/VERSION b/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore.rb index 50ae5e03d0d..acf7ff90ec0 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb index e828d7208b4..a1cc0990397 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb index 517cd52709f..d63f3c74629 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb index 9d04817774d..db8b6cbb04d 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb index efc6c0d29c6..2fb479ffa11 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb index 1046df37b6d..8501d6c483c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb index 9e577bbf534..a30d9da6c10 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb index 51cee2bc4e8..c2e8e65d7b8 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_client.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_client.rb index da74bafbc6c..fb3dc89fc8f 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_client.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_error.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_error.rb index 06edcc78dc7..61a202d3a45 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_error.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/configuration.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/configuration.rb index a6f5ceefe47..36e285ffbfb 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/configuration.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb index d1e15cc183a..8aa2fab0557 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/animal.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/animal.rb index 4bb43b9b3f2..0f306bf2f9a 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/animal.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/animal.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb index b97381b8f3c..05f0916ae03 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb index 6524faab1bb..b0604460fd3 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb index 2cb6117756c..cd849d81871 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb index 6e8b6c9c415..994e2857879 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb index 9e0b353acb0..24378d95723 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat.rb index 0e371fdab38..9ce01766336 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb index 220f108d8cc..3bb617301ec 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/category.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/category.rb index 8089f254d4f..2534502ee45 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/category.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/category.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb index 8aa5d5272f2..dc391cf09d8 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/client.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/client.rb index e70206c160d..789892fc379 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/client.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog.rb index 19203ab642c..e504df5c3df 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb index e96ac015802..fec9b9517a1 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb index 5b565597132..51d904e9226 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb index e105ff447a8..32c3cb9755e 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb index 00e245e8a70..c0ac2d1b64f 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file.rb index 6bce09460dc..e9b38a54d16 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb index 7bb95e34fd2..a7b89286cb5 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/foo.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/foo.rb index 32c01cb0a69..b3e57141cb3 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/foo.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/foo.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb index 0b1472d0e00..e0a6eb26548 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb index e916d10b16c..c80fda59e2e 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb index 3ec740ccf7f..5422416ad53 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb index f7319904db9..6edcc45e37d 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb index 2b0281d553e..8081daaff55 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object1.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb index 5312efc42a0..2276f08790f 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object2.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb index 073e4822d76..4c50dcf1d08 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object3.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb index 1048510ded5..c1f9b24b596 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object4.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb index 4782507a78c..d6369f52700 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_object5.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb index 336486e966a..53855e92d9c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/list.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/list.rb index db861f23f77..18a9c412a08 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/list.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb index c8465b1823c..f9880f3acda 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index 7e5ed178810..812b0ed159b 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb index 552de582c69..235f67b7ebb 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb index 3aaa464c8e3..ee572c4f792 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/name.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/name.rb index 30250644183..e5de782f583 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/name.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb index 92efb7fdaeb..495aed1266c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb index 553ca99beb3..85001f95f75 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/order.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/order.rb index c790d702702..5beeeb5c30c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/order.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/order.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb index dd05f8ade30..8a049ccf9db 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb index d24a7b353ff..9abfa583463 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb index f6b631e7749..0a9d0179885 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb index 92a0b518e32..33d03e4447c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb index a7542f4cac4..cce4f687b43 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/pet.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/pet.rb index 59cbcadc5a6..4244d562ee0 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/pet.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/pet.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb index beccaccac43..8db7c752795 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb index f16178a214c..44424fa712d 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/tag.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/tag.rb index 700c27baf17..4938dd170b7 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/tag.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/tag.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/user.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/user.rb index be6a8e9350a..4309ea6a63d 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/user.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/models/user.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/version.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/version.rb index 37b31e0899a..eaaa4a9ba3a 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/version.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec b/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec index 348b1213f44..4a11c0dad82 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec +++ b/samples/openapi3/client/petstore/ruby-faraday/petstore.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb index ab755e9edf8..b138a02a896 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/another_fake_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/default_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/default_api_spec.rb index 61dceb031d7..b8be97a3df6 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/default_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/default_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb index 3c9cce607b8..f1cff68a8b7 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb index 7a279d9efa9..614aa439274 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_classname_tags123_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb index b47e785aabe..e06864d1b7f 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/pet_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/store_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/store_api_spec.rb index 0792a31a847..2a2ad87757c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/store_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/store_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/user_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/user_api_spec.rb index 327075b8368..2c3c9e787a1 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/user_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/user_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api_client_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api_client_spec.rb index f66015c816e..a8383d805b5 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api_client_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/configuration_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/configuration_spec.rb index 08a875cffef..7a9334b1640 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/configuration_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb index 00a004c2fb0..460d5d7f77a 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/additional_properties_class_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/animal_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/animal_spec.rb index c6610d36e11..013704b05dc 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/animal_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/animal_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/api_response_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/api_response_spec.rb index 700bdaa2aec..59f192bab43 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/api_response_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/api_response_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb index ef282fa6b89..31e351374c9 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_array_of_number_only_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb index ecc5ad52c4e..230acecfb16 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_of_number_only_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_test_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_test_spec.rb index 42c8c835113..5f87bc0f954 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_test_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/array_test_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb index a2273bae192..54bddceed0a 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/capitalization_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb index c27179120c5..4e2b0007bfc 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_all_of_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_spec.rb index b0e1093fefb..2153fe8a4d5 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/cat_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/category_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/category_spec.rb index a437816f7a3..754370bbaa8 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/category_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/category_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/class_model_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/class_model_spec.rb index 28e126def6c..eccccfd49c5 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/class_model_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/class_model_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/client_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/client_spec.rb index 0a2446b6bb0..768184fbc05 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/client_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb index 45fb6a3c422..ec71e333b63 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_all_of_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_spec.rb index 46da564fab5..38fe98e3435 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/dog_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb index 2ea117c042e..6b8e65d84f7 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_arrays_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb index abd0f551148..38b01db5b8e 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_class_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb index d26e2693d27..93cf1e9dfb5 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/enum_test_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb index d8ff3c21006..aa2716105de 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_schema_test_class_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_spec.rb index 50c1c6c4e15..db8a5e94930 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/file_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/foo_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/foo_spec.rb index f7915c8d68e..57e37f92828 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/foo_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/foo_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/format_test_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/format_test_spec.rb index 9f1785bcbe2..d9e29942d41 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/format_test_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/format_test_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb index 24392afa873..491b7faa76b 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/has_only_read_only_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/health_check_result_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/health_check_result_spec.rb index 2a1aaac7826..569c15cda1b 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/health_check_result_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/health_check_result_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object1_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object1_spec.rb index 6fd340cd5c4..325ea712b2f 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object1_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object1_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object2_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object2_spec.rb index cedf2d70a10..c3918233c39 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object2_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object2_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object3_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object3_spec.rb index c092d479678..6c8d494b240 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object3_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object3_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object4_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object4_spec.rb index 50fde4ba0e9..c03f3249141 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object4_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object4_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object5_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object5_spec.rb index eab00d67881..4deff89ddaa 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object5_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object5_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object_spec.rb index 15b6e33b8c8..bbd61dc957f 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_object_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_response_default_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_response_default_spec.rb index 4433c9e1d48..ed67697fad9 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_response_default_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/inline_response_default_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/list_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/list_spec.rb index b1829647634..1b50f389a55 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/list_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/list_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/map_test_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/map_test_spec.rb index 729dc35145c..b95e630efa0 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/map_test_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/map_test_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb index bd675e88e7f..a8dba924ecc 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/mixed_properties_and_additional_properties_class_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb index 701e9891fb8..02e60ff3266 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/model200_response_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/model_return_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/model_return_spec.rb index f4bdd9253ce..58ac90b608d 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/model_return_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/model_return_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/name_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/name_spec.rb index 6f8633c7563..58c6c0d0aea 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/name_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/name_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/nullable_class_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/nullable_class_spec.rb index f508ba98b4f..f72e4d0de2e 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/nullable_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/nullable_class_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/number_only_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/number_only_spec.rb index 093452f4608..03c332272b2 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/number_only_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/number_only_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/order_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/order_spec.rb index 9f7cb8f767e..385b1ff36af 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/order_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/order_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb index fb670b2977e..16a8f4ecc1d 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_composite_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_default_value_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_default_value_spec.rb index 72d3c549667..3003761cfa8 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_default_value_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_default_value_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_default_value_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_default_value_spec.rb index 310e4ee6fda..b525690284b 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_default_value_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_default_value_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_spec.rb index 3e69113a392..b40156fad9c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_integer_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb index d196aa079e9..c9a59704edd 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/outer_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/pet_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/pet_spec.rb index 74ea31c6959..840b257fd67 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/pet_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/pet_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb index 960d289dde7..e6e44f30f6c 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/read_only_first_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb index c8264386763..ab4e628d4d1 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/special_model_name_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/tag_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/tag_spec.rb index 72cf2dd5115..72fbc4adccf 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/tag_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/tag_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/models/user_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/models/user_spec.rb index d64a11e2b48..553ba475425 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/models/user_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/models/user_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/spec_helper.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/spec_helper.rb index 6b9663ca664..0d935b668cd 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/spec_helper.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/.openapi-generator/VERSION b/samples/openapi3/client/petstore/ruby/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/openapi3/client/petstore/ruby/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/ruby/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore.rb b/samples/openapi3/client/petstore/ruby/lib/petstore.rb index 50ae5e03d0d..acf7ff90ec0 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/another_fake_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/another_fake_api.rb index e828d7208b4..a1cc0990397 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/another_fake_api.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api/another_fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/default_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/default_api.rb index 517cd52709f..d63f3c74629 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/default_api.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api/default_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb index 9d04817774d..db8b6cbb04d 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb index efc6c0d29c6..2fb479ffa11 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/pet_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/pet_api.rb index 1046df37b6d..8501d6c483c 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/pet_api.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api/pet_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/store_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/store_api.rb index 9e577bbf534..a30d9da6c10 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/store_api.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api/store_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/user_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/user_api.rb index 51cee2bc4e8..c2e8e65d7b8 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/user_api.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api/user_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api_client.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api_client.rb index 6abea99e7ff..bc148e3db34 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api_client.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api_error.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api_error.rb index 06edcc78dc7..61a202d3a45 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api_error.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/configuration.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/configuration.rb index ead5913764b..5a893c012bb 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb index d1e15cc183a..8aa2fab0557 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/animal.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/animal.rb index 4bb43b9b3f2..0f306bf2f9a 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/animal.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/animal.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/api_response.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/api_response.rb index b97381b8f3c..05f0916ae03 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/api_response.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/api_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb index 6524faab1bb..b0604460fd3 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb index 2cb6117756c..cd849d81871 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_test.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_test.rb index 6e8b6c9c415..994e2857879 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_test.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/array_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/capitalization.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/capitalization.rb index 9e0b353acb0..24378d95723 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/capitalization.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/capitalization.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat.rb index 0e371fdab38..9ce01766336 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat_all_of.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat_all_of.rb index 220f108d8cc..3bb617301ec 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat_all_of.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/cat_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/category.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/category.rb index 8089f254d4f..2534502ee45 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/category.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/category.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/class_model.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/class_model.rb index 8aa5d5272f2..dc391cf09d8 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/class_model.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/class_model.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/client.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/client.rb index e70206c160d..789892fc379 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/client.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog.rb index 19203ab642c..e504df5c3df 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog_all_of.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog_all_of.rb index e96ac015802..fec9b9517a1 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog_all_of.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/dog_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_arrays.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_arrays.rb index 5b565597132..51d904e9226 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_arrays.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_arrays.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_class.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_class.rb index e105ff447a8..32c3cb9755e 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_class.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_test.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_test.rb index 00e245e8a70..c0ac2d1b64f 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_test.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/enum_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/file.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/file.rb index 6bce09460dc..e9b38a54d16 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/file.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/file.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb index 7bb95e34fd2..a7b89286cb5 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/foo.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/foo.rb index 32c01cb0a69..b3e57141cb3 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/foo.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/foo.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/format_test.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/format_test.rb index 0b1472d0e00..e0a6eb26548 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/format_test.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/format_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb index e916d10b16c..c80fda59e2e 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/health_check_result.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/health_check_result.rb index 3ec740ccf7f..5422416ad53 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/health_check_result.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/health_check_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object.rb index f7319904db9..6edcc45e37d 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object1.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object1.rb index 2b0281d553e..8081daaff55 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object1.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object1.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object2.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object2.rb index 5312efc42a0..2276f08790f 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object2.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object2.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object3.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object3.rb index 073e4822d76..4c50dcf1d08 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object3.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object3.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object4.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object4.rb index 1048510ded5..c1f9b24b596 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object4.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object4.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object5.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object5.rb index 4782507a78c..d6369f52700 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object5.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_object5.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_response_default.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_response_default.rb index 336486e966a..53855e92d9c 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_response_default.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/inline_response_default.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/list.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/list.rb index db861f23f77..18a9c412a08 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/list.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/map_test.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/map_test.rb index c8465b1823c..f9880f3acda 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/map_test.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/map_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index 7e5ed178810..812b0ed159b 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/model200_response.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/model200_response.rb index 552de582c69..235f67b7ebb 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/model200_response.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/model200_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/model_return.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/model_return.rb index 3aaa464c8e3..ee572c4f792 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/model_return.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/model_return.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/name.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/name.rb index 30250644183..e5de782f583 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/name.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/nullable_class.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/nullable_class.rb index 92efb7fdaeb..495aed1266c 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/nullable_class.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/nullable_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/number_only.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/number_only.rb index 553ca99beb3..85001f95f75 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/number_only.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/order.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/order.rb index c790d702702..5beeeb5c30c 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/order.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/order.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_composite.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_composite.rb index dd05f8ade30..8a049ccf9db 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_composite.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_composite.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum.rb index d24a7b353ff..9abfa583463 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb index f6b631e7749..0a9d0179885 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb index 92a0b518e32..33d03e4447c 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb index a7542f4cac4..cce4f687b43 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/pet.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/pet.rb index 59cbcadc5a6..4244d562ee0 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/pet.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/pet.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/read_only_first.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/read_only_first.rb index beccaccac43..8db7c752795 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/read_only_first.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/read_only_first.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/special_model_name.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/special_model_name.rb index f16178a214c..44424fa712d 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/special_model_name.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/special_model_name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/tag.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/tag.rb index 700c27baf17..4938dd170b7 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/tag.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/tag.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/user.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/user.rb index be6a8e9350a..4309ea6a63d 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/user.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/models/user.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/version.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/version.rb index 37b31e0899a..eaaa4a9ba3a 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/version.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/petstore.gemspec b/samples/openapi3/client/petstore/ruby/petstore.gemspec index e6fe7aa474b..b37d566360b 100644 --- a/samples/openapi3/client/petstore/ruby/petstore.gemspec +++ b/samples/openapi3/client/petstore/ruby/petstore.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/another_fake_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/another_fake_api_spec.rb index ab755e9edf8..b138a02a896 100644 --- a/samples/openapi3/client/petstore/ruby/spec/api/another_fake_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/api/another_fake_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/default_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/default_api_spec.rb index 61dceb031d7..b8be97a3df6 100644 --- a/samples/openapi3/client/petstore/ruby/spec/api/default_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/api/default_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/fake_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/fake_api_spec.rb index 3c9cce607b8..f1cff68a8b7 100644 --- a/samples/openapi3/client/petstore/ruby/spec/api/fake_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/api/fake_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/fake_classname_tags123_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/fake_classname_tags123_api_spec.rb index 7a279d9efa9..614aa439274 100644 --- a/samples/openapi3/client/petstore/ruby/spec/api/fake_classname_tags123_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/api/fake_classname_tags123_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/pet_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/pet_api_spec.rb index b47e785aabe..e06864d1b7f 100644 --- a/samples/openapi3/client/petstore/ruby/spec/api/pet_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/api/pet_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/store_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/store_api_spec.rb index 0792a31a847..2a2ad87757c 100644 --- a/samples/openapi3/client/petstore/ruby/spec/api/store_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/api/store_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/api/user_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/user_api_spec.rb index 327075b8368..2c3c9e787a1 100644 --- a/samples/openapi3/client/petstore/ruby/spec/api/user_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/api/user_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/api_client_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api_client_spec.rb index 468e5f36afc..ebe2564c921 100644 --- a/samples/openapi3/client/petstore/ruby/spec/api_client_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/configuration_spec.rb b/samples/openapi3/client/petstore/ruby/spec/configuration_spec.rb index 08a875cffef..7a9334b1640 100644 --- a/samples/openapi3/client/petstore/ruby/spec/configuration_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/additional_properties_class_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/additional_properties_class_spec.rb index 00a004c2fb0..460d5d7f77a 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/additional_properties_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/additional_properties_class_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/animal_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/animal_spec.rb index c6610d36e11..013704b05dc 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/animal_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/animal_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/api_response_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/api_response_spec.rb index 700bdaa2aec..59f192bab43 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/api_response_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/api_response_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/array_of_array_of_number_only_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/array_of_array_of_number_only_spec.rb index ef282fa6b89..31e351374c9 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/array_of_array_of_number_only_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/array_of_array_of_number_only_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/array_of_number_only_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/array_of_number_only_spec.rb index ecc5ad52c4e..230acecfb16 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/array_of_number_only_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/array_of_number_only_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/array_test_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/array_test_spec.rb index 42c8c835113..5f87bc0f954 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/array_test_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/array_test_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/capitalization_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/capitalization_spec.rb index a2273bae192..54bddceed0a 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/capitalization_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/capitalization_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/cat_all_of_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/cat_all_of_spec.rb index c27179120c5..4e2b0007bfc 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/cat_all_of_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/cat_all_of_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/cat_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/cat_spec.rb index b0e1093fefb..2153fe8a4d5 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/cat_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/cat_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/category_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/category_spec.rb index a437816f7a3..754370bbaa8 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/category_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/category_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/class_model_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/class_model_spec.rb index 28e126def6c..eccccfd49c5 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/class_model_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/class_model_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/client_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/client_spec.rb index 0a2446b6bb0..768184fbc05 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/client_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/dog_all_of_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/dog_all_of_spec.rb index 45fb6a3c422..ec71e333b63 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/dog_all_of_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/dog_all_of_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/dog_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/dog_spec.rb index 46da564fab5..38fe98e3435 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/dog_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/dog_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/enum_arrays_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/enum_arrays_spec.rb index 2ea117c042e..6b8e65d84f7 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/enum_arrays_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/enum_arrays_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/enum_class_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/enum_class_spec.rb index abd0f551148..38b01db5b8e 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/enum_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/enum_class_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/enum_test_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/enum_test_spec.rb index d26e2693d27..93cf1e9dfb5 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/enum_test_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/enum_test_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/file_schema_test_class_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/file_schema_test_class_spec.rb index d8ff3c21006..aa2716105de 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/file_schema_test_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/file_schema_test_class_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/file_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/file_spec.rb index 50c1c6c4e15..db8a5e94930 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/file_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/file_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/foo_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/foo_spec.rb index f7915c8d68e..57e37f92828 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/foo_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/foo_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/format_test_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/format_test_spec.rb index 9f1785bcbe2..d9e29942d41 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/format_test_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/format_test_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/has_only_read_only_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/has_only_read_only_spec.rb index 24392afa873..491b7faa76b 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/has_only_read_only_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/has_only_read_only_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/health_check_result_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/health_check_result_spec.rb index 2a1aaac7826..569c15cda1b 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/health_check_result_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/health_check_result_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_object1_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/inline_object1_spec.rb index 6fd340cd5c4..325ea712b2f 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/inline_object1_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/inline_object1_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_object2_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/inline_object2_spec.rb index cedf2d70a10..c3918233c39 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/inline_object2_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/inline_object2_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_object3_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/inline_object3_spec.rb index c092d479678..6c8d494b240 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/inline_object3_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/inline_object3_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_object4_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/inline_object4_spec.rb index 50fde4ba0e9..c03f3249141 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/inline_object4_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/inline_object4_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_object5_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/inline_object5_spec.rb index eab00d67881..4deff89ddaa 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/inline_object5_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/inline_object5_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_object_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/inline_object_spec.rb index 15b6e33b8c8..bbd61dc957f 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/inline_object_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/inline_object_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/inline_response_default_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/inline_response_default_spec.rb index 4433c9e1d48..ed67697fad9 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/inline_response_default_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/inline_response_default_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/list_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/list_spec.rb index b1829647634..1b50f389a55 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/list_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/list_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/map_test_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/map_test_spec.rb index 729dc35145c..b95e630efa0 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/map_test_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/map_test_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/mixed_properties_and_additional_properties_class_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/mixed_properties_and_additional_properties_class_spec.rb index bd675e88e7f..a8dba924ecc 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/mixed_properties_and_additional_properties_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/mixed_properties_and_additional_properties_class_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/model200_response_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/model200_response_spec.rb index 701e9891fb8..02e60ff3266 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/model200_response_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/model200_response_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/model_return_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/model_return_spec.rb index f4bdd9253ce..58ac90b608d 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/model_return_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/model_return_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/name_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/name_spec.rb index 6f8633c7563..58c6c0d0aea 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/name_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/name_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/nullable_class_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/nullable_class_spec.rb index f508ba98b4f..f72e4d0de2e 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/nullable_class_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/nullable_class_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/number_only_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/number_only_spec.rb index 093452f4608..03c332272b2 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/number_only_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/number_only_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/order_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/order_spec.rb index 9f7cb8f767e..385b1ff36af 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/order_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/order_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/outer_composite_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/outer_composite_spec.rb index fb670b2977e..16a8f4ecc1d 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/outer_composite_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/outer_composite_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_default_value_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_default_value_spec.rb index 72d3c549667..3003761cfa8 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_default_value_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_default_value_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_default_value_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_default_value_spec.rb index 310e4ee6fda..b525690284b 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_default_value_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_default_value_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_spec.rb index 3e69113a392..b40156fad9c 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_integer_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_spec.rb index d196aa079e9..c9a59704edd 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/outer_enum_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/pet_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/pet_spec.rb index 74ea31c6959..840b257fd67 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/pet_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/pet_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/read_only_first_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/read_only_first_spec.rb index 960d289dde7..e6e44f30f6c 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/read_only_first_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/read_only_first_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/special_model_name_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/special_model_name_spec.rb index c8264386763..ab4e628d4d1 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/special_model_name_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/special_model_name_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/tag_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/tag_spec.rb index 72cf2dd5115..72fbc4adccf 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/tag_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/tag_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/user_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/user_spec.rb index d64a11e2b48..553ba475425 100644 --- a/samples/openapi3/client/petstore/ruby/spec/models/user_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/models/user_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/ruby/spec/spec_helper.rb b/samples/openapi3/client/petstore/ruby/spec/spec_helper.rb index 6b9663ca664..0d935b668cd 100644 --- a/samples/openapi3/client/petstore/ruby/spec/spec_helper.rb +++ b/samples/openapi3/client/petstore/ruby/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.1.1-SNAPSHOT +OpenAPI Generator version: 4.2.0-SNAPSHOT =end diff --git a/samples/schema/petstore/mysql/.openapi-generator/VERSION b/samples/schema/petstore/mysql/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/schema/petstore/mysql/.openapi-generator/VERSION +++ b/samples/schema/petstore/mysql/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION b/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-msf4j/.openapi-generator/VERSION b/samples/server/petstore/java-msf4j/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/java-msf4j/.openapi-generator/VERSION +++ b/samples/server/petstore/java-msf4j/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION b/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin-server/ktor/README.md b/samples/server/petstore/kotlin-server/ktor/README.md index b0c381f68a7..318f632e229 100644 --- a/samples/server/petstore/kotlin-server/ktor/README.md +++ b/samples/server/petstore/kotlin-server/ktor/README.md @@ -2,7 +2,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -Generated by OpenAPI Generator 4.1.1-SNAPSHOT. +Generated by OpenAPI Generator 4.2.0-SNAPSHOT. ## Requires diff --git a/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-lumen/.openapi-generator/VERSION b/samples/server/petstore/php-lumen/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/php-lumen/.openapi-generator/VERSION +++ b/samples/server/petstore/php-lumen/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-silex/OpenAPIServer/.openapi-generator/VERSION b/samples/server/petstore/php-silex/OpenAPIServer/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/php-silex/OpenAPIServer/.openapi-generator/VERSION +++ b/samples/server/petstore/php-silex/OpenAPIServer/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-slim/.openapi-generator/VERSION b/samples/server/petstore/php-slim/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/php-slim/.openapi-generator/VERSION +++ b/samples/server/petstore/php-slim/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION b/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-ze-ph/.openapi-generator/VERSION b/samples/server/petstore/php-ze-ph/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/php-ze-ph/.openapi-generator/VERSION +++ b/samples/server/petstore/php-ze-ph/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java index 9e2703747a3..ebd3c208693 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java index a7858258322..13ac21ba725 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 831a3ef7016..cd60db168fd 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java index d4bdba6d8d1..af62a9983e9 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java index b4ec8f4ed00..40ed2e215d3 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java index 59364abcfbc..2cb5bb70300 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java index 01e92d3abec..56f8b6cab13 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java index 3773cff1b62..817dc07715c 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 1ba2000a46b..99ce09a52b7 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java index f9def84ffc9..c34aa51cd2d 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java index 88c0d12e9b6..82e43a5cdf3 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java index 5c0e0aff2a8..6405a145901 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/spring-mvc/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java index ae56d42d508..29e4ca2bd60 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java index 318dd09fa7e..bed5ab6e9c8 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 9e44a58698b..14260cfa172 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java index 1d3c60abb94..a231e04de54 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java index b052ab392c0..4ebdc878fd6 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java index ece84b50e5c..f1f83bdca88 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java index ae56d42d508..29e4ca2bd60 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java index 318dd09fa7e..bed5ab6e9c8 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 9e44a58698b..14260cfa172 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java index 1d3c60abb94..a231e04de54 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java index b052ab392c0..4ebdc878fd6 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java index ece84b50e5c..f1f83bdca88 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index eb024c9ea0f..61caaee84be 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java index 9a0eed03978..c4b5d9f05df 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index fd2741a860b..e272a565993 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java index 572b10c9311..87b5c959a01 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java index 8942a0faf2b..5dde5c32cd5 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java index 39eb0d9a6c0..06a8c414ec6 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION b/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java index ae56d42d508..29e4ca2bd60 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index 318dd09fa7e..bed5ab6e9c8 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 9e44a58698b..14260cfa172 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java index 1d3c60abb94..a231e04de54 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java index b052ab392c0..4ebdc878fd6 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java index ece84b50e5c..f1f83bdca88 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java index c7a9cad5f89..77f7f58d0bb 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index 5be814af9b4..4543ca9dafa 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index a65c7cbac74..a2574a26a05 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index eb29a6c04e8..162aefe1152 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java index 2d7dcf179f7..8bc11c1787a 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java index 63961ea1188..c8f4495a24e 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION b/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java index 7f97ef68a9d..b15ee20da39 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java index 07695c6ec81..8dea7ae167d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 826924b7655..32b84aeeabe 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java index 495d1027398..818d9e59e7b 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java index 5fac0dddba5..ce37da6ee8b 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java index 6ead7c75e2f..25b14fc4531 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION b/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java index 01e92d3abec..56f8b6cab13 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index eaa3162bec9..52ccd94e728 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 1ba2000a46b..99ce09a52b7 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java index 487002c0e1e..0932afdb3b4 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java index 88c0d12e9b6..82e43a5cdf3 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java index 5c0e0aff2a8..6405a145901 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION b/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java index 87185f50d1b..e2e6106cfd4 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java index 73ae14b0900..6d4952a05be 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java index 46c60a1d118..ddcb67f1e90 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java index b5804d2e066..d464099eb0d 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java index d224f1ffef2..41b91cc43a3 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java index 8545012843c..9e5e0b9779b 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/.openapi-generator/VERSION b/samples/server/petstore/springboot/.openapi-generator/VERSION index 2f81801b794..c3a2c7076fa 100644 --- a/samples/server/petstore/springboot/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java index 01e92d3abec..56f8b6cab13 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java index 57721a746fe..c5c7c4e7cc7 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 1ba2000a46b..99ce09a52b7 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index f9def84ffc9..c34aa51cd2d 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java index 88c0d12e9b6..82e43a5cdf3 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java index 5c0e0aff2a8..6405a145901 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.1.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.2.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */